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

AUTO-FLEET-001 End-to-End Example

Determine Fleet Vehicle Replacement compares candidate fleet vehicles using lifecycle cost, downtime risk, maintenance trend, utilization criticality, and safety rating.

Automotive Fleet Vehicle Management Vehicle Lifecycle TOPSIS
IdentityIssue bearer token
DKSDiscover decision knowledge
MappingTranslate business data
DDEExecute request
Decision EngineRank vehicles
ExplanationExplain the result

Overview

AUTO-FLEET-001, Determine Fleet Vehicle Replacement, ranks candidate fleet vehicles by lifecycle cost, downtime risk, maintenance trend, utilization criticality, and safety rating.

Decision ID
AUTO-FLEET-001
Decision Name
Determine Fleet Vehicle Replacement
Description
Determine Fleet Vehicle Replacement using the relevant Fleet Vehicle Management business criteria, profile, and operating scenario.
Industry
Automotive
Sector
Fleet Vehicle Management (AUTO-FLEET)
Category
Vehicle Lifecycle (AUTO-FLEET-VEHICLE-LIFECYCLE)
Industry Profile
fleet-vehicle-replacement version 1.0.0
Default Profile
balanced
Default Scenario
standard
Algorithm
TOPSIS
Weight Strategy
Manual
Catalog
DKR-AUTO-RUNTIME-001, version 13.9.3
The deterministic Decision Engine evaluates and ranks the vehicles. The Explanation of Decision Result is explanatory only and must not select, rerank, recalculate, or override the deterministic result.

Understanding This Decision

Determine Fleet Vehicle Replacement helps fleet operations teams decide which vehicle should be prioritized for replacement by balancing ownership cost, operational downtime, maintenance trend, mission criticality, and safety condition.

Business question

Which vehicle should be recommended for replacement in the selected Fleet Vehicle Management context?

Expected outcome

A ranked list of candidate vehicles with a recommended vehicle and criterion-level score evidence.

Typical users

Fleet managers, maintenance planners, operations managers, asset lifecycle teams, finance teams, and integration teams building fleet replacement workflows.

Decision boundary

Use this decision to prioritize supplied fleet vehicles. It does not replace safety inspection, regulatory review, procurement approval, driver input, or asset-disposal governance.

Architecture

  1. Request a token from https://identity.vinquery.com/connect/token.
  2. Use the returned jwtToken as the bearer token.
  3. Load https://dks.vinquery.com/decisioncatalog.
  4. Load https://dks.vinquery.com/decisioncatalog/decisions/AUTO-FLEET-001.
  5. Use the industry profile fleet-vehicle-replacement version 1.0.0.
  6. Choose a valid profileId and scenarioId from the decision metadata.
  7. Submit canonical option values to https://dde.vinquery.com/api/v1/decide.
  8. Retain requestId and correlationId for tracing.
Token propagation: during catalog-authoritative execution, DDE forwards the caller bearer token plus request identifiers to DKS so catalog access and execution share the same security and tracing context.

Authentication

Request a secure session token from Identity. Keep credentials server-side, cache tokens, renew before expiration, avoid duplicate concurrent token requests, and never log authorization headers.

Token request
POST https://identity.vinquery.com/connect/token
Content-Type: application/json

{
  "clientId": "{clientId}",
  "clientSecret": "{clientSecret}",
  "audience": "vinquery:api:decisioq"
}
Token response shape
{
  "requestId": "0HNE...",
  "jwtToken": "{jwtToken}",
  "tokenType": "Bearer",
  "expiresIn": 1800,
  "expiresUtc": "2026-07-19T00:30:00Z",
  "userId": 1166,
  "consumerName": "Example API Consumer",
  "apiConsumerId": "00000000-0000-0000-0000-000000000000"
}

Catalog Discovery

Retrieve current metadata instead of permanently hard-coding criteria or profiles. DKS is authoritative for version-aware decision knowledge.

Catalog
GET https://dks.vinquery.com/decisioncatalog
Authorization: Bearer {jwtToken}
Decision Detail
GET https://dks.vinquery.com/decisioncatalog/decisions/AUTO-FLEET-001
Authorization: Bearer {jwtToken}

Criteria

Use exact criterionId keys. Display names can change; canonical IDs drive validation, mapping, weighting, and execution.

Criterion IDNameDescriptionDirectionWeightUnitData TypeValidationRequired
lifecycle_costLifecycle CostExpected financial cost associated with the vehicle over the replacement horizon.minimize25CurrencyCurrencynon_negative_currencytrue
downtime_riskDowntime RiskExpected operating disruption or service interruption risk.minimize20RatingNumberrating_1_to_5true
maintenance_trendMaintenance TrendRecent maintenance pattern indicating increasing repair burden.minimize20CurrencyNumbernon_negative_currencytrue
utilization_criticalityUtilization CriticalityHow important the vehicle is to day-to-day operations and service coverage.maximize20PercentageNumberpercentage_0_to_100true
safety_ratingSafety RatingInspection-based safety rating for continued use.maximize15RatingNumberrating_1_to_5true

Constraint Processing

This decision currently has no catalog-defined hard constraints. All validated candidates proceed to criteria-based ranking.

Verified Catalog ConstraintStatusEffect
None returned by DKS for AUTO-FLEET-001No hard constraints definedCandidate eligibility is determined by request validation; all validated candidates are ranked by criteria.
Eligible and Excluded Candidates
{
  "constraintSummary": {
    "definedConstraintCount": 0,
    "activeConstraintCount": 0,
    "eligibleOptionCount": 3,
    "excludedOptionCount": 0,
    "eligibleOptions": [
      "VEHICLE-001",
      "VEHICLE-002",
      "VEHICLE-003"
    ],
    "excludedOptions": []
  }
}
Constraint Handling Pattern
const constraints = decisionDetail.constraints || [];
if (constraints.length === 0) {
  // No catalog-defined hard constraints.
  // Submit all validated candidates for criteria-based ranking.
}

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-FLEET-001, no candidates are excluded by catalog-defined constraints because DKS currently defines none for this decision.

Industry Profile

The active industry profile reads fleet asset options from $.assets, option IDs from option.assetId, and display names from option.unitName. It prepares canonical values for AUTO-FLEET-001 before DDE applies decision validation and ranking.

Profile ID
fleet-vehicle-replacement
Version
1.0.0
Options Path
$.assets
Option ID Path
option.assetId
Display Name Path
option.unitName
Client Business Data PathTransformationCanonical Criterion IDUnitValidation
option.annualMaintenanceCost, option.projectedRepairCost, option.downtimeCostsumlifecycle_costCurrencynon_negative_currency
option.daysOutOfServiceoption.daysOutOfService * 10downtime_riskRatingrating_1_to_5
option.repairEventsLastYearoption.repairEventsLastYear * 12maintenance_trendCurrencynon_negative_currency
option.missionCriticalitymission-criticality lookuputilization_criticalityPercentagepercentage_0_to_100
option.safetyInspectionScoredirect numeric valuesafety_ratingRatingrating_1_to_5
Raw Business Data
{
  "fleetId": "FLEET-DEMO-001",
  "assets": [
    {
      "assetId": "VEHICLE-001",
      "unitName": "Vehicle 001",
      "annualMaintenanceCost": 8200,
      "projectedRepairCost": 6200,
      "downtimeCost": 3600,
      "daysOutOfService": 0.4,
      "repairEventsLastYear": 6,
      "missionCriticality": 92,
      "safetyInspectionScore": 4.5
    }
  ]
}
Prepared Option Values
{
  "optionId": "VEHICLE-001",
  "name": "Vehicle 001",
  "values": {
    "lifecycle_cost": 18000,
    "downtime_risk": 4,
    "maintenance_trend": 72,
    "utilization_criticality": 92,
    "safety_rating": 4.5
  }
}
Client applications own operational facts. DKS owns canonical decision knowledge.

Profiles and Scenarios

Profiles adjust weights. Scenarios describe operating context. Both are discovered from the DKS decision detail response.

Profile IDNamePurpose
balancedBalancedPreserves the default criterion priorities for this fleet decision.
cost_focusedCost FocusedEmphasizes minimized financial and operating cost criteria.
quality_focusedQuality FocusedEmphasizes maximized quality, value, condition, and performance criteria.
risk_averseRisk AverseEmphasizes risk reduction, reliability, safety, condition, and repair exposure.
Scenario IDNameUse When
standardStandard Operating ScenarioNormal fleet replacement and asset lifecycle context.
budget_reductionBudget Reduction ScenarioCapital, cost, or budget pressure is higher than normal.
high_demandHigh Demand ScenarioAvailability, demand, or throughput pressure is higher than normal.
emergency_operationsEmergency Operations ScenarioOperational continuity and risk control outweigh routine optimization.

Prepared Input

The active DDE catalog execution contract accepts decisionId, profileId, scenarioId, algorithm, weightStrategy, runSensitivity, requestContext, and options.

Prepared Decision Input JSON
{
  "decisionId": "AUTO-FLEET-001",
  "profileId": "balanced",
  "scenarioId": "standard",
  "algorithm": "TOPSIS",
  "weightStrategy": "Manual",
  "runSensitivity": false,
  "requestContext": {
    "correlationId": "auto-fleet-001-demo-001"
  },
  "options": [
    {
      "optionId": "VEHICLE-001",
      "name": "Vehicle 001",
      "values": {
        "lifecycle_cost": 18000,
        "downtime_risk": 4,
        "maintenance_trend": 72,
        "utilization_criticality": 92,
        "safety_rating": 4.5
      }
    },
    {
      "optionId": "VEHICLE-002",
      "name": "Vehicle 002",
      "values": {
        "lifecycle_cost": 14500,
        "downtime_risk": 3,
        "maintenance_trend": 54,
        "utilization_criticality": 76,
        "safety_rating": 4
      }
    },
    {
      "optionId": "VEHICLE-003",
      "name": "Vehicle 003",
      "values": {
        "lifecycle_cost": 22500,
        "downtime_risk": 5,
        "maintenance_trend": 98,
        "utilization_criticality": 88,
        "safety_rating": 3.5
      }
    }
  ]
}

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-fleet-001-demo-001" \
  --data @auto-fleet-001-execute.json

DDE retrieves authoritative criteria, profiles, scenarios, and validation metadata from DKS, composes the engine-ready request, and executes the deterministic ranking.

Interpret the Result

Use decisionResult.winner and decisionResult.ranking as the deterministic result. Scores are useful within the same run; avoid comparing raw scores across unrelated decisions or catalog versions.

Successful Response Shape
{
  "service": "decisioq",
  "version": "7.6.3",
  "requestId": "0HNE...",
  "operation": "Decide",
  "success": true,
  "decisionType": "AUTO-FLEET-001",
  "decisionVersion": "13.9.3",
  "timestampUtc": "2026-07-19T00:00:00Z",
  "decisionResult": {
    "winner": "VEHICLE-001",
    "confidence": 72.4,
    "ranking": [
      {
        "optionId": "VEHICLE-001",
        "score": 0.8421,
        "breakdown": {
          "lifecycle_cost": 0.25,
          "utilization_criticality": 0.20
        },
        "normalizationBreakdown": {}
      }
    ],
    "excludedOptions": [],
    "explanation": {
      "summary": "Vehicle 001 ranked highest based on the submitted criteria.",
      "strengths": [],
      "weaknesses": [],
      "exclusions": []
    }
  },
  "constraintSummary": {
    "definedConstraintCount": 0,
    "activeConstraintCount": 0,
    "eligibleOptionCount": 3,
    "excludedOptionCount": 0,
    "eligibleOptions": [
    "VEHICLE-001",
    "VEHICLE-002",
    "VEHICLE-003"
    ],
    "excludedOptions": []
  },
  "executionTrace": {
    "selectedProfileId": "balanced",
    "selectedScenarioId": "standard",
    "weightSource": "dksProfile:balanced",
    "effectiveWeights": {
      "lifecycle_cost": 25,
      "utilization_criticality": 20
    }
  },
  "warnings": [],
  "requestContext": {
    "correlationId": "auto-fleet-001-demo-001"
  }
}
WinnerThe selected vehicle option ID in decisionResult.winner.
WarningsNon-fatal issues to review before relying on the recommendation.
Operational MetadataKeep request IDs, correlation IDs, selected profile, selected scenario, and catalog version for support.

Sensitivity Analysis

Use "runSensitivity": true when the client needs evidence about recommendation stability. DecisioQ varies criterion weights by controlled factors while keeping submitted options and values fixed.

Sensitivity Result Shape
{
  "runSensitivity": true,
  "sensitivityResult": {
    "stableWinner": true,
    "winner": "VEHICLE-001",
    "mostSensitiveCriterion": "lifecycle_cost",
    "confidence": 95,
    "criterionImpacts": {
      "lifecycle_cost": 0.1842
    },
    "winnerChangeCounts": {
      "lifecycle_cost": 0
    }
  }
}
Sensitivity Analysis does not replace the deterministic decision result. It provides evidence about how stable that result is under permitted changes.

Explanation of Decision Result

The Explanation Service receives the finalized deterministic result and a controlled evidence package. It is synchronous in the current execution flow when configured and returns under the vendor-neutral ai block. If explanation generation fails silently, the deterministic result remains available.

Explanation Shape
{
  "ai": {
    "enabled": true,
    "generated": true,
    "schemaValidated": true,
    "explanation": {
      "summary": "The selected vehicle has the strongest overall replacement priority.",
      "whyRecommended": "It combined high utilization criticality with acceptable safety evidence and manageable lifecycle cost.",
      "keyDrivers": [],
      "tradeoffs": [],
      "competitors": [],
      "sensitivitySummary": "Sensitivity analysis was not included in this response.",
      "scenarioSummary": "The standard operating scenario was selected.",
      "risks": [],
      "nextSteps": [],
      "assumptions": []
    }
  }
}

The Explanation of Decision Result must not receive raw private vehicle files or unrestricted notes. It explains the already-finalized result; it does not select, rerank, recalculate, or override it.

Tracing and Logs

Use request identifiers to connect client, Identity, DKS, and DDE activity. Authentication and identity-security activity belongs in IdentityAuditEvents. Catalog, mapping, decision execution, sensitivity, and explanation operations belong in decisioq_log.

X-Request-Id
Optional client-supplied request ID. If omitted, DDE or DKS generates one.
X-Correlation-Id
Optional client workflow ID propagated from DDE to DKS.
requestContext.correlationId
Payload value echoed by DDE and used for execution logging.
DecisionId
Recorded for decision-specific operations. General catalog and identity operations may not have a decision ID.
ServiceNameOperationRequestIdCorrelationIdDecisionIdStatusTimestamp
IdentityToken issuedidentity requestoptionalSuccessUTC
DKSDecisionCatalog.DecisionDefinitionDDE propagated requestauto-fleet-001-demo-001AUTO-FLEET-001SuccessUTC
DDEDecideDDE requestauto-fleet-001-demo-001AUTO-FLEET-001SuccessUTC
Never log API Consumer secrets, bearer tokens, raw authorization headers, or sensitive vehicle details.

Code Examples

These examples authenticate, retrieve AUTO-FLEET-001 metadata, validate profile and scenario selections, execute the decision, pass a correlation ID, and print the deterministic result.

Environment variables
DECISIOQ_CLIENT_ID
DECISIOQ_CLIENT_SECRET

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

Troubleshooting

SymptomLikely CauseHTTP Status or ErrorCorrective ActionWhere to Investigate
Token rejectedInvalid credentials or access code401 or 400Request a new server-side token; do not expose credentials in browser JavaScript.IdentityAuditEvents
Unknown decision IDDecision is absent from active DKS catalog404Verify AUTO-FLEET-001 in /decisioncatalog/decisions/AUTO-FLEET-001.DKS logs
Invalid profile or scenarioRequest value is not listed in decision metadata400Use one of the profile or scenario IDs returned by DKS.DDE validation logs
Missing criterionOption values omit a required canonical criterion400 validation errorSend all five required AUTO-FLEET-001 criteria for every vehicle.DDE validation response
Out-of-range valueScore outside 0-100 or negative currency value400 validation errorApply score_0_to_100 and non_negative_currency before submit.Client validation, DDE validation
Service unavailableDKS, DDE, or Identity unavailable5xx or non-JSON upstream errorCheck health endpoints and server logs.Hosting/IIS logs and DecisioQ logs
Explanation unavailableExplanation provider disabled or failed silentlySuccess with missing or failed ai blockUse deterministic decisionResult; treat explanation as optional.DDE application logs
Download link failsStatic asset missing from website404Verify the file exists under examples/auto-fleet-001.Website static files

Production Checklist

Security

Keep API Consumer credentials server-side, use HTTPS, cache JWTs, renew before expiration, never log secrets, and ensure the API Consumer is linked to a DecisioQ account for usage accounting.

Knowledge and Versioning

Retrieve DKS metadata, preserve industry profile version 1.0.0, and monitor catalog version changes.

Execution Reliability

Use timeouts, cancellation tokens, structured error handling, and avoid unsafe automatic retries unless idempotency is established.

Observability

Propagate X-Correlation-Id, retain requestId, and distinguish DKS failures from DDE failures.

Explanation Safety

Persist deterministic results separately and isolate explanation failure from ranking success.

Testing

Use contract tests, validation tests, sensitivity tests, and privacy-safe vehicle samples.