Skip to Content
  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-A Loc-A
RCVR-B Loc-B
RCVR-C Loc-C
RCVR-D Loc-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

Type Item Ordered Location  Quantity
CUSTOMER-A T2  ITEM-1 Loc-A  50
CUSTOMER-B T3  ITEM-2 Loc-B  65
CUSTOMER-C T4  ITEM-3 Loc-C  45
CUSTOMER-D T2  ITEM-1 Loc-D  50
CUSTOMER-E T3  ITEM-2 Loc-D  65
CUSTOMER-F T4  ITEM-3 Loc-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

Operator Quantity
RCVR-B GT 60

 

 

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-B RCVR-B
CUSTOMER-E RCVR-B
CUSTOMER-F RCVR-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-A Loc-A
RCVR-B Loc-B
RCVR-C Loc-C
RCVR-D Loc-D

 

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

 

Instance

Receiver
CUSTOMER-B RCVR-A
CUSTOMER-E RCVR-A
CUSTOMER-F RCVR-A
CUSTOMER-B RCVR-B
CUSTOMER-E RCVR-B
CUSTOMER-F RCVR-B
CUSTOMER-B RCVR-C
CUSTOMER-E RCVR-C
CUSTOMER-F RCVR-C
CUSTOMER-B RCVR-D
CUSTOMER-E RCVR-D
CUSTOMER-F RCVR-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-D Loc-D

 

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

 

Instance

Receiver
CUSTOMER-E RCVR-D
CUSTOMER-F RCVR-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-B RCVR-B
CUSTOMER-E RCVR-B
CUSTOMER-F RCVR-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.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Bernhard Knoblauch
    Thanks for the Blogs!
    I like to read them.
    However I have some doubts, which I want to share with you.

    1. For the Set-A you mention the following attributes in the text:
    Name, type, item ordered and quantity
    In the table you display additionally a column Location, which might correspond to a device attribute, but I don’t see that this connection is specified for a “Constant Rule”.

    2.a. If for Option “None” Administrator assigns RCVR-A *and* B, why does Set-C only contain RCVR-B?

    2.b. Still Option “None”: IIRC Set-B is defined as {(CF, Op)}, where CF is the Criteria Field(s) and Op is the Operator (GT in this case)
    So I would have asumed Set-B is: {Quantity, GT, 60}. What do I miss?

    3. For option “Receiver attribute” I am not sure if I understand you correctly.
    From the description I conclude that Set-C will be affected by modeller’s decision “Location = LOC-D”, but I do not see why Set-A should be affected. Still we talk about a “Constant Rule” with option “Receiver Attibute”, right? Thus I would expect Set-D to be {(Customer-B, RCVR-D), (Customer-E, RCVR-D), (Customer-F, RCVR-D)}. What do I miss here?

    Best regards,
    Bernhard Knoblauch

    (0) 
    1. Preetpal Singh Post author
      Hi Bernhard,

      Thanks for reading and giving feedback for the blog. I could not reply you earlier as I was on vacation. As per oyur queries I am answering them one by one:
      1. Yes, Location is required for the device attribute mapping. i did’nt mention it explicitly as It is already mentioned in Distribution Modeling in Data Orchestration Engine – 2 blog.

      2. It is a typo mistake I will correct it. The administrator assigns only RCVR-B in this case.

      2.b: Actually I purposefully put in the tabular form as exactly it looks like in distribution table ie
      Receiver    Operator     Quantity
      RCVR-B       GT           60

      3. In this case the reciever that will be identified is RCVR-B because the subgen sends LOC-B and LOC-E. There is no receiver for LOC-E so only RCVR-B will be identified and based on the rule the set D will look like

      Set-D to be {(Customer-B, RCVR-B), (Customer-E, RCVR-B), (Customer-F, RCVR-B)}.

      Please feel free to get back to me in case of any other clarification.

      Kind Regards,
      Preet

      (0) 

Leave a Reply