Shared Attributes

This section describes about the Shared Attributes and its samples test scenarios.

Shared Attributes are used when two Products (parent to child and sibling) share the same attribute and its corresponding value and an update in the value of one needs to be reflected in the other. If an attribute is deemed as a shared attribute and when the value was passed on the order then during decomposition value is copied to the other products based on the EvaluationPriority set on the other products.

EvaluationPriority

Multiple products can have the same shared attribute. Hence, if value for a shared attribute needs to be merged with same shared attribute in other products, user needs to define the EvaluationPriority, which indicates the priority of merging the specified characteristic from the target Product.

During plan development process, Automated Order Plan Development checks if characteristic (i.e. attribute) is of type 'Shared'; if yes then it checks the EvaluationPriority for the characteristic. If products mentioned on the EvaluationPriority have the same shared attribute, then the value for the characteristic is taken from the product. If none of the products mentioned on the EvaluationPriority have the same shared attribute OR EvaluationPriority is not defined, then the value is taken from order line (if passed in order line) or product model.

Second part of the Shared attribute definition mentions that update in the value of shared attribute in one product needs to be reflected in other products having same shared attribute.

During execution, the process component might have to update the attribute (user-defined field) values. To update the value of a user-defined field, the process component calls setPlanItem on Transient Data Store mentioning the User Defined Fields to be updated. Process component sends the following details for the user-defined field:

  1. name - name of the user-defined field to update
  2. value - updated value
  3. flavor - 'output' (this indicates that process component has updated the value from set/get methods), Input (this indicates that process component has updated the value from order line), Config (this indicates that process component has updated the value from Product model)
  4. type - Shared (if user-defined field is of type Shared)

On the subsequent calls to getPlanItems on Transient Data Store (process component might make this call to get details such as User Defined Fields for plan items from Transient Data Store), Transient Data Store checks if requested plan items have any user-defined field (i.e. attributes) with type as 'Shared'. If Shared User Defined Fields are present then Transient Data Store checks the EvaluationPriority for that user-defined field.

For the products mentioned on the EvaluationPriority, for each product (in the order of priority) Transient Data Store checks if it contains the user-defined field with same name and flavor = output. If Transient Data Store finds such user-defined field then value from this user-defined field is returned. If EvaluationPriority is not defined OR products mentioned on the EvaluationPriority do not contain the user-defined field with same name and "output" flavor then value from order line/product model is returned (i.e. merging is not done).

Below are the sample of EvaluationPriority:
  • For single product, product ID is followed by priority with colon in between them.
    <productId>:<priority>
    
    Example:
    <ns0:evaluationPriority>SIM_TECNICO_BP1:1</ns0:evaluationPriority>
  • For multiple products, sets of product-priority are separated by comma.
    <productId>:<priority>,<productId>:<priority>
    Example:
    <ns0:evaluationPriority>SIM_TECNICO_BP1:1,SIM_TECNICO_BP2:2</ns0:evaluationPriority>