Conditional Affinity

Fulfillment Catalog 2.0.0 introduced Conditional Affinity modeling, which 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 following attributes are available at the record level in the AFFINITY GROUP of product or at the ProductHasProvidePlanFragment, ProductHasUpdatePlanFragment, ProductHasCeasePlanFragment, ProductHasCancelPlanFragment, and ProductHasCustomPlanFragment relationships. The additional configuration fields and rules in conditional affinity are :

AffinityType Determines the type of affinity implemented.
  • InLink
  • CrossLink
  • Sequenced Affinity
  • ConditionalAffinity
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:
  • If the expression is true, the product plan item is affinity-grouped
  • If the expression is false, then the product plan item is not affinity-grouped
  • If the field is blank, assume that the value is true
  • If the XPATH expression evaluates to anything other than the true or false, AOPD fails, and returns an exception

The XPATH expression evaluates against the following data fields on the order:

  • Order Header UDF Name and Value
  • Order Line ProductID
  • Order Line Action and ActionMode
  • Order Line UDF Name and Value

The XPATH expression can also be defined against the following plan data fields:

  • planItem productID
  • planItem UDF name value
  • planItem Action
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:
  • All plan items that evaluate to the same AffinityCorrelation are grouped together
  • The field is functionally similar to the LinkID method of correlating plan items in the InLink affinity. However, it allows correlation based on complex conditions without a restriction on the UDF names
  • If the field is blank, a default LinkID value is shared by all other blank configurations
  • If the XPATH expression evaluates to an empty string, the XPATH expression is blank, or assume a default LinkID

The XPATH expression evaluates against the following order data fields:

  • Order Header UDF Name and Value
  • Order Line ProductID
  • Order Line Action and ActionMode
  • Order Line UDF Name and Value

The XPATH expression can also be defined against the following plan data fields:

  • planItem productID
  • planItem UDF name value
  • planItem Action
AffinityParentGroup Valid for Conditional type only. A boolean field containing the value true or false:
  • If set to true, the plan items with products sharing the same immediate parent product are grouped together
  • If set to false, the parent product is not considered for grouping
AffinityActionGroup Valid for Conditional type only. A boolean field containing the value true or false:
  • If set to true, then only plan items with products that share the same action are grouped together
  • If set to false, then action is not considered for grouping
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:
  • PROVIDE
  • UPDATE
  • CEASE
  • Empty String

If the XPATH expression evaluates to anything other than these actions, then AOPD fails and returns an exception.

  • If the field is blank, or the return value from the XPATH expression is an empty string, the remaining action rules must be applied.

The XPATH expression is able to evaluate against the following data fields on the order:

  • Order Header UDF Name and Value
  • Order Line Action and ActionMode
  • Order Line UDF Name and Value

The XPATH expression can also be defined against the following plan data fields:

  • planItem productID
  • planItem UDF name value
  • planItem Action
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

See TIBCO Fulfillment Catalog Product Catalog Guide for more details.

Important: 1) If XPath is defined against plan data, the format should be <Actual XPath> containing string $var/PlanItem. For example, if you want to define the XPath for UDF name-value pair MSISDN=123, the XPath can be $var/PlanItem[productID='GSMLine']/udfs[name='MSISDN']/value/text().

XPath evaluates data from the planItem. See Sample Plan Item XML for more details.

2) If XPath is defined against the order data, the format should be <Actual XPath> containing string $var/Order. Refer to Sample Order XML for more details.

3) Default order data is considered for evaluation if XPATH does not contain $var/PlanItem.

Note: See Sample XPATHs for XPATH definitions.