Friday, 12 July 2013

Data Transform Rule

Data Transform(DT) rules are introduced in PRPC version 6.2, Earlier to 6.2 version, they are refered as models.

DT rules are used to copy/convert the data from source of one format/class into target of format/class structure.These rules allows the user to easily copy, map and transform the clipboard data (pages and properties on those pages). 

The same can be achieved by using activities, but by using the data transform rules one can imporve run time performance.

With the help of DT rules the user can eliminate the use of activities for mapping or transforming the clipboard data.

Where the Data transform rules are referenced.
1. In activity step methods like Page-New, Page-Copy, Page-Change-Class, Apply-
DataTransform.
2. In start flow rules, that create work items, Data transform can be applied on the flow rule's process tab, which can be used to set the initial properties of the work item.
3. In action tab of Flow Action  rule, data transform can be applied before or after displaying the flow action UI to the user.
4. Data transform can also be applied to the connector propeties of the flow rules that are edited through Process Modeler.
5. They can also applied in the property rule in case of auto populate property.
6. They can also be applied in the data page rule form to map/ convert the data from one format to the other format.


Some examples of situations in which to use a data transform rule are:
·        Copying a clipboard page to make a new page.
·        Mapping properties (and their values) on one page to another, existing page.
·        Mapping properties (and their values) on one page to a new page.
·        On a given clipboard page, defining one or more initial properties on that page and setting their values. A data transform can set many property values on a page in one processing step.
·        Appending pages from one Page List property to another.















How to refer a parameterized data page in Data transform rule?
D_testParamDT with parameters paramA and paramB.

Set Action
1.  .pyLabel = D_testParamDT[paramA:"abc", paramB: "def"].pyLabel.

The inline syntax for passing parameters is [key:value,key1:value1.........]
key and value is delimeted by : (colon) and number of parameter is delimeted by , (comma)

The value can be a string literal or a variable reference.

Invoking an activity from a Data transform rule:

In case if there is a need to invoke an activity the following RUF can be invoked.
@pxExecuteAnActivity(Primary,activityToBeInvoked)


Invoking a decision table from Data transform rule: 

@DecisionTable.ObtainValue(tools,myStepPage,"DecisionTableRule", true)


Source reference to this post: pdn.pega.com

Post / comment if you have any questions regarding data transform rule, I may help you.

1 comment:

  1. Can you show how to create a data transform for the following scenario:
    I am having a data class for Employee Details with properties Emp ID(Key), First Name,Last Name,Department. In that Data type i have added some records . Now while run time i need to set properties of work class .

    ReplyDelete