Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
preetpal_singh
Associate
Associate
0 Kudos
  This is in continuation of series Distribution modeling in Data Orchestration Engine (Distribution Modeling in Data Orchestration Engine - 1, Distribution Modeling in Data Orchestration Engine - 2, Distribution Modeling in Data Orchestration Engine - 3).

Distribution Rule

Distribution rule is a set of criteria fields based on which the data is actually distributed to the set of receivers. So by modeling a rule a developer can set the logic on which the data will be distributed to mobile devices according to the distribution requirement.

In case of distribution rule, the Set-B is filled with one or more criteria fields and an operator on them, is modeled.

There are different ways in which distribution logic can be defined.  The distribution rule can be of following types based on criteria fields mapping:

1. Constant Rule

2. Date Pattern

3. Device attribute mapping

4. Subgen Mapping

In case of constant rule set-B is filled with static criteria filed values which will be used as distribution criteria.

In case of Date pattern set-B is filled with date pattern values which will be used as distribution criteria

In case of Device attribute mapping set-B is mapped to device attributes which will be filled at runtime to be used as distribution criteria.

Here will take the example scenario for constant value based rule.

Let us take an example and see the same. In the example, the users are supposed to meet customer and address the customer's concerns. Each user gets an update on their device about the customer, based on the update user goes and meet the customer, update the customer status. Further for simplicity assume each device is having one and only one user, and similarly each user is assigned to one device only.

Let the following list represent the available users/receivers in the system:

 

Receiver

Location
RCVR-ALoc-A
RCVR-BLoc-B
RCVR-CLoc-C
RCVR-DLoc-D

 

All receivers are assigned the DM-SWCV where the rule is modeled.

Let the records of customer object are having following fields: Name, type, item ordered and quantity.

So suppose the set-A, as identified by CDS table entries look like:

 

Name

TypeItem OrderedLocation Quantity
CUSTOMER-AT2 ITEM-1Loc-A 50
CUSTOMER-BT3 ITEM-2Loc-B 65
CUSTOMER-CT4 ITEM-3Loc-C 45
CUSTOMER-DT2 ITEM-1Loc-D 50
CUSTOMER-ET3 ITEM-2Loc-D 65
CUSTOMER-FT4 ITEM-3Loc-D 70

 

 

Let us consider the business case in which the sales person needs to deliver the orders to the customer if the customer has ordered more than 60 items. So to meet this distribution criteria, we can model a rule with the criteria field "quantity > 60".

At the time of evaluation of such rule, the Cartesian product of CDS table entries (set A) is taken with receivers  (set C) with the condition "quantity >60" to finally form set D i.e. {I, D} pair.

If the option None' is chosen: Then system does not identify the receivers as participating in the rule. Rather now administrator needs to explicitly assign receiver to rule. Suppose in this case, administrator assigns only RCVR-B to rule. So the set-C will now look like:

 

Receiver

RCVR-B

 

 

The set- B will look like

 

Receiver

OperatorQuantity
RCVR-BGT60

 

 

In this case the set-S ({((CF, Op), R)} will turn out to be

{((Quantity, >), RCVR-B)}), which says the data from set A i.e. CDS table should be sent to RCVR-B where in it satisfies "Quantity > 60" resulting in set-D. So the final output i.e. set-D will come out:

So in this case, the set-D, final output will look like:

 

Instance

Receiver
CUSTOMER-BRCVR-B
CUSTOMER-ERCVR-B
CUSTOMER-FRCVR-B

 

This is calculated by taking the Cartesian product of set A and set S based on the condition "quantity > 60".

 In this case, the evaluation will take place

i- Whenever rule is activated or de-activated, or

ii- when administrator assign or un-assigns receiver from rule, or

iii- Whenever the DM-SWCV for the assigned receiver is changed.

If the option All' is chosen: as all the receivers are assigned the DM-SWCV, system will identify all of them for participation in the rule. The set-C will now look like:

 

Receiver

Location
RCVR-ALoc-A
RCVR-BLoc-B
RCVR-CLoc-C
RCVR-DLoc-D

 

So, in this case, the set-D will appear as follows:

 

Instance

Receiver
CUSTOMER-BRCVR-A
CUSTOMER-ERCVR-A
CUSTOMER-FRCVR-A
CUSTOMER-BRCVR-B
CUSTOMER-ERCVR-B
CUSTOMER-FRCVR-B
CUSTOMER-BRCVR-C
CUSTOMER-ERCVR-C
CUSTOMER-FRCVR-C
CUSTOMER-BRCVR-D
CUSTOMER-ERCVR-D
CUSTOMER-FRCVR-D

 

In this case, the evaluation will take place

i- Whenever rule is activated or de-activated, or

ii- Whenever the DM-SWCV for the assigned receiver is changed.

If the option "Receiver attribute" is chosen:

  • (a) Then modeler needs to identify the receiver's attribute and its value based on which to assign receivers to rule. Suppose the modeler has decided - Location = "LOC-D". In this case, system will identify only RCVR-D to be participating in the rule. So the Set-C will look like

 

Receiver

Location
RCVR-DLoc-D

 

And hence the final result in Set-D will look like:

 

Instance

Receiver
CUSTOMER-ERCVR-D
CUSTOMER-FRCVR-D

 

In this case, the evaluation will take place:

i- Whenever rule is activated or de-activated, or

ii- whenever the DM-SWCV for the assigned receiver is changed, or

iii- When the receiver's attribute is changed. In this example, whenever the Location attribute's value is changed.

(b) Instead of statically defined value of Location=LOC-D, one can use the subscription generation data object to fetch the value of attribute Location to be considered.

Supposing a subscription generation data object is used having following values for field used for describing receivers attribute ‘Location':

 

Location

LOC-B
LOC-E

 

 So in this case, system will identify only Receiver - Rcvr-B to be participating in the rule. The set-C will look like:

 

Receiver

RCVR-B
 

 And so the final result in the Set-D in this case will look like:

 

Instance

Receiver
CUSTOMER-BRCVR-B
CUSTOMER-ERCVR-B
CUSTOMER-FRCVR-B

 

In this case, the evaluation will take place whenever:

i- rule is activated or de-activated, or

ii- when administrator assign or un-assigns receiver from rule, or

iii- whenever the DM-SWCV for the assigned receiver is changed, or

iv- when the receiver's attribute is changed or

v- Whenever the attribute value gets changed in subscription generation data object.

In all the above cases, after the rule is activated in the portal, any insert or delete message for the data object will be evaluated for updating mapping information to relevant receivers.

Similarly, the user can create a distribution rule with different set of operators such that "<=", ">", ">=", "=", "! =", "between" and "CP (Contain Pattern)".

CP operator is used in a business scenario where the user needs to distribute the data of one specific pattern. For example, a user can define a distribution rule saying

Item CP ‘Item*'. In this case if the instance belongs to this pattern like Item-1, Item-2 etc will be distributed.

2 Comments