Conditional Affinity
Conditional Affinity combines InLink and CrossLink affinities in a single affinity type and provides additional flexibility. Affinity grouping enables different plan items to be grouped together based on the evaluation of the XPATH expression defined at the product catalog. The two affinity grouping types are:
Inlik Affinity | Crosslink Affinity |
---|---|
Affinity groups plan items having the same parent product share a common LinkID user-defined field value and have the same affinity plan fragment name | Affinity groups plan items having the same affinity plan fragment name |
The additional configuration fields and rules in conditional affinity are:
Field | Description |
---|---|
AffinityType | Determines the type of affinity implemented.
|
AffinityCondition | Valid for Conditional type only. A String field containing an XPATH expression that evaluates to true or false based on data is in the order:
The XPATH expression can also be defined against the following plan data fields:
|
AffinityCorrelation | Valid for Conditional type only. The XPATH is evaluated on the Plan data and the order data. A String field containing an xpath expression based on a data is in the following order:
The XPATH expression can also be defined against the following plan data fields:
|
AffinityParentGroup | Valid for Conditional type only. A Boolean field containing the value true or false:
|
AffinityActionGroup | Valid for Conditional type only. A Boolean field containing the value true or false:
|
AffinityActionValue | AffinityActionValue is considered for grouping when AffinityActionGroup is set to true. This is valid for Conditional type only. String field containing an XPATH expression that evaluates to a String based on data is in the following order: The XPATH expression must evaluate to one of the following:
The XPATH expression can also be defined against the following plan data fields:
|
AffinityProvide | Provide plan fragment name for affinity grouped plan item. Only plan items with the Provide action and the same value in this field are grouped together |
AffinityUpdate | Update plan fragment name for affinity grouped plan item. Only plan items with the Update action and the same value in this field are grouped together |
AffinityCease | Cease plan fragment name for affinity grouped plan item. Only plan items with the Cease action and the same value in this field are grouped together |
AffinityCancel | Cancel plan fragment name for affinity grouped plan item. Only plan items with the Cancel action and the same value in this field are grouped together |
In the case where plan items with different actions are grouped together due to affinity, the following logic is used to determine what action to apply to the plan item. The following rules apply:
- If AffinityActionValue is specified, then the action of the plan item is the result of evaluating this xpath.
- If AffinityActionValue is blank, or evaluates to an Empty String, then the remaining rules apply:
- If all order lines have the same action, then the plan item action is the same as the order lines.
- If order lines have different actions, then:
- If at least one order line has PROVIDE action, then the plan item has PROVIDE action.
- Otherwise if at least one order line has CEASE action, then the plan item has CEASE action.
- Otherwise, the plan item has UPDATE action.
For details, see TIBCO® Product and Service Catalog Product Catalog Guide.
<Actual XPath> containing string $var/PlanItem
. For example, if you want to define the XPath for user-defined field name-value pair
MSISDN=123
, the XPath can be
$var/PlanItem[productID='GSMLine']/udfs[name='MSISDN']/value/text()
.
XPath evaluates data from the planItem. Refer to the sample planItem xml.
2) If XPath is defined against the order data, the format must be
<Actual XPath> containing string $var/Order.
Refer to
Sample order XML.
3) Default order data is considered for evaluation if XPATH does not contain
$var/PlanItem
.
When Automated Order Plan Development returns a plan it indicates the action of the plan item. Under normal circumstances, this maps directly to the action of the associated order line that caused the creation of the plan item. In the case where plan items with different actions are grouped together, the following logic is applicable to determine what action to apply to the plan item.
- If AffinityActionValue is specified, then the action of the plan item is the result of evaluating this xpath.
- If AffinityActionValue is blank, or evaluates to an Empty String, then the remaining rules apply
- If all order lines have the same action, then the plan item action is the same as the order lines.
- If order lines have different actions, then:
- If at least one order line has PROVIDE action, then the plan item has PROVIDE action.
- Otherwise if at least one order line has CEASE action, then the plan item has CEASE action.
- Otherwise, the plan item has UPDATE action.