ALL ABOUT METHODS (ACTIVITY)
Updated: Feb 5, 2020
An activity is the fundamental sequential processing unit of the Process Commander system in Pega. Methods are individual operations that are performed in each step of an activity. This section provides the usage information on some of the most used methods.
1. Property-Set :
Use the Property-Set method to set the value of one or more properties.
Specify the property in the PropertiesName field, and the desired value in the PropertiesValue field.
The Call method instructs the current activity to find and run another activity using Rule Resolution. After the called activity completes, the calling activity resumes processing. The called activity can use its own parameter page, or share the parameter page of the calling activity.
Similar to the Call method, the Branch method refers to another activity. Execution of the original activity ends when execution of the branched activity is complete.
The Obj-Browse method searches instances of one class and copies specified properties onto the clipboard, creating a list of instances, each on an embedded page.
The Obj-Open method returns a single instance stored in the PegaRULES database, or in an external database table that is linked to an external class. The returned instance is then converted to a clipboard page. This method differs from the Obj-Browse method by not allowing you to define search criteria; you must identify the key of the instance.
The Page-Copy method replicates the entire contents (all properties and embedded properties) of an existing clipboard page to a new or existing clipboard page.
The Page-Remove method deletes one or more named pages from the clipboard.
To remove a page, enter one ore more pages in the Page field, or enter the page in the Step Page field.
The Show-Page method sends an XML representation of the current page (as specified in the Step Page field) to your browser window. This method is primarily used for debugging.
Use the Activity-End method to cause the system to End the current activity and all calling activities.
The Exit-Activity method ends the current activity and returns control to the calling activity.
The Page-New method is used to create a page on the clipboard. The new page may be a top-level page or an embedded page.
Use the Page-Set-Messages method to add a message to a clipboard page. Like a message associated with a property, a message associated with a page normally prevents the page from being saved into the database.
The property-set-message method is used 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. We can provide the entire literal text of the message, or reference a message rule key that in turn contains message text. (Rule-Message rule type).
Use the Property-Map-DecisionTable method to evaluate a decision table rule and save the result as the value of a property.
The Property-Map-DecisionTree method is used to evaluate a decision tree rule (Rule-Declare-DecisionTree rule type) and store the result as the value of a property.
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.
Property-Remove method is used to delete a property or properties and its associated value from the step page or another specified page. This does not affect the property rule, its definition.
The Show-HTML method is used to cause the activity to process an HTML rule and send the resulting HTML to a user for display by Internet Explorer. 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.
The obj-list method is used to retrieve data to the clipboard as an array of embedded pages. This method creates one embedded page for each instance retrieved. The Obj-List-View method often produces more efficient SQL statements and provide better performance than the Obj-List method.
The obj-list-view method is used 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.
Use the Obj-Open-By-Handle method only if we can determine the unique handle that permanently identifies which instance to open. Otherwise, use the Obj-Open method.
The obj-delete method is used to delete a database instance corresponding to a clipboard page and optionally to delete the clipboard page too. We can cause the deletion to occur immediately, or until execution of a Commit method.
We can reverse or cancel a previously executed Obj-Delete method by using the Obj-Save-Cancel method.
The obj-save method is used to save a clipboard page to the PegaRULES database or if the page belongs to an external class save a clipboard page to 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.
Commit method is used 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).
The obj-validate method is used to apply a validate rule (Rule-Obj-Validate rule type) for the object identified on the primary page or step page. A validate rule (Rule-Obj-Validate rule type) can call edit to validate rules (Rule-Edit-Validate rule type).
Obj-Sort method is used to sort the clipboard pages that are the values of a property of mode Page List. We can specify one or more properties to sort on, and whether the sort sequence is ascending or descending for each sort level.
HAPPY LEARNING !!!