peg a basic

Upload: venu-gopal-reddy

Post on 07-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Peg a Basic

    1/3

    Activities and Java OverviewGetting StartedThe Activities and Java topic category covers information about three types of rules; activity rules, library rules and function rules.

    What are activities? What are libraries and functions? Key Features Additional Information

    What are activities?

    An activity rule can perform computations, create, update, or delete objects, orsupport user interactions. Activity rules are most like traditional computer pr

    ograms, in that they consist of a sequence of steps that are typically performedin order. Each step contains a primitive operation known as a method. For examp

    le, an activity can fetch a work item from the database, compute new values forsome of the properties in the work item, and save the updated work item back into the database.

    Activities are popular with many Process Commander application designers who hav

    e previous programming experience. However, activities are only one of dozens ofuseful rule types. By design, activities have limitations and restrictions thatimprove maintainability and performance, but are important to understand.

    What are libraries and functions?

    Process Commander, like Microsoft Excel and many other software products, includes libraries of functions that can be called to perform various useful calculations. For example, the DateTimeDifference( ) function computes the days, hours, minutes and seconds between two moments in time. Functions support a wide varietyof processing needs, including date and time calculations, manipulation of textstrings, operations with HTML styles, importing data from files, and exporting

    data to Excel. Each library holds a group of related functions.

    No knowledge of Java programming is required to use a function (or to execute anactivity). Internally, Process Commander automatically produces Java code from

    these rules that implements the required function. (To create a custom function one not found among the hundreds of standard functions provided does require a developer with Java skills.)

    Key Features of activities

    Activities consist of one or a few dozen numbered steps, that are ordinarily executed in order from the top one listed on the activity rule form to the bottom one. Each step contains an atomic operation known as a method. For example, the P

    roperty-Set method sets the value of one or more properties to a literal constant value, or to the value of a different property, or to the result of a computation. (This method is the Process Commander equivalent of an assignment statementsuch as Area = Width * Height.)

    Many methods add, update, or delete values on the clipboard, a private memory area for each user. Other methods save clipboard contents into the PegaRULES database. Other methods send an HTML or XML document to a user's browser.

    Most activities contain no more than 20 steps. Within the sequence of steps, processing can jump ahead to a later-numbered step, identified by a label, based ona conditional test. (Jumping back to an earlier step, to cause execution to loo

    p, is not allowed. However, limited "repeat-until" loops are supported. ). The e

    xample below has five steps, executed in sequence. Since the Label column is blank, none of these steps is ever reached by a jump.

  • 8/6/2019 Peg a Basic

    2/3

    Activities can call other activities, which can call other activities, and so on. This capability promotes modularity and reuse (sharing of common capabilities)and allows activities that might require many steps to be structured as a set o

    f interrelated but shorter activities. The Show Calls button presents a displayof activity calling relationships; an example appears at the right.

    Like other rules, activities belong to a RuleSet and version. When activity Alpha calls activity Beta, the system uses rule resolution (in the context of a particular user's RuleSet list) to search for the right Beta activity to run.

    Most methods examine, update or create properties on a clipboard page. Each user's clipboard is a private temporary memory area, consisting of a collection of named pages in a tree structure. Each page holds property-value pairs. For example, the Page-New method adds a new page to the clipboard, specifying its name. The new page may initially be empty. The Property-Set method adds or updates the value of a property on a clipboard page. The Clipboard tool, a debugging aid, lets application designers see and interact with a snapshot of their current clipbo

    ard.

    While activities provide power and flexibility, designers must determine when and how they execute. In contrast, declarative rules execute automatically whenever certain conditions are met, and so are the alternative to activities and the recommended "best practice" in many situations.

    Restrictions on the size and power of activity rules do not, in practice, limitwhat application designers can achieve with activity rules. The restrictions encourage good practices and help prevent difficult-to-analyze issues like infiniteloops, deadlocks, and difficult-to-maintain "spaghetti" code.

    Important Terminology

    function rule A rule that performs a computation or other useful operation, based on the value of input parameters. Function rules are grouped into libraries. The name of the library is part of the formal name of each member function.

    library A named collection of function rules, typically all relating to one general theme, such as calendar dates.

    local variables A named text value, number or date that is used only temporarilyduring the execution of an activity. When the activity completes, the local var

    iables are no longer defined.

    method One of about 70 atomic operations that can happen in a single activity step. For example, the Property-Set method updates the value of one or more properties. The Obj-Open method retrieves a single row of a table in the PegaRULES database and converts it to a clipboard page or pages.

    parameter An input value to a specific execution of an activity that can affectthe behavior and operation of the activity. For example, if an activity is designed to change the status of a work item, one of the input parameters is the keyof the work item. (Other parameter values can be "return" values, available to acalling activity after the called activity completes.)

    page A named, structured collection of property name and property value pairs. The clipboard is a collection of named pages, organized into a tree structure.

  • 8/6/2019 Peg a Basic

    3/3

    primary page A clipboard page that is the default page for the operations of anactivity. While one activity may update multiple pages, if no page is explicitlyidentified in a step, the method in the step typically operates on the primary

    page.

    Tracer tool An interactive debugging tool that lets you display each step of activity execution, pause or restart execution, and display clipboard values.

    Additional Information

    Methods and instructions by function June, 2010

    Ten Guardrails to Success January, 2009

    How to use multistep loops and nested loops in activities March, 2009

    Comparing the Obj-List-View, Obj-Browse and Obj-List methods February, 2009

    How to extract a DateTime value to a Date or Time of Day value February, 2007

    Process Commander for Java developers - Concepts and terms June, 2010

    Peddi Surendra BabuLogout

    Take ActionEnter Support RequestMy Support RequestsHotfix Self-ServiceCreate Application ProfileEnroll in a Course

    Print this PageEmail this Page