DecisioQ System Architecture Decision Concepts Decision List API Guide Client Kit Developer Center Decision Studio Quick Start Playground End-to-End Examples

AUTO-REPR-070 End-to-End Example

Evaluate Mobile Service Feasibility using Identity, the secured Decision Catalog, Decision Catalog token propagation, and Prepared Criteria Mode execution.

Automotive Auto Repair Business Performance TOPSIS
IdentityIssue bearer token
CatalogDiscover decision metadata
ProfileSelect weights and scenario
ExecuteRun deterministic ranking
ExplainReview result context

Overview

AUTO-REPR-070, Evaluate Mobile Service Feasibility, ranks candidate mobile repair or maintenance service models by market demand, startup cost, margin potential, technician availability, service scope fit, and operational risk.

Decision ID
AUTO-REPR-070
Decision Name
Evaluate Mobile Service Feasibility
Decision Preparation Model
auto-repair-evaluate-mobile-service-feasib-auto-repr-070 version 1.0.0
Default Profile
balanced
Default Scenario
standard
Catalog
DKR-AUTO-RUNTIME-001, active Decision Catalog runtime catalog
The deterministic Decision Service ranks the options. The explanation object is explanatory only and must not choose, rerank, or override the deterministic result.

Understanding This Decision

Evaluate Mobile Service Feasibility helps an auto repair business compare possible mobile service models before investing in vehicles, technicians, scheduling capacity, and operating processes.

Business question

Which mobile service model should be recommended for the selected Auto Repair operating context?

Expected outcome

A recommended mobile service model or ranked set of mobile service models with the criteria that most influenced the result.

Typical users

Operations managers, service directors, repair-shop owners, fleet service planners, and integrators building repair-service decision workflows.

Decision boundary

Use this decision to rank supplied mobile service concepts. It does not discover missing options or replace financial, safety, staffing, or legal review.

Criteria

Criterion IDs are intentionally stable machine identifiers. Display labels are for users; request values should be keyed by canonical criterionId.

Criterion IDNameDirectionWeightValidation
market_demand_scoreMarket Demand Scoremaximize25score_0_to_100
startup_costStartup Costminimize20non_negative_currency
margin_potential_scoreMargin Potential Scoremaximize20score_0_to_100
technician_availability_scoreTechnician Availability Scoremaximize10score_0_to_100
service_scope_fitService Scope Fitmaximize15score_0_to_100
operational_risk_scoreOperational Risk Scoreminimize10score_0_to_100

Data Preparation Guide

Loading criterion-specific integration guidance...

Constraint Processing

This decision includes a catalog-defined hard constraint. Decision Catalog returns the constraint with the decision detail, and Decision Service evaluates it before criteria-based ranking.

Verified Catalog ConstraintStatusEffect
AUTO-REPR-070-OPERATIONAL-RISK-MAX-40Hard, enabled, mandatoryRequires operational_risk_score <= 40 before a candidate can participate in ranking.
Eligible and Excluded Candidates
{
  "constraintSummary": {
    "definedConstraintCount": 1,
    "activeConstraintCount": 1,
    "eligibleOptionCount": 2,
    "excludedOptionCount": 1,
    "eligibleOptions": [
      "option-1",
      "option-2"
    ],
    "excludedOptions": [
      {
        "optionId": "option-3",
        "reasons": [
          "Operational risk score is above the maximum threshold of 40."
        ]
      }
    ]
  }
}
Constraint Handling Pattern
const constraints = decisionDetail.constraints || [];
if (constraints.length > 0) {
  // Decision Service applies catalog constraints before ranking.
  // Excluded candidates appear in response.constraintSummary.excludedOptions.
}

const summary = response.constraintSummary;
const excluded = response.decisionResult?.excludedOptions || [];

Excluded candidates do not participate in ranking because hard constraints are evaluated before scoring. For AUTO-REPR-070, option-3 is excluded from the showcase sample because its operational risk score is above the catalog threshold.

Decision Preparation Model

The published Decision Preparation Model validates and transforms illustrative Business Data into the canonical criteria required by AUTO-REPR-070 before Decision Service applies ranking.

Profile ID
auto-repair-evaluate-mobile-service-feasib-auto-repr-070
Version
1.0.0
Options Path
$.repairOrders
Option ID Path
$.optionId
Display Name Path
$.name
Client Business Data PathTransformationCanonical Criterion IDUnitValidation
option.assessment.marketDemandScoredirect valuemarket_demand_scoreScoreInput Contract
option.financial.startupCostdirect valuestartup_costCurrencyInput Contract
option.assessment.marginPotentialScoredirect valuemargin_potential_scoreScoreInput Contract
option.assessment.technicianAvailabilityScoredirect valuetechnician_availability_scoreScoreInput Contract
option.business.performance.serviceScopeFitdirect valueservice_scope_fitScoreInput Contract
option.risk.operationalRiskScoredirect valueoperational_risk_scoreScoreInput Contract
Illustrative Business Data
{
  "requestContext": {
    "sourceSystem": "automotive-profile-factory",
    "correlationId": "factory-auto-repr-070"
  },
  "repairOrders": [
    {
      "optionId": "REPAIR-070-01",
      "name": "Evaluate Mobile Service Feasibility Option 1",
      "assessment": {
        "marketDemandScore": 81.0,
        "marginPotentialScore": 65.0,
        "technicianAvailabilityScore": 56.0
      },
      "financial": {
        "startupCost": 50000.0
      },
      "business": {
        "performance": {
          "serviceScopeFit": 43.0
        }
      },
      "risk": {
        "operationalRiskScore": 36.0
      }
    },
    {
      "optionId": "REPAIR-070-02",
      "name": "Evaluate Mobile Service Feasibility Option 2",
      "assessment": {
        "marketDemandScore": 49.0,
        "marginPotentialScore": 34.0,
        "technicianAvailabilityScore": 42.0
      },
      "financial": {
        "startupCost": 147500.0
      },
      "business": {
        "performance": {
          "serviceScopeFit": 28.0
        }
      },
      "risk": {
        "operationalRiskScore": 34.0
      }
    }
  ]
}
Prepared Option Values
{
  "optionId": "REPAIR-070-01",
  "name": "Evaluate Mobile Service Feasibility Option 1",
  "values": {
    "market_demand_score": 81.0,
    "startup_cost": 50000.0,
    "margin_potential_score": 65.0,
    "technician_availability_score": 56.0,
    "service_scope_fit": 43.0,
    "operational_risk_score": 36.0
  }
}
This example illustrates the published request structure. Adapt it to your organization and validate it against the Input Contract.

Profiles and Scenarios

This example selects a Profile for evaluation emphasis and a Scenario for operating context. Discover both from the selected Decision Catalog definition.

Profile IDNamePurpose
balancedBalancedPreserves the default Decision Catalog criterion weights.
cost_controlCost ControlPlaces stronger emphasis on controlling repair, labor, warranty, technology, and operating costs.
quality_complianceQuality & CompliancePlaces stronger emphasis on safety, repair quality, regulatory compliance, risk control, and governance.
growth_digitalGrowth & DigitalPlaces stronger emphasis on customer experience, revenue growth, digital adoption, and strategic capability.
Scenario IDNameUse When
standardStandard Operating ScenarioNormal repair-shop operating context for routine service execution.
capacity_constraintCapacity Constraint ScenarioTechnician, bay, equipment, or floor-space capacity is constrained.
compliance_focusCompliance Focus ScenarioRegulatory, warranty, cybersecurity, privacy, or manufacturer governance concerns are prominent.
growth_investmentGrowth Investment ScenarioInvestment, digital transformation, market growth, or new service capability is being evaluated.

Prepared Input

For Prepared Criteria Mode, send decisionId, selected profile/scenario IDs, and option values keyed by canonical criterion ID. The showcase request includes two eligible mobile service models and one excluded model so constraint handling is visible.

Prepared Criteria Mode JSON
{
  "decisionId": "AUTO-REPR-070",
  "mappingProfileId": "auto-repair-evaluate-mobile-service-feasib-auto-repr-070",
  "mappingProfileVersion": "1.0.0",
  "profileId": "balanced",
  "scenarioId": "standard",
  "algorithm": "TOPSIS",
  "weightStrategy": "Expert",
  "runSensitivity": false,
  "requestContext": {
    "correlationId": "auto-repr-070-demo-001"
  },
  "options": [
    {
      "optionId": "option-1",
      "name": "Mobile Battery Replacement",
      "values": {
        "market_demand_score": 88,
        "startup_cost": 450,
        "margin_potential_score": 88,
        "technician_availability_score": 88,
        "service_scope_fit": 88,
        "operational_risk_score": 20
      }
    },
    {
      "optionId": "option-2",
      "name": "Mobile Tire Service",
      "values": {
        "market_demand_score": 81,
        "startup_cost": 750,
        "margin_potential_score": 81,
        "technician_availability_score": 81,
        "service_scope_fit": 81,
        "operational_risk_score": 35
      }
    },
    {
      "optionId": "option-3",
      "name": "Mobile Maintenance Van",
      "values": {
        "market_demand_score": 74,
        "startup_cost": 1100,
        "margin_potential_score": 74,
        "technician_availability_score": 74,
        "service_scope_fit": 74,
        "operational_risk_score": 50
      }
    }
  ]
}

Execute

cURL
curl -X POST "https://dde.vinquery.com/api/v1/decide" \
  -H "Authorization: Bearer ${DECISIOQ_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-Correlation-Id: auto-repr-070-demo-001" \
  --data @auto-repr-070-execute.json

Decision Service retrieves authoritative criteria, constraints, and validation metadata from Decision Catalog, executes the deterministic ranking, and returns the decision result plus execution metadata.

Interpret the Result

The successful response includes both the deterministic decisionResult and a top-level explanation object. The explanation adds context but does not select, rerank, recalculate, or override the ranking.

Successful Response Shape
{
  "success": true,
  "decisionType": "AUTO-REPR-070",
  "decisionResult": {
    "winner": "option-1",
    "ranking": [
      {
        "optionId": "option-1",
        "name": "Mobile Battery Replacement",
        "score": 0.91
      },
      {
        "optionId": "option-2",
        "name": "Mobile Tire Service",
        "score": 0.84
      }
    ],
    "excludedOptions": [
      {
        "optionId": "option-3",
        "reasons": [
          "Operational risk score is above the maximum threshold of 40."
        ]
      }
    ]
  },
  "explanation": {
      "summary": "The selected mobile service model provided the strongest overall fit.",
      "whyRecommended": "It combined strong availability and quality with acceptable cost.",
      "keyDrivers": [],
      "tradeoffs": [],
      "competitors": [],
      "sensitivitySummary": "Sensitivity analysis was not included in this response.",
      "scenarioSummary": "The standard scenario was selected.",
      "risks": [],
      "nextSteps": [],
      "assumptions": []
  },
  "constraintSummary": {
    "definedConstraintCount": 1,
    "activeConstraintCount": 1,
    "eligibleOptionCount": 2,
    "excludedOptionCount": 1
  },
  "requestContext": {
    "correlationId": "auto-repr-070-demo-001"
  }
}
WinnerThe selected option ID in decisionResult.winner.
RankingAll eligible options ordered by score.
Constraint SummaryEligible and excluded candidates with reasons.

Sensitivity Analysis

runSensitivity is an optional execution flag supported by both Business Data Mode and Prepared Criteria Mode. Set it to true when the client wants recommendation-stability information in the same response. The sensitivity engine analyzes the prepared criteria produced by either input path, perturbs criterion weights by controlled factors, and reports whether the winner remains stable.

Sensitivity Result Shape
{
  "sensitivityResult": {
    "stableWinner": true,
    "winner": "option-1",
    "mostSensitiveCriterion": "startup_cost",
    "confidence": 95,
    "criterionImpacts": {
      "startup_cost": 0.1842
    },
    "winnerChangeCounts": {
      "startup_cost": 0
    }
  }
}

Use sensitivity output to decide whether a recommendation is robust enough for automation or should be reviewed by a person.

Explanation of Decision Result

Every successful response includes a provider-neutral top-level explanation object. It explains the already-finalized deterministic result and does not change the ranking.

Explanation Shape
{
  "explanation": {
      "summary": "The selected mobile service model provided the strongest overall fit.",
      "whyRecommended": "It combined strong availability and quality with acceptable cost.",
      "keyDrivers": [],
      "tradeoffs": [],
      "competitors": [],
      "sensitivitySummary": "Sensitivity analysis was not included in this response.",
      "scenarioSummary": "The standard scenario was selected.",
      "risks": [],
      "nextSteps": [],
      "assumptions": []
  }
}
Explanation output is supporting context. Business-facing pages should render the explanation, warnings, assumptions, and limitations without provider branding.

Tracing and Logs

Use request identifiers to connect client, catalog, and execution activity during support or integration testing.

X-Request-Id
Optional client-supplied request ID. If omitted, the server generates one.
X-Correlation-Id
Optional client correlation value propagated from Decision Service to Decision Catalog.
requestContext.correlationId
Optional payload value echoed in the response and used for tracing.
configurationUsed
The authoritative effective weight strategy, ranking algorithm, profile, scenario, sensitivity setting, and source for each value.
diagnostics
Safe execution counts returned only when responseOptions.includeDiagnostics is true.

Code Examples

These examples demonstrate the current DecisioQ flow:

  1. Request jwtToken from https://identity.vinquery.com/connect/token.
  2. Load AUTO-REPR-070 metadata from https://dks.vinquery.com/decisioncatalog/decisions/AUTO-REPR-070.
  3. Execute a Prepared Criteria Mode at https://dde.vinquery.com/api/v1/decide.

Set these environment variables before running any companion example:

Environment variables
DECISIOQ_CLIENT_ID
DECISIOQ_CLIENT_SECRET
DECISIOQ_AUDIENCE=vinquery:api:decisioq

Optional:
DECISIOQ_IDENTITY_URL=https://identity.vinquery.com/connect/token
DECISIOQ_DKS_URL=https://dks.vinquery.com
DECISIOQ_DDE_URL=https://dde.vinquery.com

Download the source files directly:

Troubleshooting

SymptomLikely CauseWhat to Check
401 UnauthorizedMissing, expired, or invalid bearer token.Request a fresh jwtToken from Identity and send it as Authorization: Bearer ....
Decision not foundThe decision ID is not in the active catalog.Load /decisioncatalog/decisions/AUTO-REPR-070 and confirm the ID is published.
Validation failedA required criterion value is missing or outside its rule.Use canonical criterion IDs and keep score values in the expected range.
Candidate excludedThe candidate violates a hard catalog constraint.Review constraintSummary.excludedOptions; for AUTO-REPR-070, operational risk must be no greater than 40.
HTML error responseAn upstream hosted service failed before returning JSON.Check service health and server logs for Identity, Decision Catalog, or Decision Service.

Production Checklist

Security

Keep API Consumer credentials and jwtTokens on the server side. Use HTTPS, short-lived bearer tokens, and an API Consumer linked to a DecisioQ account for usage accounting.

Catalog

Load decision metadata from Decision Catalog and cache cautiously. Refresh when catalog versions change.

Request Quality

Use canonical criterion IDs, validate value ranges, and send at least two candidate options.

Operations

Send correlation IDs, record request IDs, and monitor non-JSON upstream failures.

Explanation

Display explanation text as supporting context only. Never let generated explanation text override deterministic results.

User Experience

Show business labels to users and keep raw execution trace collapsed for advanced diagnostics.