RULE HARVESTING
To day we are going to discuss about how to develope some rules out side the PRPC environment (in a Windows file).
This capability is generally referred as Rule Harvesting, which is implemented using Rule-From-File Wizard.
Rule that can be developed
Using this wizard you can develop
1. Flow Rules
2. Decision Table Rules
3. Decision Tree Rules
4. Map Value Rules
Starting the Wizard
Navigate through Application --> Import --> Rule From File...
Creating a Flow Rule (Rule-Obj-Flow type)
You can do this using 4 different types of files
1. Using MS Visio file (.VSD files)
2. Using XML file confirming to Harvest.PublicFlow XSD
3. Using XML file confirming to BPEL 1.1 Format
4. Using XML file produced in Proforma's Pro Vision CIF 1.0 Format
Using MS Visio
The only requirement that a Visio diagram to be successfully create a Flow is that it should have only closed shapes and arrows to represent a business process
Using XML Files confirming to Harvest.PublicFlow XSD
Before using this, you should know that when a Flow which is built in PRPC is stored, it XML representation closely resembles the XML Schema stored in the Standard Text File rule Harvest.PublicFlow.xml.
So if your External XML file confirms to its scheme, you can upload it.
Detailed Procedure
1. Search for the "PublicFlow" file. You can find one text file in Pega-Procom Ruleset. Save it to your local harddisk and change its extension to XSD
2. While chaning the extension, makesure you are actually changing the file extension rather than just renaming it. If you don't how to change the file extention see this Article. or simply "Saveas" it as a XSD file
3. Create an XML file and validate against the XSD. For this you can use
"Eclipse Web Tools" with Eclipse work Bench. For more info4. Now upload it in our wizard. while uploading make sure the format is "Public Flow"
Using XML file confirming to BPEL 1.1 Format
The following conversions will take place while importing an XML file
BPEL 1.1 element | Flow shape |
flow, sequence, and scope | New flow rule |
assign | Utility |
receive | AssignmentService |
flow, sequence, and scope | Call or branch to subflow |
invoke and reply | Integrator |
partnerlink, partner, CorrelationSet | N/A |
throw | Utility to set a ticket |
switch | Call or branch to subflow |
while | Call or branch to subflow |
XML files produced in Proforma's Pro Vision CIF 1.0 Format can be uploaded to create a Draft Flow.
Creating a Decision Table Rule ( Rule - Declare - DecisionTable rule Type)
Create an Excel (.xls) file similar to your Decision Table and Upload it to Create a DecisionTbale
Creating a Decision Table Rule ( Rule - Declare - DecisionTree rule Type)
Create a Text containing
1.zero or more tab characters to indent the text, reflecting the levels of the tree
2. Include the keywords EVALUATE
, IF
, CALL
, RETURN
, THEN
, CONTINUE
, OTHERWISE
, and RETURN
in uppercase. These have the same meaning as the corresponding elements in the rule
3. Your file may include expressions and property references, in the exact case
The formal syntax in approximate Backus-Naur form is:
[EVALUATE]
IF [NOT] THEN [CONTINUE | EVALUATE |
%CALL | CALL DECISIONTREE !RETURN
OTHERWISE [RETURN]
where % indicates a horizontal tab character. Line endings are significant. Extra spaces are ignored.
For example:
EVALUATE .BallorStrike
%IF ((.Height > 4) && .NoSwing && .BatterNotStruck)) THEN CONTINUE
% %IF (Height > 3) THEN RETURN "Ball"
% %IF (Height < 1) THEN RETURN "Ball"
OTHERWISE RETURN "Strike"
where % indicates a horizontal tab character
Creating a Map Value Rules ( Rule - Obj - MapValue Rule Type)
Create an Excel worksheet that contains the values to become the Matrix tab as constants. Leave cell A1 blank. In cells A2, A3, ..., enter text that is to become the column headers. In cells B1, C1, ..., enter text that is to become the row headers. Enter constants in a final row (with the first column blank) for the Default row, and similarly enter a rightmost Default column. (If the condition value is simply a number, then format the column cells as text, not numbers, and type "=" or" ==" before the number. For example, =1000.
After you upload this file, it becomes the Custom field onthe History tab of newly created Map Value rule
After finishing Upload, Click the Pencil icon to open the Map Value Rule.
Check out the rule and Then click Click the "Edit In Excel". (Make sure your Macro security is @ Low level to work it)
When initial Macro execution ends, Click Convert in the Upper Left corner. Close Excel.
Notes
1. This wizard creates a work object with the prefix pxAT-.
2. If your RuleSet list includes the optional Pega-AppDefinition RuleSet, you can find open and resolved work objects with the Developer portal menu option Open > Wizards in Progress > All Wizards
All the rules creating through this will have availability as No/Blocked. So you can't test them. To utilize them make their availability as YES.
Hope you enjoy this.
keep commenting.....
Comments