Thursday, February 19, 2009

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







PRPC - Where Am I

Hi all,

From today onwards, every day i would like to discuss about some rule of PRPC.

Today i am discussion about the "Where am I" icon and its functionality .

WHERE AM I 
"Where Am I" Icon will be found on your Work list or on a Work Object. Its functionality is to display the Current processing flow with a Big Arrow mark on the currently processing assignment.

To use this functionality you need have Work.-Perform privilege

When you click on this icon, a window name "You are here" will be popped up. This window shows the current Flow Stack. The Flow Stack contains the list of flow rules in process for the current task only. Completed Flows and other executions operating on the current work object in parallel to the current execution (parallel in flows) will not included.

On the top of this window, the flow-sub flow relationship is maintained from Left To Right. By Clicking on them, you can navigate to corresponding Flow/Sub Flow.

The Flow at bottom left is the sub flow that contains an incomplete assignment.

Below it You can two buttons, Open Flow (which opens the flow) and Show all Steps (will show all assignment details on right panel).

On Left panel, you can have the image of currently selected Flow diagram in Microsoft Visio. On this diagram, you will find, "Tick Marks" on completed assignment and an "Arrow mark" on the currently processing assignment.

By clicking the Tick Marks, you can have the details of those Assignment on Right hand side of the window.

On Right panel, you can have the history of the current work object. Depending on the history options in flow rule, these details will vary.

If you want to Turn off golden arrow feature, override the Assign-.pyAssignmentStatus with an HTML Property or choose the Assignment Status as "Default"

Note
1. "You are here" window shows the stack of incomplete flow executions in progress that lead to a specific assignment or other incomplete task. It does not show the entire work object history, which may involve other flow executions now completed.

2. This "Where am I" functionality will be available to flows with "Draftmode" also.

3. While processing a Flow, if it creates a "Temporary Work Object", the this feature will not be available.

4. From 5.4 onwards, for a Work User, this functionality is not available in the status column of the report generated for the work list items assigned to the operator.

Hope you enjoy this content. Will come up with something else tomorrow..... Keep posting your comments