Skip to Content

Usage of Contains Pattern(CP) Operator in Distribution Rule

Product: DOE Netweaver Mobile 7.1 

I had to create a model in DOE to be used for testing some newly developed feature and I came up with the below model containing two Data Objects (DO’s) with Association and Dependency  between the leading and following DO.

1. ORDER with below fields, which is leading DO.

ORD_ID        : Order ID

CUST_ID       :  Customer ID

ORD_DESCR : Order Description

CUST_NAME: Customer name

2. CUSTOMER with below fields, which is the following DO.

CUST_ID          :  Customer ID

ADDRESS         : Customer Address

CONTACT_NO: Customer contact Number

Below is the screenshot of the backend table I used for the model.

Backend table of DO ORDER:

image

 

Backend table for DO CUSTOMER:

image

My requirement was  to distribute those orders, where the customer belongs to the SAP group. In this case SAP LABS, SAP INDIA and SAP GDC.  So I ended up using the “EQ” operator during distribution modelling to dustribute the data. To meet my requirement, I had to use the operator thrice as below.  

CUST_NAME  EQ  SAP LABS

CUST_NAME  EQ  SAP INIDA

CUST_NAME  EQ  SAP GDC

Then I got to know from my colleague Preet (Singh, Preetpal), that instead of using the “EQ” operator thrice, I can achive the necessary distribution of data by using “CP” operator once as below.

CUST_NAME  CP  SAP*.

On checking what this CP operator is, I got the below information.

What is Contains Pattern (CP) operator: If a user needs to distrubute data based on particular “pattern”, they can make use of the CP (Contains Pattern) operator with wild card characters “*” and “?” as criteria field values during the modeling of distribution rules.

Asterisks (*) is used to denote multiple characters. E.g., F1 CP *ABC: shall identify all instances with value for the field F1 containing the pattern ABC at the end.

Question mark (?) is used to denote single character. E.g., F2 CP AB?: shall identify all instances with value for the field F2 starting with AB followed by any character at the end. 

So I used the CP operator during distribution modeling instead of the EQ operator.

I created a distribution model and added a Rule.  The transaction Code for work bench is SDOE_WB.image

If any of you is in need of detailed explanation (with screenshots) on creation of rule, it can be found at the below link.

< Distribution Rules: Steps for Creation/Types of Rules>

I selected the CP operator using F4 help.

image

image

I clicked “Constant Values”. In the resulting pop up, entered  the pattern, based on which the distribution of data needs to happen. Saved it.I entered “SAP*” as the pattern, as I needed to distribute only those orders where the customer name started with SAP.

image

I verified the entered details and finished defining the rule.

image

After defining the rule using CP operator as above, I activated the Distribution Model in work bench, did a load from the backend and activated the Rule in the DOE monitoring portal. And I had the required distribution!!

Below I have given snippet of the distributed data from the outbound queue of the device for the used model. It can be noted that only Orders where customer name starts with SAP*, and their corresponding customer details have been distributed.

image

image

I also tried the usage of “?” with CP operator.

I changed the rule such that only those orders are distributed whose CUST_ID is “C” followed by single character. So for my model, orders 1,2,3,4 and 5 with their respective customer details need to be distributed.  

  image

Below is a snippet of the distributed data from the outbound queue of the device for the used model.

It can be seen that only order 1,2,3,4 and 5 are distributed. 

image

 

From Preeth, I also found that CP operator is valid for normal rule and dependency rule and not valid for filter rules. And that usage of CP operator is a performance hit and it’s advised to use other operators if the same job can be accomplished without using CP operator.

If any of you are in need of details related to Distribution Modeling in DOE, you can find it in other blogs, the links of which I have provided below.

Distribution Rules: Steps for Creation/Types of Rules – Distribution Rules: Steps for Creation/Types of Rules

Node Associations – In Data Objects and Dependency – Node Associations – In Data Objects and Dependency

Distribution Modeling in Data Orchestration Engine – 5 – Distribution Modeling in Data Orchestration Engine – 5

Performance aspect of Distribution Rule modeling in Data Orchestration Engine – Performance aspect of Distribution Rule modeling in Data Orchestration Engine

Distribution Modeling in Data Orchestration Engine – 4 – Distribution Modeling in Data Orchestration Engine – 4

Distribution Modeling in Data Orchestration Engine – 3 – Distribution Modeling in Data Orchestration Engine – 3

Distribution Modeling in Data Orchestration Engine – 2 – Distribution Modeling in Data Orchestration Engine – 2

Distribution Modeling in Data Orchestration Engine – 1 – Distribution Modeling in Data Orchestration Engine – 1 

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply