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 must be respected must be set to "SequencedAffinity" in the affinity type
- All order lines where affinity components are known to exist must have a user-defined field defined as AffinitySequence and the value must 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 is copied to itemA
- itemB parent is updated with the plan item ID from itemA, thus making itemA dependent to its own parent and the itemB parent
- user-defined field values from itemB is merged into itemA
- Any item, which has a reference to itemB have that reference replaced with a reference to itemA
- The instance of itemB is 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 is 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 is merged into itemA
- user-defined field values from itemB is merged into itemA
- Any item, which has a dependency to itemB have that reference removed
- all the children from itemB is made dependent to itemB parent(s)
- itemB is deleted from the plan
The figure depicts an offering, which has items that are in parallel and in sequence that have 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: