Affinity Sequencing
Affinity Sequencing is used to support the scenario for maintaining sequencing during affinity grouping. Affinity Sequencing was introduced during affinity RulesEngine (BusinessEvents) selects plan items at random which are then merged into a single plan item. Since items are selected at random during this process, sequencing is not maintained for plan items that must be in a sequence.
To make products available for affinity sequencing:
- Affinity TYPE value for all products where sequence should be respected should be set to "SequencedAffinity" in the affinity type
- All order lines where affinity components are known to exist should have a UDF defined as AffinitySequence and the value should be an integer
Depending on the AffinitySequence values being compared, the following actions are possible:
- itemA.AffinitySequence = itemB.AffinitySequnce
- If both items have dependent children the children from itemB will be copied to itemA
- itemB parent will be updated with the plan item ID from itemA, thus making itemA dependent to its own parent and the itemB parent
- UDF values from itemB will be merged into itemA
- Any item which has a reference to itemB will have that reference replaced with a reference to itemA
- The instance of itemB will be deleted from the plan
The figure depicts the scenario where the items to be affinity grouped are running in parallel. One of the items in this case itemB will be deleted from the plan. The dependent items to itemB which are childB1 and childB2 are made dependent to itemA. Then itemA is made dependent to parentB which is the parent to itemB.
- itemA.AffinitySequence < itemB.AffinitySequnce
- itemB will be merged into itemA
- UDF values from itemB will be merged into itemA
- Any item which has a dependency to itemB will have that reference removed
- all the children from itemB will be made dependant to itemB parent(s)
- itemB will be deleted from the plan
The figure depicts an offering which has items that are in parallel as well as in sequence that need to be affinity grouped. For items that are in parallel they are handled similar to the figure 1. For the item that is in sequence itemC. It is dependent item offerB is made dependent to CommercialA which is the parent to itemC.
-
itemA.AffinitySequence > itemB.AffinitySequnce
For all the above actions the following occurs in all of them: