Skip to main content

Rule Harvesting (Rule-From-File wizard)

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 info
4. 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

Popular posts from this blog

Netbeans 6.0 - Code generation

The Java editor is capable of generating often used constructs for you automatically. Press Alt+Insert to invoke the code generation menu and pick what you want to generate To add import statements: Use error hints : Click on the error mark with the light bulb or press Alt+Enter . It will offer you a list of possible classes to import. Pick the proper hint and you are done Use the import class dialog : Put the caret into the name of an unimported class and press Alt+Shift+I . A list of possible classes to import will appear. Use the smart fix import : Press Ctrl+Shift+I . You will get a dialog that lists all unresolved identifiers in the source. If there is more than one option for resolving the identifier you may choose using the combo box. Classes shown in gray do not fit for some reason. Method exit points : Putting the caret on the return type of a method definition will highlight all places where the method can exit Exception throwing points : Putting the caret on an...

Artist got automated

Here is my first Tensorflow run to convert images to different styles of famous painters I am using the code that is available at  https://github.com/lengstrom/fast-style-transfer It uses specific versions of below libraries !apt install ffmpeg !pip install tensorflow==0.12.1 !pip install numpy==1.11.2 !pip install scipy==0.18.1 !pip install pillow==3.4.2 I started with latest version and that triggered failure after failure. If you are like me, add below changes to their respective files #This is to make tensorflow behave as if it is in v1 File : evaluate.py and ./src/transform.py import tensorflow.compat.v1 as tf tf.disable_v2_behavior() #Image functions are removed from scipy.misc module. so use imageio instead import imageio scipy.misc.imsave(out_path, img) --> imageio.imwrite(out_path, img) img = scipy.misc.imread(src, mode='RGB') --> img = imageio.imread(src, pilmode='RGB') Refer this post on more details on imageio changes Here is the ...

OnePlus 6T - Android 10 (OOS 10)

Its been more than 3 months since August security patch update. Out of curiosity I checked Oxygen Updater. To my surprise, Oxygen OS v 10 (based on Android 10) is available. Since this is a stable release, i went head and updated it. Its ended up being a buggy release. For those of you, who didnt get update over OTA, its better to wait for OOS 10.1. Here are the list of issue and the workarounds. Issue #1 :  Phone randomly restarts and then goes to boot loop Workaround : when the phone stuck in boot loop (with OnePlus logo animation), Press Power Button and Volume Down button to restart it Issue #2 : Google play wont work Work Around : Booting to recovery and clearing cache is expected to fix this. will update after testing To booting to recovery, Firstly, turn off your phone: press and hold the Power button for a while or press the Power key once and choose ‘power off’. Once the switch off process is completed start pressing and also holding down the Volume Dow...