+ All Categories
Home > Technology > Pega Training ( whats app : +919908107432)

Pega Training ( whats app : +919908107432)

Date post: 07-Jan-2017
Category:
Upload: ashock-roy
View: 4,923 times
Download: 9 times
Share this document with a friend
167
1 BPM (Business Processes Management) BPM is a Management Philosophy. It focuses on Business Processes and Sub-Processes of an Industry with the behavior of Systems and Individuals within it. It models the processes and sub- processes visually and uses advanced Information Technologies to solve the business problems. It strives for better performance, easy to change and quality software. Built for Change Time to Market BPM is about people and the way they work together (their business process) and their performance objectives. Benefits of BPM Best suited for Workflows kind of software. Increase ROI. Robust and Quality Software Agility and Facilitates quick change Highly Iterative Speed To Market End To End Process and Performance Monitoring. Important Blocks in BPM (Pega) BRE, BAM, Integration Engine, Interfaces for Development and Maintenance. 1) Difference between Pega BPM Suite and other BPM Suites is Business Rules Engine and Business Activity Monitoring (BAM) 2) Many Process Commander applications provide business process management and automation through six functional capabilities, informally known as the Six R's: Receiving Accepting and capturing the essential data describing work from multiple sources in multiple media and formats, from keyboards, scanners, and external systems. Routing — using characteristics of the work and knowledge about the workforce to make intelligent matches and assignments. Reporting providing real-time visibility of work in progress, work completed productivity, bottlenecks, and quality. Responding Communicating status, requests for information, and progress to the work originator and to other people involved in the work, by email, fax, written mail, and other means. Researching Accessing external systems and databases through connectors to support analysis and decision making. Resolving — through automated processing and automated support of users, completing the work and updating downstream systems promptly.
Transcript
  • 1

    BPM (Business Processes Management) BPM is a Management Philosophy. It focuses on Business Processes and Sub-Processes of an

    Industry with the behavior of Systems and Individuals within it. It models the processes and sub-processes visually and uses advanced Information Technologies to solve the business problems. It strives for better performance, easy to change and quality software.

    Built for Change Time to Market

    BPM is about people and the way they work together (their business process) and their performance objectives.

    Benefits of BPM

    Best suited for Workflows kind of software. Increase ROI. Robust and Quality Software Agility and Facilitates quick change Highly Iterative Speed To Market End To End Process and Performance Monitoring.

    Important Blocks in BPM (Pega)

    BRE, BAM, Integration Engine, Interfaces for Development and Maintenance.

    1) Difference between Pega BPM Suite and other BPM Suites is Business Rules Engine and Business Activity Monitoring (BAM)

    2) Many Process Commander applications provide business process management and automation through six functional capabilities, informally known as the Six R's:

    Receiving Accepting and capturing the essential data describing work from multiple sources in multiple media and formats, from keyboards, scanners, and external systems.

    Routing using characteristics of the work and knowledge about the workforce to make intelligent matches and assignments.

    Reporting providing real-time visibility of work in progress, work completed productivity, bottlenecks, and quality.

    Responding Communicating status, requests for information, and progress to the work originator and to other people involved in the work, by email, fax, written mail, and other means.

    Researching Accessing external systems and databases through connectors to support analysis and decision making.

    Resolving through automated processing and automated support of users, completing the work and updating downstream systems promptly.

  • 2

    Business Rules

    Business rules whether stated implicitly or explicitly contains all your organization business knowledge. A collection of your organization business policies, constraints, Computations, reasoning capabilities etc.

    Business Rules Engine

    A business rules engine is a software component that allows business rules to be recorded in a non-procedural, non-programming form, and uses advanced software techniques to compute the consequences and results of rules.

    The PegaRULES component of PegaRULES Process Commander provides a powerful rules engine supporting business process management, and other applications through services.

    Developed in Java, highly scalable and reliable, PegaRULES supports declarative rules, multithreaded execution and a large number of industry interfacing and standards.

    The business rules engine can be embedded or called from another system using Service JSR94 rules.

    PegaRULES database

    The rules, transactions, and other data supporting a Process Commander system are stored in one or more Oracle, IBM DB2 or Microsoft SQL Server databases. (Consult the Platform Support Guide for an exact current list of supported vendors and products.)

    The database that contains the rules all the instances of concrete classes derived from the Rule- base class is known as the PegaRULES database. This database is also sometimes identified as the rulebase, but it contains more than rules.

    Classes that are mapped to the PegaRULES database are known as internal classes. Concrete classes that correspond to rows of an external database are known as external classes.

    Application Lists Rule-Sets and Access Group lists Application. We can have more than one Access Group for a particular Operator ID. These Access Group can have different Applications/WorkPools with them. Therefore with one Operator, we can switch workpools as well as Applications.

    RULESET: A RuleSet name is an instance of the Rule-RuleSet-Name rule type. Each RuleSet defines a

    major subset of rules in the PegaRULES database, because every instance of every rule type references or "belongs to" a RuleSet. A RuleSet name is a major aspect in:

  • 3

    Access control

    Grouping interrelated rules

    Managing the rules

    Rule resolution and versioning

    Moving applications sets of rules from one Process Commander system to another.

    On rule forms, the RuleSet name appears at the upper right.

    The term RuleSet sometimes refers to the name instance and sometimes informally refers to the contents of that RuleSet all the instances of Rule- classes associated with that RuleSet.

    The Rule-.pyRuleSet property, present in every rule instance, records the RuleSet name to which the instance belongs.

    Process Commander itself consists of several standard RuleSets

    RuleSet Name rules are part of the SysAdmin category. A RuleSet rule is an instance of the Rule-RuleSet-Name class.

    Creating Rule-Set, Organization and Division.

    - Go to PegaSample -> New -> Organization -> Organization. Give name and save

    - PegaSample -> New -> Organization -> Division, Organizational unit. Give name and save

    - Rule-set : - PegaSample -> New -> SysAdmin -> RuleSet. Give name, version and save. We can give pre-requisite ruleset there (PegaProcom)

    Creating Application, Access group, OperatorID.

    Application: PegaSample -> Application Design -> Application. Give first version as 01.01.01

    Built-in application = PEGARules. Application RuleSets = :01-01 (major and minor version)

    Access group: PegaSample -> New -> Security -> Access Group. Access group name = : Developer or : manager

    Define roles, Default portal layout, work pool (default workpool is PegaSample)

    (PegaRULES: SysArch4 in roles for developer)

    Operator ID: PegaSample -> New -> Organization -> Operator ID. Operator ID can be [email protected]

    Provide the access group to it. Also under tab Work settings, change the Organizational unit.

    Under advanced tab, you can change password.

    mailto:[email protected]

  • 4

    Base classes.

    Organization -> Data-

    Division -> Data-

    Unit -> Data-

    Ruleset -> (Rule-)

    Advantage of ruleset

    1. Access control

    2. Migration

    3. Rule resolution

    4. rule version

    Ruleset is derived from Pega Procom derived from PegaRules

    Access Group - Data-Admin-Operator-AccessGroup

    Operator Id - Data-Admin-OperatorID

    Pattern Inheritance

    Process Commander provides two kinds of class inheritance, known as directed inheritance and pattern inheritance. During rule resolution, pattern inheritance causes a class to inherit rules first from classes that match a prefix of the class name.

    About Classes

    - Instances of concrete classes derived from the Assign- base class and the Work- base class

    - When any object is held in memory, it has an XML (extensible Markup Language) format visible on your clipboard as pages and property name-value pairs. When stored into the PegaRULES database, the persistent object instance becomes a row in a SQL-based relational database table.

    - Always the class group has direct inheritance with work- class - Class group and work classes (class type) are always concrete. - Class type or work class had direct inheritance with work-object- - The Class group becomes the workpool (in Access group) - Every class has to be with direct inheritance with some class. Pattern inheritance is optional. If

    a class is not given a direct inheritance, then it will have the direct inheritance with the pattern inheritance class.

    Access Group --- has Application name in it.

    Application Name -> RuleSet in it.

    Operator ID - has access groups and Organizational unit in them.

    http://localhost:8080/prhelp/definitions/a/assignbaseclass.htmhttp://localhost:8080/prhelp/definitions/w/workbaseclass.htmhttp://localhost:8080/prhelp/definitions/c/clipboard.htm

  • 5

    Each sub-class of class group is associated with its parent class via a key, which is stored in property inside the classes.

    The primary key for the work object is defined in class group (work-pool). Eg: pyID

    Class Group:

    This is the first concrete class in the class structure. It supports the creation of work objects. The work classes are concrete classes inherit from it. It normally groups the classes to be stored in a single Database table, with a unique ID which is normally pyID. It also serves as the role of workpool.

    Creating Class

    PegaSample -> New -> SysAdmin -> Class. Give the class name. Rule-set and save. Give info in History.

    Version, rule-set etc. save it.

    - If Class is class group, select it and give its parent class as Work-

    - If Class is class type, select it and give its parent class as Work-Object-

    Now, select the workpool in access group as the class group

    Mapping pc_work table with class group (Work pool)

    The class group created is default mapped with pr_other table in database (where PegaRules are present).

    We manually map the class group with pc_work table.

    e.g : More-retail-purchase-work (class group) -> new -> sysAdmin -> Database Table.

    Give class name as: More-Retail-Purchase-Work and save.

    In the form:

  • 6

    Defining work pool in Access Group Define the work pool in Access group -> the class group

    Creating Data classes: Data- (Direct inheritance with @baseclass)

    More-Data- (Pattern inheritance with More- class)

    More-Data-Items (Concrete class and doesnt belong to class group)

    Click right on More- -> new -> sysAdmin classes.

    First create abstract class More-Data-, give parent class as Data-

    Save it.

    Then create class More-Data-Items

    Similar as above. See the below pic.

  • 7

    Creating Properties: For common properties, like here in more departmental store, we have customer name, contact and email-id as common for all departments and hence we will create these properties at More- Right click more-> new -> Data model -> Property.

    Then save it

  • 8

    Example of CITI Bank Cards dispute dept

    Parent Classes for different classes Organization --- Data-Admin-Organization

    Division --- Data-Admin-OrgDivision

    Organizational Unit --- Data-Admin-OrgUnit

    AccessGroup --- Data-Admin-Operator-AccessGroup

    OperatorID --- Data-Admin-Operator-ID

    Class Group --- Data-Admin-DB-ClassGroup

    Database table --- Data-Admin-DB-Table

    RuleSet --- Rule-Ruleset-Name

    @baseclass

    CITI- (Org)

    CITI - Finance- (Divisn)

    CITI - Finance-Cards - (Unit)

    CITI - Finance Cards-Work (Class group)

    CITI - Finance- Cards Work-CardDispute (Class type)

    Work-Object-

    Work- DATA-

    CITI- DATA-

    CITI-DATA- Items

    Properties

    - TransactionID

    Properties

    - Name

    - AcNo

  • 9

    Application --- Rule-Application

    Class --- Rule-Obj-Class

    Harness --- Rule-HTML-Harness

    Section --- Rule-HTML-Section

    Flow --- Rule-Obj-Flow

    Property --- Rule-Obj-Property

    When --- Rule-Obj-When

    Map --- Rule-Obj-MapValue

    Decision Tree --- Rule-Declare-Decision Tree

    Decision Table --- Rule-Declare-Decision Table

    Work- pyStatusWork -> Property To Track Work Object Status.

    New -> The Activity that creates a new Work Object.

    NewDefaults/NewInternalDefaults -> The Placeholder Activities that is called when a new work object is created.

    They are blank activities.

    Default -> Default SLA in WorkObject. It defines 2 days and 5 days as goal and deadline time. No escalation Activity.

    pyDefault -> Models

    .pyWorkParty : the property in W.O that stores the WorkParty for the W.O. It.s a page group type.

    Show-Harness: Activity that shows harness for display w.o forms.

    .pyRuleSet: Property inside each rule describing which rule-set it belongs.

    .pySLAName: Property to define a W.O SLA. Set through model

    GenerateID: Activity that generates work id prefix for W.O

    Concrete Classes mapped with pegaRules database are internal classes.

    Concrete Classes mapped with external database are external classes.

    A decision table/tree can be referenced in flows/activities/declare expressions. In declare expressions we can call D.trees/D.table/Map.

    A worklist appears in My Work in Progress Area.

  • 10

    Inheritance in Pega Class Inheritance.

    Ruleset inheritance

    RuleSet Version Inheritance.

    Creating Flow, Harness etc.

    1) Flow Select class explorer. From it select Work-. Click on Work-, then select Flow sample.

    Click save as with Applies to as : . And Flow Type:

    2) Harness Select class explorer. From it select Work-. Click on Work-, and then select Harness. Click New (in the grid)

    Click as save as ->

    Applies to ->

  • 11

    3) Section Two sections will be made.

    1) The common customer info. This will come under a section which will be made under workpool.

    Right-Click on work-pool -> new User Interface Section.

    The fields from More- Should be dragged and dropped in the lebels.

    2) Now for repeating data. We need to create a pageList (Which holds the other property) in Class type.

    Right Click on work type -> new -> User interface -> property.

    Give property name in the form.

    Before saving.

    Property mode Page list

    Page class The name of class from where it will take the properties. Here we have More-Data-Items

  • 12

    Now create a section to hold multiple data.

    In the class type -> new user interface -> Section.

    Click on Layout and drag it to the page.

    Select repeating.

    Add columns as required. Change the property of the grid.

    Change:

  • 13

    Format Standard

    List/Group Itll be same as the PageList we created. i.e Items

    Then as usual, drag and drop the properties in the columns.

    4) Adding Sections in Harness Open the harness by clicking it.

    Now click on the symbol and select new container.

    A new container will be selected inside harness.

    Now drag and drop your section in the container.

  • 14

    5) Adding Harness in Flow:

    Click on the flow (here purchase Flow).

    Click on process tab.

    Under this change:

    Create new work object: tick it.

    Harness : New (The name of harness)

    Now run from the above symbol.

    6) Creating drop down for set of values. Select to create a new property. Under this modify the following.

    HTML Property = PromptSelect

    Table type = Local List

    Put values inside the table type.

  • 15

    7) Creating decision table. We create a decision table on ItemName present in pageList Items under More-Data-.

    Right click on Items -> new -> Decision -> Decision table.

    Then provide the details.

  • 16

    Click under Conditions and ->

    7.1) Creating PromptList

  • 17

    8) Creating expressions

    9) Creating Calculated Value:

    10) Steps to be followed for calculated value.

    1) Harness: Tick Enable Expression Calculation

  • 18

    2) Create HTML Properties as Calculated value.

    3) Section: in the properties of each of the calculated columns. Do -> Display as: Calculated Value.

    Creating Flow Action, Flow, Sub-Flow, Decision Tree and Assignment Properties

    1) Creating Flow Action Here there are 3 sections. CustomerInfo, PurchaseInfo and Confirmation. Confirmation is same as

    PurchaseInfo but read only. We use button to disable it from adding/deleting a new row dynamically.

    Hence for 3 sections, we create 3 flow actions.

    1) Create a new Flow action -> CutomerInfo. Drag and drop the section customerInfo there. Under HTML Tab, enable Expression calculation

  • 19

    2) Similarly create flow action for PurchaseInfo and Confirmation.

    2) Creating Flow and Sub-Flow For creating sub-flow, select Flow from the drag and drop in the main flow.

    Select the diagram and in the properties box, give name and flow rule. (Flow rule will b the name of sub-flow)

    Note here Flow rule = CollectInfo. Now press the edit button next to it.

    It will open the new sub-flow dialog. Provide the details in the dialog.

    Note: Give Template Name as: ScreenFlowStandardTabbed.

    Now edit the sub-flow

    We have created the sub-flow as below.

  • 20

    Select each of Assignment diagrams like Customer Info, Purchase Info and Confirmation and edit the properties.

    E.g The Customer Info. See diagram in next page.

    Give the name and Flow Name = Flow action created before.

    Do similar to all cases.

    Save it.

    Now in the main flow the control will go to manager for approval.

    We have created a rule here that,

    if Grand Total >= 10000 then approval will go to manager else operator.

    Note: we have 2 operator IDs here. [email protected] and [email protected]

    So we need to create a Decision tree for that.

    mailto:[email protected]:[email protected]

  • 21

    3) Creating Decision tree Click on class group -> new decision -> decision tree.

    Give the expression like below.

    4) Creating Routing

    Here we are introducing a routing assignment (named as Manager). The routing is based on DecisionTree that we have created above. So select the routing assignment -> Manager and edit the parameters as in screen-shot.

    Router -> ToDecisionTree

    Now click on the play symbol and edit other fields.

    DecisionTree -> Name of Decision tree (Routing here)

    INPUT -> It tells on which property Decision will be taken. Here its .GrandTotal

    Service -> Blank

    Now we provide two utility in the flow -> Approved and Rejected. Select each utility and edit the properties.

    Rule -> UpdatedStatus

    Staus -> Resolved-Completed

  • 22

    Application -> Application name

    Similarly for Rejected, do the same and in status give -> Resolved-Rejected

    Now select the connector from manager assignment to utility and edit the properties.

    Application name,

    Flow -> Here out-of box flow will be given. Like Approve and reject respectively.

    WorkType -> name of workType (Class type)

    Likelihood -> anything between 0-100

    Apply and save.

    In the Application -> Details tab. Edit

    Work Types .

  • 23

    Name as Purchase,

    Implementation class as worktype

    Work ID Prefix as p-

    9.5) Creating User who can create work object Create a new access group for user. Role : PegaRULE:User1 and

    Default portal : User.

    Similarly create a operator ID for user.

    10) Creating ONCLICK event. Here we have a check-box -> isShipping Details. If we click on check-box, a new section will come to collect the address.

    While in draft open the properties of check-box isShippingDetails. And edit

    Display as -> CheckBox

    Behaviour -> ONCLICK. Click its properties. A new window will open

  • 24

    Then edit.

    Active Input -> check

    Event -> On Click

    Action -> Refresh this section.

    The complete Shipping Details section appears on mouse click on is shipping details. Hence select the whole section/container of Shipping Details .

    Edit the properties as

    Format = Standard.

    Visible when -> .isShippingDone==true

  • 25

    11) Main Flow

    Sub flow:

    Overriding Default rule -> Approve In the main flow, in the Approve, 60% connector, we have mentioned an Action flow =

    Approve, which is out of box rule in Pega. So this rule provides a basic UI for approval by manager. We can override it to add few information like

  • 26

    The list of things purchased (here we have a section called confirmation for that).

    Hence Click on Work- and select flow action.

    Select Approve rule and do a Save as. Give the details like Applies to -> Workpool/worktype name.

    And save it. We can drag and drop the section -> confirmation under it.

    So in manager portal, while approving the workobject, this additional info will be shown.

    12) SCREEN-SHOT of Sample Application More.

    Screen-1

    Screen -2

  • 27

    Screen -3

    Screen -4

    WORK OBJECT:

    A work object is the primary unit of work completion in an application, and the primary collection of data that a flow operates on. As an application is used, work objects are created, updated, and eventually closed (resolved).

    Every work object has a unique ID (property pyID), an urgency value, and a status (property

    pyStatusWork).

    In some organizations, a work object is known by the older term work item. RuleSet RuleSet is the major sub-set of rules in PegaRules Database. It is the instance of Rule-RuleSet-Name.

    It has a name and can have multiple versions associated with it. The purpose of RuleSet is mainly for.

    - Rule Resolution - Rules Versioning - Migration - Access Control

  • 28

    Operator Id:

    Its a combination of username/password, a access group associated with it and its a part of an organization/div/unit. It mainly used for authentication purpose for a requestor. There is a role and portal associated with the Operator ID trough the access group. Instance of Rule Data-Admin-Operator-ID Access Group:

    Instance of Data-Admin-Operator-AccessGroup. This is mainly to control access. It makes a set of RuleSet Versions available to requestors. The Operators in PRPC are associated with an access group. It affects the accessibility of users in following way.

    - Contains the work pool.

    - Contains the Application, indirectly the RuleSets available to users.

    - Defines the role of the particular user

    - Defines the portal for the user

    Work group A work group defines a supervisor (manager), with set of workers and workbasket that report to him. Class A class is instance of Rule-Obj-Class. It defines capabilities such as other rules (UI Forms, properties,

    decisions, declarations, flows etc).

    Abstract Class They end with a -. The dont have any instances or are not stored in DB. They cannot create a W.O.

    - The out of box rules present in Work- wont be available to them. - They dont belong to workpool. Hence cannot run the flow.

    Internal Classes The concrete classes whose instances are stored in PegaRules Data base are Internal classes. External classes The concrete classes whose instances are stored in External Databases are external classes. Basic Activities in Flow (OutOfBox and Interactive)

    1) Assignments Activities

    Work-.WorkList Causes the assignment to be placed on the worklist of the current operator

    (or of another operator identified by a Router shape). Creates an instance of the Assign-

    Worklist class.

  • 29

    Work-.WorkBasket Causes the assignment to be placed in a workbasket, determined by an associated Router shape. Creates an instance of the Assign-Workbasket class.

    Work-.External Starts the directed Web access feature, sending a temporary assignment by e-mail to a party identified in the work object who is not an interactive Process Commander user. Creates an instance of the Assign-External class.

    Work-.Agent Sends the assignment to a background process rather than to a person (rarely used, similar to WorkBasket ).

    2) Router Activities

    3) NOTIFY Activities

    4) Utility Activity

    CorrNew or CorrCreate UpdateStatus (Itll ask the parameter Status Work). ConvertAttachmentToPDF.

    5) Connector Flow Action

    cancelAssignment Notify sendCorrespondence resolve reject ConvertAttachmentToPDF.

    http://localhost:8888/prhelp/definitions/d/directedwebaccess.htm

  • 30

    6) Local Flow Action

    addAttachment addFlow addCovered addToCover addParty AttachAfile/URL/Note

    7) SLA Standard Escalation Activity

    AdvanceFlow Default NotifyAssignee NotifyManager TransferToManager NotifyAndTransferToManager TransferToWorkBasket

    ScreenFlow have standard Harnessess like Work-.PerformScreenFlow, Work-.TabbedScreenFlow etc.

    - Operators Work Settings Tab.

    Collections Create a collection rule to identify other rules in your application that can execute in sequence, under a set of conditions evaluated for each rule in the sequence. You can include both procedural rules and Declare Expression rules in the sequence. By referencing a list view rule, you can retrieve at runtime a dynamic list of qualifying rules to be executed. Typically, all rules in the collection update a common page.

    Where referenced

    Collection rules are referenced by the Collect instruction in an activity. In addition, one collection rule can reference another collection rule.

  • 31

    Collection Tab

    PreCondition Type: Decision Tree/Table, Map, When, None.

    This Collection rule is called in Activity method: Collect

    Rule Delegation

    A delegated rule is one that appears for a specific group of users so that they may manage these rules outside the development environment. Delegated rules appear on the My Rules gadget for a single user or for all the users who are associated with a specific access group.

    We normally delegate the few rules to Business Managers, so that they can modify the rules as changing business needs, without going to developer portal. We normally put those rule for delegation which change frequently, have less impact on business etc. Delegating a rule

    To mark a rule as delegated, click the Favorites toolbar button ( ) and complete the Delegated Rules dialog box.

  • 32

    Opening a delegated rule:

    To open a rule delegated to you:

    From the WorkManager portal, open the Dashboard workspace, locate the My Business Rules area, and click the link that labels the delegated rule.

    From the Developer portal, select View > My Rules > label.

    1. What design considerations should be done while using Commit method in an activity. Ans

    We should use the Commit method judiciously. Flow processing performs commits

    automatically when the flow ends and when an assignment is created or completed. To avoid

    interference with this approach, do not use Commit in the flow-related activities in your

    application.

    When you include the Commit method in an activity, design the processing so that the Commit

    method occurs only after errors are intercepted, checked, and corrected. If a Commit method

    fails, it is unlikely that processing can continue in any reasonable way, so it is important to

    include a transition in the Commit step that checks the status.

    Even when processing can continue after Commit failure, design your activity (after debugging

    and fixing the cause of the failure) to collect any required user input that corrects the problems,

    and re-perform any Obj-Save methods that preceded the Commit call.

    Smart Layout

    Introduced in V5.5, a Smart Layout is a grid (corresponding to an HTML element) of paired cells on a harness, section, or flow action form that has columns of uniform width, uniform styles, and uniform characteristics. Each pair of cells holds one label and one property value or other form control.

  • 33

    Using Smart Layouts rather than "freeform" table layouts produces attractive work object forms with less developer effort. Smart Layouts are recommended for new applications. .

    A primary benefit of Smart Layouts it to force vertical alignment even when layouts are nested. When a section using Smart Layouts is nested within another section, all labels and fields are given consistent widths. Process Commander adjusts padding and cell widths to seek attractive spacing and presentation. Select Template with row and column count, from layout. Dont select free form.

    Basic UI

    Flow Actions A flow action is a choice available to users as an interim or final disposition of an assignment they process. Each flow action is defined by an instance of the Rule-Obj-FlowAction rule type.

    Flow actions are of two types: Connector flow actions appear as lines on Visio presentation in the Diagram tab of a flow

    rule. A line exits from an assignment shape and ends at the next task in the flow. At runtime, users choose a connector flow action, complete the assignment, and advances the work object along the connector to the next task.

    A local flow action, when selected at runtime, causes the assignment to remain open and on the current user's worklist. Local flow actions are recorded in the Assignment Properties panel and are not visible on the Visio flow diagram. At runtime, users can select local flow actions to update assignment or work object properties, change the assignee, and so on but do not complete the assignment.

    We can provide our own local flow action, but there are few pre-defined flow actions.

    AddFlow, AttachAFile, AttachANote, AttachAScreenShot, AttachAURL etc.

    In the Action tab of a Flow Action, we provide INDICATOR : Used as -> Local Flow Action, Connector Flow Action, Local and Connector.

    While running the flow, both Local and Connector flow actions are visible under Take Action panel. Action Tab in Flow Action The Action tab under Flow Action contains few important things like.

  • 34

    1.) Run an Activity before this Flow Action is called.

    2.) Run an Activity after this Flow Action is called.

    3.) Validate rule.

    4.) INDICATOR that this is : Local Flow Action/Connector Flow Action/Both Local and Connector.

    HTML Tab

    HTML GENERATION :->

    It can refer a HTML Fragment (Rule-Obj-HTML), a section or can define its own form.

  • 35

    Enable Client Side Validation. -> Select to cause your application to immediately validate the format of user input to dates, integers, and other fields within the browser window when focus leaves the form field, before a user submits the form. For example, you can't enter a letter into a numeric field. You can't enter 02/31/2007 into a date field. Error notification occurs immediately when you tab out of the input field or change focus to another field.

    Enable Expression Calcualtion. -> Causes to evaluate the expressions by forward chaining.

    SECTIONS A section rule defines the appearance and contents of one horizontal portion of a form.

    A section is a portion or area of a standard work object form that is incorporated on a harness form. Sections may contain other sections, informally called subsections.

    The appearance, behavior, and contents of a section are defined by a section rule (Rule-HTML-Section rule type). Section rules are referenced in:

    Harness rules

    Other section rules

    Flow action rules

    Paragraph rules with SmartInfo pop-ups

    Process Commander contains dozens of standard harness and section rules. You can copy and tailor these standard forms to meet your application needs.

    Controls

    Layout Accordian

    Column Repeat

    Row Repeat

    Tabbed Repeat

    SECTIONS.

    Basic

    Advanced AutoComplete Charts Dynamic Selct

    List View Paragraph

    HTML Tab.

    Auto Generate HTML Only. We uncheck this box and can provide our own HTML/JSP in the below space.

    http://localhost:8888/prhelp/rule-/rule-html-/common/commoncolumnrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commoncolumnrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonrepeatinglayout.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonrepeatinglayout.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commontabrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commontabrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonlayoutselect.htm

  • 36

    HARNESS A harness rule an instance of the Rule-HTML-Harness rule type defines a runtime form.

    Use harness rules to define the appearance and processing of work object forms used in your application to create work objects and process assignments.

    Like section rules, HTML rules, property rules, and others, harness rules define the structure, appearance, and behavior of the forms used in applications to create and update work objects and assignments.

    Process Commander includes more than a dozen standard harness forms for entering,

    reviewing, updating, and processing work objects and assignments. Your application can override the

    standard rules to extend and tailor them to specific needs.

    Each harness rule defines the appearance and behavior of a form. Harness rules produce three types of forms:

    Work object forms For reviewing, entering, and updating work objects in a Process Commander application

    Composite portals User portals that support application users with Firefox browsers as well as

    Rule forms Forms that appear in the Developer portal that developers and administrators use to review, enter, or update rules or selected data objects. (This capability is reserved.)

    There are various types of Harnesses. New, Perform, Confirm, Review.

    When we start a flow, the new Harness is created. In the Process Tab of the flow, we can check:

    - Create New Work Object - then only the process button appears on the screen.

    - Skip creates new Harness - This will skip the new harness screen while we run the flow.

    1) Perform Harness: This harness will appear when any flow action is called within an

    assignment. Any flow action will have the GUI, is painted on Perform Harness.

    2) Review Harness: Display the W.O in display only mode, with no fields changeable. To review the assignments and w.o without any update.

    3) Confirm Harness: Accepts a text note confirming the users response. This harness is called

    at the end when the processing of the Work Object is finished. Presents a read-only confirmation display of the work object, acknowledging user completion of an assignment. Contains the Get Most Urgent button.

    This button is by default linked to the standard activity Work-.GetNextWork. Your

    application can override that activity.

    Reopen: Allows a user to reopen a resolved work object.

    PrintReview: Supports printing of all the fields.

  • 37

    Controls.

    Layout Accordian Column Repeat

    Row Repeat

    Tabbed Repeat SECTIONS.

    Basic

    Advanced AutoComplete Charts Dynamic Selct

    List View

    Paragraph

    Scripts and Styles Tab.

    Script File: It accepts a Javascript/VBscript file name.

    Style Sheets: The CSS Style sheets.

    HTML Tabs

    http://localhost:8888/prhelp/rule-/rule-html-/common/commoncolumnrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonrepeatinglayout.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonrepeatinglayout.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commontabrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commontabrepeat.htmhttp://localhost:8888/prhelp/rule-/rule-html-/common/commonlayoutselect.htm

  • 38

    Making Section Visible/Invisible.

    Click on the magnifier of the Section. Make it Visible When (can refer a when condition). Making Property Visible/Invisible.

    Provide the Visibility condition as above. Note: The Section and Property will be visibility/Invisibility will be triggered by some event.

    E.g:- Click on Behavior Magnifier. So OnClick of this HTML Property, The Section will refresh.

    You can even call an Activity.

  • 39

    Containers: A container is a structural element of a work object form, defined through a harness rule. Not

    every work object forms include a container. The container may correspond to a visually distinct rectangle on the form, marked by a colorful border.

    We can drag a section here. Only Harness rules contain Containers.

    Panel Sets A panel set is a configuration of sections in a harness rule that support a composite portal. On the

    Layout tab of the Harness rule form, use the Panel set control ( ) to select among the available panel sets.

    Each panel set has one or more panels, each identified by position as Top, Left, Right, Bottom, or Center.

    This panel set is only available in Harness and we can put sections in it.

    - Accordions and Tab are present in Harness and Sections only.

    Validation in Pega.

    1) Using Validate Rules (Rule-Obj-Validate) Create a validate rule. Go under process Validate.

  • 40

    Validate Each -> Give Aggregated property name.

    Call and Call for Each -> Give a clip-board page.

    This validate rule can be used under Flow Action -> Action tab.

    This rule is used in Flow Action for validating the properties and parameters. Its also used under Activity under methods Obj-Validate. Obj-Validate validates only selected properties on the page, but Page-Validate validate all the properties in a page. There is another method called Property-Validate, it validates the selected properties, using the edit validate rule (mentioned in the property it-self) (custom java). Note: Flow Action, Action tab has 4 major things. 1) Run Activity before Action

    2) Run Activity after Action

    3) Validation Rule

    4) Indicator (for local flow action/connector flow action).

  • 41

    2) Using Rule-Edit-Validate

    Difference between Validate rule and Rule-Edit-Validate

    1.) Rule-Edit-Validate: It requires Custom Java code to validate the property. But Validate rule doesnt require java code, but we give expressions to validate the property.

    2.) Rule-Edit-Validate: It is implemented on property as a whole (In advanced tab of the property form). It is fired automatically whenever the property is referred. But Validate rule is

    implemented at screen level (at Flow-action action tab) or called by Activity (Obj-Validate and

    Page-Validate methods).

    Using Constraints. (Rule-Declare-Constraint)

    This normally generates a client-side validation code. And it is used to put validation/restriction on the property in relation to other properties (expression) .It also fires automatically, as it is under declaration rules. See the Declaration section for more info.

  • 42

    Activities Basics: (We have a separate activities section)

    Here we have written an activity with 2 steps. In first step, it sets the property values. The values for Name and RollNo is being supplied as parameter (from where this activity is called, like from a Flow Action).

    In Step-2, we have called another activity and supplied a parameter to it. (this will be output parameter in calling activity.) The value of output parameter is supplied from the calling activity. The parameters tab of calling activity:

  • 43

    Types of Activities:

    While calling an activity from Utility shape, change the Activity type under security tab as Utility.

    Creation of Flow While creating a Flow we have to edit a check-box in its process tab.

    Flow:

    A flow is a fundamental representation of a business process in PRPC. Its an instance of Rule-Obj-Flow rule type, which defines the sequence of processing that your application applies to work objects. They are represented through Visio diagrams.

    Types of Flow

    There are basically 4 types of flow.

    1.) Starter Flow: A flow that creates a new work object is called a starter flow.

    2.) Straight-Through Flow: A flow rule that contains no assignments, and so can execute from start to end without human input, is known as a straight-through flow.

    3.) Sub Flow: A flow that is called by another flow is known as a subflow; the calling flow is called parent flow. Processing of a subflow is synchronous, meaning that the calling flow execution

    http://localhost:8888/prhelp/definitions/s/straightthroughprocessing.htmhttp://localhost:8888/prhelp/definitions/s/straightthroughprocessing.htmhttp://localhost:8888/prhelp/definitions/s/subflow.htmhttp://localhost:8888/prhelp/definitions/p/parentflow.htm

  • 44

    pauses for the duration of the subflow. When the subflow execution reaches a Flow End shape, the calling flow can continue.

    A Sub flow can create a work object.

    4.) Screen Flow: This flow cannot create a work object. This is special kind of sub flow where we give the flow action inside the assignment itself, not in the connectors. While creating this Screen Flow, we have to do few modifications.

    In the sub-flow properties panel

    Flow Type: Screen Flow. And while creating the Screen Flow, Template: Screen Flow Standard Tabbed, Screen Flow Standard Classic etc.

  • 45

    UTILITIES: These are used to call an activity from a flow (Activity type = utility).

    Here we are calling a pre-defined activity to update the status of work object.

    There are pre-defined Activities which we can reference in this utility like: UpdateStatus of work object.

    Also we can provide our own Activity under Rule: The Activity must be of type Utility.

    Assignments Important Properties of assignments are:

    Rule (Worklist, Workbasket), Instruction, Work Status, Status Assigned, Confirmation Note, Notify,

    Route, SLA, Local Action. Etc.

    Spin-Off:

    A Spin-off task causes the second flow (sub flow) to start. The main flow and the second

    flow executes asynchronously. The user can choose, which flow (Main Flow or Sub-flow) to run first.

    While we reach the Spin-off shape, we can choose: View ->My Recent Work -> The recent

    work to see the process list.

    Now we can choose from the process list, which flow to run first. In its properties panel, we

    provide the Rule: Flow name.

  • 46

    The Process List for main flow and sub flow to choose between Note: Except Screen-Flow, other flows can create a new work object. Hence we can say that in spin-off, the sub-flow can create flow to work on same work object (screen-flow) or can create a new work object (a sub-flow or other main flow).

    Split-Joint: Use the Split-Join shape to require that multiple subflows of your flow be completed before the current flow continues execution. This allows subflows to execute asynchronously, in parallel. Put multiple sub-flows inside it. While we run the flow, we can use view-> My Recent Work to see the Process list containing all the sub-flows. The parent flow will run at last.

    There is option here that, to run parent flow when all sub-flows are completed or any one sub-flow is completed.

  • 47

    We describe the Split-ForEach after the PageList Concept.

    PageList: For creating pageList, we have to first create a Data- derived class to contain the properties that we want to include in pageList. e.g : Class DLF-RealState-Structure derived from Data- class. Create properties in it like: EmpId, EmpName, Salary. Now in the Work type, create a property of type pageList. In the form, itll ask for the Class name containing the properties. Provide the data class name.

    The pageList property will appear like below.

    Now we create a Flow Action for PageList. Well create a repeating layout in the Flow Action/Section.

  • 48

    Now click on the magnifier button on the layout, and edit the general tab.

    Give the PageList/Group as the pageList property we created. Now the Class will be the

    containing class of the properties in the Page List.Now drag and drop each element under each of the

    2nd column of the layout. This will create a aggregate layout flow action/section.

    Creating Data Tables. Go to Application -> Data Table.

    Click On Add new data table.

  • 49

    Give Class name: The Data- derived class which will contain these properties. Description: Description of data. Create properties itll contain, with one column as primary key. Now generate. Itll create a Database class containing these properties. By default, instances of classes created through this facility are stored in the PegaRULES database table named pr_other and are limited to 1,000 rows. Editing Data Tables

    If we create a data table using the above methods, itll also create few things under technical category like.

    in the Data- derived class. Click on EditList and modify the things.

    Save the modifications. Now can check the Data tables, the modification will reflect there.

    Split-For Each It is used to process an aggregated property (PageList/PageGroup) and executes a sub-flow for each page.

  • 50

    E.g.: if a PageList contains 4 individual pages (4 rows in repeating layout), then for each node (page)

    the sub-flow will run.

    Note, here we provide values. Page Property as : the PageList that we want to process. Class: Containing the Properties of the PageList. Flow Rule: The sub flow name. Note: The Sub flow mentioned here must be under the Data- derived class because itll process the properties of Data- Class. Also the flow actions mentioned inside this sub-flow must be defined under the Data- derived class.

    When well run the flow, process list will appear equal to the no. of pages in the PageList. We can choose any of the process list to run the sub-flow. Normally we can think this thing in this way. We have an employee list, with EmpNo, Name and Salary. We want to Calculate DA and HRA for each employee, the calculation goes inside the sub-flow.

    SKIMMING: The Skim facility causes a resetting of the RuleSet version values in the highest version of existing

    rules. For each rule instance in a specified RuleSet or version, the system identifies the highest numbered version and creates a still higher copy. For a major skim, the system adds one to the major part of the version, and sets the minor

    and patch values both to "01." For a minor skim, the system preserves the major version, and sets the minor and patch

    version values to the version you specify. Starting a Skim operation

    From the Developer portal, select Tools > Rule Management >Skim a RuleSet to begin the skim operation.

  • 51

    Results:

    Skimming simplifies the topmost rule versions in a RuleSet after multiple iterative development cycles. For example, if the highest version was previously 02-21-06:

    After a major skim, the skimmed version number is 03-01-01. After a minor skim, the skimmed version number is 02-22-01.

    Rules in lower versions such as 02-21-05, 02-18-53, or 01-88-15 of the same rule are not copied by the skim operation.

    The skim automatically creates the new RuleSet version instance corresponding to the major, minor or patch version above the current version. It then copies rules from the current version (selecting only those in the highest-numbered version) into the new major or minor version. Rules with available of Blocked in the source RuleSet versions are not copied.

    Decision Tables: Sample Decision Table. Below is the Results Tab. We can provide allowed results for return.

    Preset properties and Options.

    Note that, I havent found any option for calling other decision rules under it. Wait Now I found out.

  • 52

    We can call other Decision table using call.

    Decision Trees: We may provide the input values (property to evaluate) at input tab.

    This is the Results Tab.

  • 53

    This is the Decision Tab.

    Map

    We need to provide the Input values for Row and Columns, Then can provide a matrix structure

    between 2 values.

  • 54

    Decision Tree/Table/Map in Flow

    Connector Properties

    Status compares the return values of Decision rules used above.

    DECLARATIONS

    1) DeclareOnChange

    A Declare OnChange rule automatically executes an activity, or suspends the current work object, when the value of a specified property changes.

    There can be more than one property that we can include in Declare OnChange rule to watch. If any of them changes, we can fire 2 activities. One when a When condition returns true, and another when it returns false.

    Note: The called activity must be of Activity Type = Onchange (in security tab)

    See next page for Fig.

  • 55

    Declare OnChange can also be used to validate properties. We can suspend work object, if the value of the property is modified meeting some criteria.

    Note: Choose Action is Suspend Work Object (Not call activity as before)

    Policy Override Flow to Run, we can include any other flow to continue running if the Roll No changes and when condition is met. Here we can see, we have given the same flow name at Policy Override Flow To Run so that work object stalls and asks the user to change the property value. Declarations (Rule-Declare-) Declarative rules offer the ability to perform processing whenever the value of a specified property changes, or on other conditions. We can say that Declarative rules simplifies the applications and reduces the no of activities we create.

    They are fired automatically whenever the value of any property changes and on other criteria. Declarative rules follow forward chaining as well as backward chaining. Forward Chaining: It is the process by which, the target property changes/adjusts its value depending upon change in the source properties. E.g: A = B + C. If values of either B or C changes, The value of A is automatically adjusted. Backward Chaining: Unlike forward chaining, whenever the target property is used or referred, its value is calculated at that point by seeking the values of its source properties in the dependency network. E.g: A = B + C. B can be = D + E and Similarly C = F + G. Note: Only Declare expressions use backward chaining. Rest all Declaratives use Forward chaining only.

    So the dependency network is built in this way.

  • 56

    They are of 6 types.

    Declare Expression

    Constraints

    Declare OnChange

    Declare Trigger: Declare Trigger rules perform an activity any time data of a specific type is changed in the application. For example, a declare trigger could be defined to flag a customer's account for review any time their address changed.

    Declared Index: Indexing can improve performance and facilitate reporting. Create a Declare Index rule to define criteria under which Process Commander automatically maintains index instances for faster access. An index can improve search and reporting access for properties that cannot be exposed as database columns because they are embedded within an aggregate property.

    Declared Pages: A declarative page is a clipboard page created by execution of a declare pages rule (Rule-Declare-Pages rule type).The name of a declarative page starts with the prefix Declare_. Such pages are created and updated only through operation of activities identified in a Declare Pages rule. The contents of these pages are visible but read-only to requestors.

    1) Declarative Expressions: Declare expressions establish functional relationships between properties, and compute the result any time one of the Inputs is changed. Declare expressions ensure that any time an input is changed by any source, the result is always Up-to-date. Ways to create:

    New -> Declaratives -> Declare Expressions

    We can provide Page Context, if we want to calculate values from a pageList/pageGroup.

  • 57

    The Change Tracking Tab. 1st option is

    Forward changing. Rest 4 options are Backward changing.

    In the UI Part

  • 58

    We can change the behavior of properties A1 and A2 as Event = On Change, Action = Refresh This Section. Note: We can call An activity also when the input changes.

    2) Declarative Constraints: Constraints rules provide data validation for properties after they are already inside your

    application. Any time the specified property changes, the constraints rule checks to confirm that the value still falls within the expected range.

    Normally Constraints are used to define validation on one property based on criteria on another property. Eg: If a = 10 and b = 20 then c must be 30.

    3) Declare On Change: Declare OnChange rules run an activity any time that the value of a specified property changes.

    Note: The activity referred must be of type OnChange in security tab. We can also Choose Action = Suspend Work Object and can assign to start a new flow.

  • 59

    So, when condition is true, it Suspends Work Object and Calls another Flow : Screen Flow.

    4) Declarative Pages: Given in diff section.

    5) Declarative Trigger: Create Declare Trigger rules to cause an activity to run when instances of a specific class are

    created, updated, or deleted in the database. This implements a form of forward chaining.

    For each Declare Trigger rule, Process Commander monitors database operations for objects of the Applies To class (and concrete classes derived from that class). During database commit processing, forward chaining processing may trigger start execution of the activity identified in this rule.

    Trigger when an instance is

  • 60

    If we choose Save and .. Then we have to provide some properties that will be watched. ...ONE OF THESE PROPERTIES WAS MODIFIED Provide the property name that will be watched, so that trigger will fire the activity (of type trigger). Copy Value To (optional): Provide another property name that will hold the original value of the property modified. When: Provide a when condition that will be evaluated. If true then only Activity will be fired.

    Trigger Activity: Name of the trigger activity that will be fired. This Activity should be of type trigger.

    6) Declarative Index:

    Indexing can improve performance and facilitate reporting. Create a Declare Index rule to define criteria under which Process Commander automatically maintains index instances for faster access. An index can improve search and reporting access for properties that cannot be exposed as database columns because they are embedded within an aggregate property. Index instances are sometimes called alternate keys or secondary keys. The system saves indexes as instances of concrete classes derived from the Index- base class.

    By default, Process Commander stores properties that are embedded in a Page, Page List, or Page Group property in a BLOB column in the database. In order to make these properties available for reports, and to optimize them for processing in other operations, the Property Optimization tool "exposes" the values of an embedded property by creating a concrete Index- class, properties for the new class, and a Declare Index rule that allow Process Commander faster access to the property values.

  • 61

    Source Page Context: Name of the PageList. Source Page Context Class: The class name which holds the actual properties (Not which holds the PageList Property) Index Class to Write: A concrete class derived from Index- Class, It will also contain the same properties as above class. PROPERTIES FOR INDEXING AND MAPPING Map the properties from Page Context Class to index Class.

    ACTIVITIES Activities automate processing. Activity rules contain a sequence of structured steps. Each step calls a method rule or contains a control instruction such as Call or Branch.

    contain a sequence of procedural, atomic steps that are by default executed top down

    reference a specific instruction (known as a method) in each step

    can perform calculations

    can retrieve, update and save data

    can call other activities

    can contain loops or iterations

    Note: We cannot create our own methods and we have to use the given set of methods only.

    1) Page-New and Show-Page: Creates a new page in Clipboard and Show-Page shows the page in XML Format. Show-page is normally used during debugging, because it blocks the flow. We should remove the Created page by using Page-Remove method if its not used further. This keeps the performance good.

    In Pages & Classes:

    give page name: SamplePage

    page class : The class name where the properties mentioned are defined.

    Here, we have created a new page called SamplePage and called a decision table, which returns a

    value.

    We capture the returned value in SamplePage.RollNo. Show page displays the output as below.

  • 62

    OutPut:

    Note: If we have used a model for a class, then if we declare a page and class in pages and classes tab, then the model will also b called when the page is created.

    Model: Represents the model of the class for which we create the page. Itll initialize all the properties of the class in the page.

    PageList: To save the name of the new page as the final element in a list, identify a Value List property (not a PageList property). Use the notation pagename.propertyname. The system appends

    the name of the new page as the value of the last element of the Value List property.

    NewClass: Optional. Identify a class in most cases concrete class for the new page. Enter the keyword $NONE to create a classless page. If left blank, the system creates the new page using the

    class of the page specified in the Step Page column of the activity step being executed. (It retrieves

    the class of this page from the array entered in the Pages & Classes tab of the Activity form.) If the Step Page field is also blank, the system creates the new page of the class that is the first key part of

    the current activity.

    2) Page-Clear-Message: Clears all the messages in the page. Normally validation/error messages. 3) Page-Unlock:

    Use this method to unlock a page in the unusual situation that the page was locked during the Obj-Open operation but the ReleaseOnCommit parameter was not selected. Typically, when the Obj-Open method opens and locks an object from the database, the ReleaseOnCommit parameter is selected. When a later Commit method executes, the system automatically releases the lock.

  • 63

    However, when the ReleaseOnCommit parameter is not selected, the Commit operation has no effect on the lock, which remains in force. This capability facilitates multiple Commit operations on one page without the need to re-acquire the lock.

    You can also use this method to release a lock that is no longer needed, regardless of the ReleaseOnCommit parameter value. 4) Page-Validate

    Use the Page-Validate method to force validation (or revalidation) of the value of all properties on the step page. The system adds a message to each clipboard property that fails validation against the restrictions in its property rule.

    If the page has hundreds or thousands of properties, this method can be expensive in terms of system resources. The properties on the page already set (through the Property-Set method or similar methods) may already be validated. This method validates them again, and also validates any property values not changed since the page was opened.

    Unless the content of the page was altered by Java code or by unorthodox means, the Page-Validate method is not necessary.

    It actually refers the Rule-Edit-Validate and Rule-Declare-Constraints to validate the properties on the Page.

    Use the Obj-Validate method, not the Page-Validate method, to validate specific properties identified in a Rule-Obj-Validate rule. -A Page-Clear-Messages method applied later to the page removes the messages set by this method.

    4.3) Property-Validate

    Uses Rule-Edit-Validate. Continue -> Continue if error found else stop. Default -> Set a value if null. Required -> Value is required else set an error message value not present.

    4.5) Obj-Validate:

    Use this method to apply a validate rule (Rule-Obj-Validate rule type) for the object identified on the primary page or step page.

    This is different from Page-Validate in one case. It only validates the selected property not all the property. But Page-Validate validate all the properties.

  • 64

    Validate: The Rule-Obj-Validate rule OverrideClass: The class name from which the search for the above rule will start. 5) Property-Set-HTML Use this method to save the contents of an HTML stream as the value of a Single Value property. The property value can then be mapped as output for transmission to an external system.

    Parameter Description PropertyName Enter a Single Value target property reference. Identify the property that to receive its value from stream processing.

    Typically, choose a property that has a Text type. HTMLStream Enter the Stream Name key part of an HTML rule (Rule-Obj-HTML rule type) to be processed to produce the value

    of the property. 6) Show-HTML Use the Show-HTML method to cause the activity to process an HTML rule and send the resulting HTML to a user for display by Internet Explorer. Known as stream processing. this may involve the interpretation of JSP tags (or the older directives), which can access the clipboard to obtain property values, or can insert other HTML rules, and so on.

    Parameter Description HTMLStream Identify the Stream Name key part of an HTML rule (Rule-Obj-HTML rule type) to be processed. The system uses the

    class of the step page as the Applies To key part of the HTML rule.

    7) Show-Stream Use the Show-Stream method to apply stream processing to an HTML rule, correspondence rule, or XML Stream rule, and send the results to a browser-based requestor session.

    Parameter Description StreamClass Optional. Identify the class of a rule type derived from the Rule-Stream class. such as:

    Rule-Obj-Corr

    Rule-Obj-HTML

    Rule-Obj-XML

    If blank, the default value is Rule-Obj-HTML.

    Do not use this method with list view or summary view rules.

    StreamName Enter the second key part of the rule to be processed. To locate the rule using rule resolution, the system uses the class of the of the step page as the Applies To class of the rule.

    StreamType Optional. If you selected Rule-Obj-Corr or Rule-Obj-XML as the StreamClass value, enter here the third key part of the rule (the Correspondence Type or XML Type).

    8) History Add We can append the history details of a work object. Database related methods

    9) Obj-Open: Use the Obj-Open method to open an instance stored in the PegaRULES database or in an external database linked to an external class, and save it as a clipboard page.

  • 65

    OpenClass: This is the Data table class, whose instance we want to open. Here its DLF-REALSTATE-MATERIALS-Work-Employee

    Lock: Lock this instance, if we want to update/save/delete. So that it cannot be accessed by other requestor.

    ReleaseOnCommit : Use this to release the lock, if commit is encountered.

    LockInfoPage: Use this page if acquiring of lock fails. In that case, this page is created in clipboard and shows the details.

    Property Name: Enter the property that would appear in where clause. We can give multiple properties too.

    The above method fires a query: Select * from DLF-REALSTATE-MATERIALS-Work-Employee where EmpId = 23

    10) Obj-Open-By-Handle : This is another way to open the database instance by using handle. Handle is a key column (pzInsKey) which is a combination of data class + primary key. So for the above example, the handle for EmpId = 23 and data class DLF-REALSTATE-MATERIALS-WORK-EMPLOYEE would be

    ----- DLF-REALSTATE-MATERIALS-WORK-EMPLOYEE 23

    We can put PropertyName = pzInsKey and value as DLF-REALSTATE-MATERIALS-WORK-EMPLOYEE 23

    11) Obj-List : This retrieve data from a data table to the clipboard as an array of embedded pages. This method is deprecated, as it returns the value of all the columns, hence kills the performance. Use

    Obj-Browse and Obj-List-View followed by Obj-Filter Instead.

  • 66

    Page Name: Name of the page from pages and classes that will hold the record of the returned values. In pages and classes, we put the value as: pages : MyResult. Classes : code-pega-list (Normally it should be this class only to hold the retrieved records in embedded pages. ObjClass: Name of the data table class whose instance needs to be searched. RuleObjList: Optional. Identify the second key part List Name name of a list rule that specifies which properties are to be retrieved. SelectionProperty: The property specified here will take part in where clause of the query. If left blank, all the records will come. The query here will be: select * from where EmpId is between 1 and 25.

    13) Obj-Browse : This queries the Database with only selected properties. Only properties exposed as columns can be used as selection criteria. However, values of properties that are not exposed as columns, including embedded properties, can be returned.

    Page Name: Name of the page from pages and classes that will hold the record of the returned values. In pages and classes, we put the value as: pages : MyResult. Classes : code-pega-list (Normally it should be this class only to hold the retrieved records in embedded pages.

  • 67

    ObjClass: Name of the data table class whose instance needs to be searched. GetRowKey: Include the primary key in the result-set. Logic : Below logic, there are steps label (A and B). We give logic for or, and conditions. Like (A AND B) , (A OR B), (A OR (B AND C) ). Select: If select this check-box, only those properties will be retrieved in result-set. If check none, all properties will be retrieved. Field: Only exposed properties can be there in Field value. It will be used for selection criteria. Condition: We can give a number of conditions and the property to be part of where clause must be exposed property. Sort: Can short ascending and descending.

    13) Obj-Filter : Use the Obj-Filter method to filter the embedded pages of a results page (such as a Code-Pega-List page produced by the Obj-List, RDB-List, Obj-List-View or Obj-Browse methods) based on one or more when condition rules.

    We have used here Obj-Browse then Obj-Filter to filter the resultset. List page: The page (code-pega-list) used above in Obj-browse to hold the result set as embedded page. ResultClass: The data table class. When: Provide a when condition to filter the data. (Here when is .Empld < 100). 14) Obj-List-View :

    Use the Obj-List-View method to execute the retrieval and sorting operations, but not the formatting and display processing, of a list view rule. The system uses rule resolution to find the list view rule and executes it, but does not produce any HTML output display. The selection criteria of the list view rule and the sorting requirements (recorded on the Content tab) are converted to an SQL query that is sent to the PegaRULES database.

    The database results are organized into a results page of class Code-Pega-List. The name of this page is determined by the Content Page Name field on the Content tab of the List View form, (The Step Page field on the step is ignored.)

  • 68

    Parameters

    Specify all three key parts of a list view rule.

    Parameter Description ObjClass The Data table class

    ListView The List-View Rule of the Data table class

    Owner Owner of the List-View rule

    15) Obj-Save Use this method to request that the system save a clipboard page to the PegaRULES

    database or (if the page belongs to an external class) an external database.

    The Obj-Save method uses properties on the page to derive the internal key under which it will be saved. This method can create a new database instance or overwrite a previous instance with that key.

    An object that is stored in the PegaRULES database is persistent. The object is available to other users, and remains after the requestor session that created it ends.

    This method does not always cause the object to be written immediately to the database. Often, developers use this method perform a "deferred write" operation. In such cases, later execution of the Commit method, in the same Thread, completes the database update.

    Select the WriteNow parameter to force this page (and only this page) to be written to the database as part of the Obj-Save method. Unlike the Commit method, the Obj-Save method does not operate on all previously marked-for-commit objects, only on the current page, and does not release locks.

    You can reverse the effect of an Obj-Save method if it has not yet been committed with the Obj-Save-Cancel or the Rollback method.

    Cautions

    In all but rare situations, do not save a page that contains messages and so is marked as invalid.

    16) Obj-Save-Cancel Use this method to cancel the most recent uncommitted Obj-Save method, so that the instance is not written as part of a later Commit operation. You can also use this method to undo an Obj-Delete that has not yet been committed.

    Use the similar Rollback method to cancel all uncommitted Obj-Save and Obj-Delete operations, not only the most recent one.

  • 69

    17) Rollback Use this method to cancel or withdraw any previous uncommitted changes to the PegaRULES database (and to external databases accessed from an external class) from the current Thread. All pending Obj-Save and Obj-Delete methods are cancelled.

    18) Obj-Sort Use this method to sort the clipboard pages that are the values of a property of mode Page List. You can specify one or more properties to sort on, and whether the sort sequence is ascending or descending for each sort level.

    Parameters

    This method has two base parameters and an array of two parameters per row: Parameter Description PageListProperty Enter a property reference that identifies a target property of mode Page List to be sorted.

    Class Identify the class of the pages within the Page List property.

    SortProperty Enter the property based on which well sort the pages.

    Descending Select to cause the method to sort in descending order for the property. Clear the box to sort in ascending order.

    19) Obj-Delete Use the Obj-Delete method to delete a database instance corresponding to a clipboard page and optionally to delete the clipboard page too. You can cause the deletion to occur immediately, or (more commonly) defer deletion until a later execution of a Commit method.

    This method can operate on objects of both internal classes (corresponding to rows in a table in the PegaRULES database) and external classes (corresponding to rows in an external relational database).

    The Obj-Delete method uses the class of the page to obtain the appropriate Rule-Obj-Class instance. It uses the table name, key fields, and other aspects of the class rule to mark the instance for deletion. Unless you check the Immediate check box on the activity form, the database deletion does not occur until the system next processes the Commit method.

    You can reverse or cancel a previously executed Obj-Delete method by using the Obj-Save-Cancel method (like the method Obj-Save can be reversed), unless the Immediate box is selected or the Commit method has already occurred.

    Parameters This method has two parameters:

    Parameter Description Remove If selected, the system deletes the page identified in the Step Page column of this step from your clipboard and marks the

    corresponding persistent instance for deletion.

    Immediate If selected, the system deletes the database instance immediately (commits this deletion).

    To delete the database instance immediately from the database, select this box. If this box is cleared, the database instance is deleted by the next Commit operation.

  • 70

    Results

    The system finds the clipboard page identified in the Step Page column of the current step and checks whether it the current requestor holds a lock on the corresponding object.

    If the object is not locked (and the class rule allows locking), the method fails and no clipboard or database changes occur.

    If the page is locked and the Remove parameter is selected, the system deletes the page. It marks the persistent object in the database for deletion, or deletes it immediately, depending on the Immediate parameter.

    The system automatically performs index processing for an immediate delete, or later when a Commit method follows the Obj-Delete method.

    Fail and Warn conditions

    These situations cause the method status to be Fail or Warn.

    You cannot delete an instance without locking it first (usually with the Obj-Open method).

    You cannot delete an instance while it is locked by another requestor.

    20) Obj-Delete-by-Handle : Delete an instance by handle. 20.5) Commit: Use this method to commit all uncommitted database changes. This method writes all the instances specified by one or more earlier Obj-Save methods to the PegaRULES database (for internal classes) and to external databases (for external classes).

    Decision Methods (Property-Set-Decision-) 21) Property-Map-DecisionTable Use the Property-Map-DecisionTable method to evaluate a decision table rule and save the result as the value of a property.

    PropertyName: Property to receive the return value of Decision Table. 22) Property-Map-DecisionTree Use the Property-Map-DecisionTree method in to evaluate a decision tree rule (Rule-Declare-DecisionTree rule type) and store the result as the value of a property.

  • 71

    PropertyName: Property to receive the return value of Decision Table. Input: Optional. Enter a literal value or property reference that is the source value for the decision tree evaluation. When provided, this value is used for comparisons in the top-level structure of the true, for evaluations with no left-hand value, such as: if > "Hello" When you leave this blank, the system uses the value of the Property field on the Input tab of the Decision Tree form for the rule. 23) Property-Map-Value The Property-Map-Value method evaluates a one-dimensional map value (Rule-Obj-MapValue rule type) defined in the parameter. The method sets the result as a value for a Single Value property.

    24) Property-Map-Value-Pair The Property-Map-ValuePair method evaluates a two-dimensional map value rule identified in the parameters. It sets the value that results into a specified property.

  • 72

    25) Property-Seek-Value: Use this method to initiate backward chaining computations for the value of a property, based on Declare Expression rules.

    26) Property-Set-Messages

    Use this method to associate a text message with a property or a step page. The system reads the appropriate property and adds the message to the page. You can provide the entire literal text of the message, or reference a message rule key that in turn contains message text.

    Message: This field can contained a pre-defined message or a Field Value. 27) Property-Set-Special : Used to set special properties like py properties. But deprecated now. We can use the Proprty-Set method only. 28) Call Use the Call instruction to cause the current activity find another specified activity and execute it. When that activity completes, control returns to the calling activity.

    Pass current parameter page?

    Select to cause the calling activity's parameter page to be passed to (shared with) the called activity, which can alter its contents in any way. Clear to use the array that appears below the check box to pass parameters to the called activity.

    If you select this box, the parameter page remains available to the calling activity after the return. This capability is

  • 73

    sometimes known as call-by-reference.

    If you select this box, make sure that input parameter values needed by the called activity are present on the parameter page before calling the activity.

    Or pass the parameters required by the called activity. Here we pass two input parameter (A and B) and one output parameter i.e C. 29) Branch : Similar to call but.

    Use the Branch instruction to cause the current activity to find another specified activity and branch to it without a return. When the system executes a Branch step, control transfers to another activity found through rule resolution. Execution of the original activity pauses.

    When the branched activity ends, processing of the current activity ends also; no steps after the Branch step are executed.

    You can pass parameters to the target activity, or you can share the current activity parameter page with the target activity. RDB Methods The four RDB Methods RDB-Open, RDB-Delete, RDB-Save, RDB-Browse are not used individually. But they are used in conjunction with Connect SQL rules. (New -> Integration-Connectors -> Connect SQL).

  • 74

    30) The RDB-Open -> will use the SQL query written in the Open Tab of Connect SQL tab.

    Use this method to retrieve a single row (record) of data from an external relational database and add the retrieved data into a specified clipboard page as property names and values.

    Use this method in conjunction with a Connect SQL rule that contains SQL SELECT or EXECUTE statements in the Open tab. Define the SQL statements so that the database returns exactly one row.

    OpenClass -> The data class name, whose instance we want to open. RequestType -> 3rd Key Part of the Connect SQL rule (See in previous page) Access-> MSSQL, ORACLE, SYBASE, DB2 etc. 31) The RDB-Delete -> will use the SQL query written in the Delete Tab of Connect SQL tab. It has the same parameters as above. Use this method to delete a row or rows from an external relational database using SQL. This method operates in conjunction with an SQL statement in the Delete tab of a Connect SQL rule (Rule-Connect-SQL rule type) that contains the DELETE, TRUNCATE or DROP SQL statement. 32) The RDB-Save -> will use the SQL query written in the Save Tab of Connect SQL tab. It has the same parameters as above.

  • 75

    Use this method to save the contents of a clipboard page into a row of a relational database. The system saves the properties on the specified step page to the specified table in the database.

    This method operates in conjunction with a Connect SQL rule that contains SQL statements such as INSERT, UPDATE, and CREATE statements on the Save tab.

    33) The RDB-List -> will use the SQL query written in the Browse Tab of Connect SQL tab. Use this method to retrieve rows from an external relational database and place the results as embedded pages in a specified step page of class Code-Pega-List. This method references a Connect SQL rule instance, and executes SQL statements stored in the Browse tab of that rule instance. The search can do anything you can specify in a SQL statement, such as a SELECT WHERE statement. Any constraints on the returned data are in the SQL.

    ClassName Enter a class name, the Applies To key part of a Rule-Connect-SQL rule.

    Identify the exact class of the rule. The system does not use class inheritance to find the Rule-Connect-SQL rule instance. This is also the class of the pxResults embedded pages which hold the search results. It can be a class that you created to hold the results.

    This class is distinct from the class which the RDB-List method searches, which you identify in the SQL code in the Rule-Connect-SQL rule.

    MaxRecords Optional. Enter a positive integer that is the maximum number of rows to return in the search results. BrowsePage Optional. Identify the top-level page into which the search results are to be returned. The pxResults pages are

    embedded in this page. If left blank, the system uses the step page you specified for the RDB-List method in the activity step.

    If you select this option, do not select the RunInParallel option. Parallel operations cannot update the single top-level browse page.

    ApplyDeclaratives Select to cause change tracking for Declare Expression and Declare Constraint rules processing to be applied to the properties returned by this method.

    You cannot select this box if the RunInParallel box is selected.

    Complex and Dynamic SQL Statements in Connect SQL.

    In Connect SQL Rule, in browse tab, we can include lots of complex queries. Note the results can be either a record or sets of record. Hence include a page/page-list accordingly in the browsePage of RDB-Browse method.

  • 76

    - Select MarketPrice as ".MarketPriceprop" : To include column name that includes lowercase letters, include as.

    - WHERE zipcode={myPage.zipcode Integer} : Integer is the database specific data type. - References to elements of Page List and Value List properties must contain integer constant

    index values such as 7 or 23 or keywords such as or . - You cannot use the Param keyword in these property references.

    Table or Class name Literals. the Class keyword is similar to the Table keyword. With Class keywords, use the format:

    {class:ClassName}

    for a direct reference to a fixed, known class. or:

    {class: {page.property}

    for an indirect reference that at runtime becomes the class.

    For example,

    {class:Data-Customer-Address-Details}

    Table keyword To use Table keywords, follow the format:

    {Table:TableName}

    for a direct, static reference to one Database Table instance, or:

    {Table: {page.property}}

    for an indirect reference to a property that, at runtime, contains in its value a Database Table name. For example,

    {Table: {CustomerMaster.OracleAddressTable}}.

    Use this syntax when entering a SELECT statement:

    SELECT columnname AS ".propertyname" or "page.propertyname". to select all the columns in the table. Use it to replace a SELECT * from ... statement.

    For example:

    SELECT {all} from {class: Data-Customer-Summary}

    Calling a stored procedure

    {call procedure({resultset})} we use resultset keyword.

    To create multiple resultsets in one procedure, place a {resultset} marker for each parameter for each example that returns a resultset. For example:

    { {resultset} = call testFunc( {dataPage.OutProperty1 out}, {dataPage.inkey1}, {resultset}, {dataPage.inkey2}, {dataPage.OutProperty2 out}, {dataPage.inkey3}, {resultset}) } Capturing SQL statements and status responses

    To include SQL debugging and return status information from the database software, enter a line at the top of your SQL code in the format:

    {SQLPage:mySQLPage}

    http://localhost:8888/prhelp/rule-/rule-connect-/rule-connect-sql/sqlguidelineshtm.htmhttp://localhost:8888/prhelp/rule-/rule-connect-/rule-connect-sql/sqlguidelineshtm.htm

  • 77

    Enter the name of page on which the system records the error messages. The page can have a class or be a classless page.

    When the Connect SQL rule executes, the system creates a page with this name and adds two properties:

    pxSQLStatementPre The SQL you entered in the Connect SQL form.

    pxSQLStatementPost The SQL you entered in the Connect SQL form tab with the references resolved to show their values, so you can verify the references.

    If errors occur, additional properties appear on this page:

    pxRDBError An error message from Process Commander.

    pxRDBSQLCode A result code from the database access driver.

    pxRDBSQLVendorError1 An error code from the database vendor.

    pxRDBSQLVendorError2 An error code from the database vendor.

    pxRDBSQLVendorMessage1 An error message from the database vendor software.

    pxRDBSQVendorMessage2 An error message from the database vendor software.

    To Map to external DB. We can create a instance of Data-Admin-DB-Name.

    New -> SysAdmin -> Database.

    Use configuration in preferences -> configuration in prConfig.xml Use JDBC URL : Provide JDBC URL, Username and Password. Use JDBC Connection pool : Use JNDI Resource pool. In Advanced Tab, we have connection pool size, and Fail-over Data base.

  • 78

    To return Multiple ResultSet

    Use keyword Mutiset.

    The resulsets will be stored inside the browsePage which must be of code-pega-list. But only in SQL Server and Sybase.

    ASIS KEYWORD Used for dynamic SQLs. Store the dynamic part of SQL statements in a property in clipboard. For example, you can create a text property named DynamicWhere and use a Property-Set method to store the value:

    "pyLabel like 'Mexico%'"

    Then, in a Connect SQL rule, you can use this as a WHERE clause, using the syntax:

    where {ASIS: pyWorkPage.DynamicWhere}

    The ASIS keyword is essential, so that Process Commander does not place spaces or double quotes around the value.

    34) Java: Used to write custom java code.

    35) Connect SOAP: This is used to connect to the SOAP services method. This method is used by the connector Activity to connect to a SOAP services. See Integration section for more details. Similarly Other connect methods also are used to connect to the respective services. Iteration in Activities. Iteration in activities can be done using for loop, for each page, for each embedded page etc.

    Giving 3 ways to iterate in activities.

    1) Using

    This tag holds the current index of iteration. It is updated automatically in each iteration. Note in the below screen-shot. We are iterating on the pagelist EmpPageList (This is created in the clipboard, if we use this pagelist in repeating layout in a flow-action to collect values).

  • 79

    Iterate on .EmpPageList. Under iteration, we have several sub-steps (1.1 to 1.4) - Create a new page (for data class ) - Set Properties in the page that we want to save in data-b


Recommended