6.2.1 Configuration Dialogue with Components
It is assumed that a Configuration Session has been created and a Configuration Dialogue has been initialized with the Configuration Model "Car".
A simple UI shows the visualization of the initial Configurator State in Figure 6.3.
Figure 6-3: A simple UI for the visualization of the Configuration State after the initialization of a Configuration Dialogue
Now we make three Decisions one after the other.
At first a Choice Decision in the Shared Configuration Model "SalesShared".
Decision 1
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "SalesRegion",
"sharedConfigurationModelId": "SalesShared",
"componentPath": []
},
"choiceValueId": "Africa",
"state": "Included"
}
Now a Choice Decision in the Component Configuration Model "Automobile".
Decision 2
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "Colour",
"componentPath": ["Automobile"]
},
"choiceValueId": "White",
"state": "Included"
}
And thirdly a Choice Decision in the Shared Configuration Model "Technical Shared".
Decision 3
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "Usage",
"sharedConfigurationModelId": "TechnicalShared",
"componentPath": []
},
"choiceValueId": "Summer",
"state": "Included"
}
The Consequences of the Decisions are delivered by the response of the following request:
GET {{baseUrl}}/engine/v2/session/configuration/consequence
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
Only those Consequences that are attributable to the evaluation of Rules are explained below. Attribute Values that can be both included and excluded are not considered. Only the relevant sections of the JSON structure are shown. The complete JSON file can be found here.
{
"attributeId": {
"localId": "CarSize",
"componentPath": []
},
"values": [
{
"choiceValueId": "Small",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Decision 2, Rule 1, Rule 3
{
"attributeId": {
"localId": "Style",
"componentPath": [
"Automobile",
"BackWheels",
"Rim"
]
},
"values": [
{
"choiceValueId": "TRX1",
"possibleDecisionStates": [
"Excluded"
]
},
{
"choiceValueId": "TRX2",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Rule 1, Rule 23
{
"attributeId": {
"localId": "MaximumSpeed",
"componentPath": [
"Automobile",
"BackWheels",
"Tire"
]
},
"values": [
{
"choiceValueId": "100",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Rule 1, Rule 24
{
"choiceValueId": "200",
"possibleDecisionStates": [
"Excluded"
]
}
Reasons for "Excluded": Decision 1, Rule 25
{
"choiceValueId": "180",
"possibleDecisionStates": [
"Included"
]
}
Reasons for "Included": (1) A choice of one value is mandatory. (2) 180 is the only remaining value, it is implicitly included.
{
"attributeId": {
"localId": "EngineType",
"componentPath": [
"Automobile",
"Engine"
]
},
"values": [
{
"choiceValueId": "Hybrid",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Decision 1, Rule 19
{
"attributeId": {
"localId": "SalesRegion",
"sharedConfigurationModelId": "SalesShared",
"componentPath": []
},
"values": [
{
"choiceValueId": "China",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Decision 2, Rule 18
{
"attributeId": {
"localId": "Construction",
"sharedConfigurationModelId": "TechnicalShared",
"componentPath": []
},
"values": [
{
"choiceValueId": "Car",
"possibleDecisionStates": [
"Included"
]
},
{
"choiceValueId": "Truck",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reason for "Included": Rule 1
Reasons for "Excluded": (1) A choice of ONE value is mandatory. (2) "Car" has been included. (3) "Truck" is the only remaining value, it is implicitly excluded.
{
"attributeId": {
"localId": "Usage",
"sharedConfigurationModelId": "TechnicalShared",
"componentPath": []
},
"values": [
{
"choiceValueId": "Winter",
"possibleDecisionStates": [
"Excluded"
]
}
]
}
Reasons for "Excluded": Decision 1, Rule 19
"componentConsequences": [
{
"attributeId": {
"localId": "Automobile",
"componentPath": []
},
"possibleDecisionStates": [
"Included"
]
Reason for "Included": The reference to a Component Configuration Model with the local identifier "Automobile" has been declared as "always included" in the Root Configuration Model "Car".
"attributeId": {
"localId": "BackWheels",
"componentPath": [
"Automobile"
]
},
"possibleDecisionStates": [
"Included"
]
Reason for "Included": The Component Configuration Model with the Configuration Model Identifier "Wheel" has been declared as "always included" in the Component Configuration Model with the identifier "Automobile". The identifier of the Component Attribute is "BackWheels".
This explanation also applies to "FrontWheels"below.
"attributeId": {
"localId": "FrontWheels",
"componentPath": [
"Automobile"
]
},
"possibleDecisionStates": [
"Included"
]
"attributeId": {
"localId": "Engine",
"componentPath": [
"Automobile"
]
},
"possibleDecisionStates": [
"Included"
]
Reason for "Included": The Component Configuration Model with the Configuration Model Identifier "Engine" has been declared as "always included" in the Component Configuration Model with the identifier "Automobile". The identifier of the Component Attribute is "Engine".
"attributeId": {
"localId": "SpareWheel",
"componentPath": [
"Automobile"
]
},
"inclusion": "Optional",
"selection": "Optional",
"possibleDecisionStates": [
"Included"
]
Reason for "Included": The Component Configuration Model with the Configuration Model Identifier "Wheel" has been declared as "optional included" in the Component Configuration Model with the identifier "Automobile". The identifier of the Component Attribute is "SpareWheel".
Due to Decision 1 and Rule 19, only "included" is currently possible.
"selection": "Optional" means that the selection of the Attribute with the identifier "SpareWheel" is optional in a Configurator. The user does not have to make a Decision.
"attributeId": {
"localId": "Transmission",
"componentPath": [
"Automobile"
]
},
"inclusion": "Optional",
"selection": "Optional",
"possibleDecisionStates": [
"Included",
"Excluded"
]
Reason for "Included", "Excluded": The Component Configuration Model with the Configuration Model Identifier "Transmission" has been declared as "optional included" in the Component Configuration Model with the identifier "Automobile". The identifier of the Component Attribute is "Transmission".
Based on the Decisions made to date, both "Included" and "Excluded" are still possible.
BTW: "Transmission" plays a role in Rule 12 and in Rule 15.
The explanation of the following Decision states is analogous to the explanations given above. The only difference: The referencing of a Component Configuration Model - e.g. "Rim" - takes place one level lower - e.g. "Automobile", "FrontWheels".
"attributeId": {
"localId": "Rim",
"componentPath": [
"Automobile",
"BackWheels"
]
},
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
"attributeId": {
"localId": "Tire",
"componentPath": [
"Automobile",
"BackWheels"
]
},
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
"attributeId": {
"localId": "Rim",
"componentPath": [
"Automobile",
"FrontWheels"
]
},
"isSatisfied": true,
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
},
{
"attributeId": {
"localId": "Tire",
"componentPath": [
"Automobile",
"FrontWheels"
]
},
"isSatisfied": true,
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
},
{
"attributeId": {
"localId": "Rim",
"componentPath": [
"Automobile",
"SpareWheel"
]
},
"isSatisfied": true,
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
},
{
"attributeId": {
"localId": "Tire",
"componentPath": [
"Automobile",
"SpareWheel"
]
},
"isSatisfied": true,
"inclusion": "Always",
"possibleDecisionStates": [
"Included"
]
}
]
}
Figure 6-4: A simple UI for the visualization of the Configuration State after the three Decisions above
Please note at this point: The layout of view elements is completely independent from the structure of the Configuration Model.
Now a Numeric Decision in the Root Configuration Model "Car".
Decision 4
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Numeric",
"attributeId": {
"localId": "CO2Emissions",
"componentPath": []
},
"state": "100"
}
The Consequences of this Decision are delivered by the response of the request above. Here the most important section:
"choiceConsequences": [
{
"attributeId": {
"localId": "CarSize",
"componentPath": []
},
"isSatisfied": true,
"cardinality": {
"lowerBound": 1,
"upperBound": 1
},
"values": [
{
"choiceValueId": "Big",
"possibleDecisionStates": [
"Excluded"
]
},
{
"choiceValueId": "Small",
"possibleDecisionStates": [
"Excluded"
]
},
{
"choiceValueId": "Standard",
"possibleDecisionStates": [
"Included"
]
}
]
}
]
Compared to the Consequences above, "Big" is now also excluded and "Standard" is included.
Reasons for the exclusion of "Big":
Reasons for the inclusion of "Standard":
(1) A choice of ONE value is mandatory.
(2) "Standard" is the only remaining value, it is implicitly included.
With larger quantities of Rules, the causes of inclusions or exclusions are not so easy to recognise. This is why there is an Explain function. Let us take as an example of why "Big" is excluded:
POST {{baseUrl}}/engine/v2/session/configuration/consequence/explain/why-state-not-possible
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "ChoiceValue",
"attributeId": {
"localId": "CarSize",
"componentPath": []
},
"choiceValueId": "Big",
"state": "Included"
}
The response is self-explanatory:
{
"constraintExplanations": [
{
"causedByCardinalities": [],
"causedByRules": [
{
"type": "Rule",
"constraintId": {
"localId": "Rule2:ForBigSizeCO2EmissionGreaterThan200",
"configurationModelId": "Car"
}
}
]
}
],
"decisionExplanations": [
{
"causedByChoiceDecisions": [],
"causedByNumericDecisions": [
{
"type": "Numeric",
"state": 100.0,
"attributeId": {
"localId": "CO2Emissions",
"componentPath": []
},
"reason": "StateNotPossible"
}
],
"causedByBooleanDecisions": [],
"causedByComponentDecisions": []
}
]
}
After Decision 4 (CO2Emissions = 100), Rule 2 applies and excludes "Big".
We will now make the following Decisions one after the other in this example Configuration Dialogue:
Decision 5
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "EngineType",
"componentPath": ["Automobile", "Engine"]
},
"choiceValueId": "Burner",
"state": "Included"
}
Decision 6
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "FuelType",
"componentPath": ["Automobile", "Engine"]
},
"choiceValueId": "Petrol",
"state": "Included"
}
Decision 7
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "Size",
"sharedConfigurationModelId": "TechnicalShared",
"componentPath": []
},
"choiceValueId": "16 inch",
"state": "Included"
}
Decision 8
A Boolean Decision in the Shared Configuration Model "TechnicalShared".
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Boolean",
"attributeId": {
"localId": "Tubeless",
"sharedConfigurationModelId": "TechnicalShared",
"componentPath": []
},
"state": false
}
Decision 9
PUT {{baseUrl}}/engine/v2/session/configuration/decision
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Choice",
"attributeId": {
"localId": "NumberOfWheels",
"componentPath": ["Automobile"]
},
"choiceValueId": "3",
"state": "Included"
}
And now a decision regarding one Component:
Decision 10
json PUT /engine/v2/session/configuration/decision X-SESSION-ID: Content-Type: application/json
```json
{
"type": "Component",
"attributeId": {
"localId": "Transmission",
"componentPath": ["Automobile"]
},
"state": "Excluded"
}
After the above decisions, the Configuration is not yet satisfied, as shown in figure 6-5:
Figure 6-5: A simple UI for the visualization of the Configuration State after the ten Decisions above
The reasons can be get by the following request:
POST {{baseUrl}}/engine/v2/session/configuration/consequence/explain/why-not-satisfied
X-SESSION-ID: {{sessionId}}
Content-Type: application/json
{
"type": "Configuration"
}
The response:
{
"constraintExplanations": [
{
"causedByCardinalities": [
{
"type": "Cardinality",
"attributeId": {
"localId": "NumberOfWheels",
"componentPath": [
"Automobile"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Style",
"componentPath": [
"Automobile",
"FrontWheels",
"Rim"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Number",
"componentPath": [
"Automobile",
"BackWheels"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Material",
"componentPath": [
"Automobile",
"SpareWheel",
"Rim"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Material",
"componentPath": [
"Automobile",
"BackWheels",
"Rim"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Power",
"componentPath": [
"Automobile",
"Engine"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Material",
"componentPath": [
"Automobile",
"FrontWheels",
"Rim"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Number",
"componentPath": [
"Automobile",
"SpareWheel"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "CustomerCategory",
"sharedConfigurationModelId": "SalesShared",
"componentPath": []
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Style",
"componentPath": [
"Automobile",
"SpareWheel",
"Rim"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Number",
"componentPath": [
"Automobile",
"FrontWheels"
]
}
},
{
"type": "Cardinality",
"attributeId": {
"localId": "Style",
"componentPath": [
"Automobile",
"BackWheels",
"Rim"
]
}
}
],
"causedByRules": []
}
],
"decisionExplanations": []
}
The Attributes listed in the response have all the Cardinality (1 ... 1), i.e. at least one Value must be assigned (selected in a UI). No Values have yet been assigned for these Attributes. Therefore, the configuration is not satisfied yet. In other words, the Configuration-Model-Satisfaction-State is "false".
Figure 6.5 also shows that the Values "Big" and "Small" for the Attribute "Car size" can no longer selected. In Chapter 8, we will get an Explanation for this from the Configuration Engine.