All Obj Methods
All Obj Methods
All Obj Methods
Commit
Obj-Browse
Obj-Delete
Obj-Delete-By-Handle
Obj-Filter
Obj-List
Obj-List-View
Obj-Open
Obj-Open-by-Handle
Obj-Refresh-and-Lock
Obj-Save
Obj-Save-Cancel
Obj-Sort
Obj-Validate
Rollback
Obj-Browse:
Use the Obj-Browse method to search instances of one class and copy the
entire instances, or specified properties, to the clipboard as an array of
embedded pages.
this method, the properties that are not exposed as columns can be
returned, but not used for selection criteria.
The Obj-Browse method has five base parameters and an optional array of
selection criteria.
ObjClass: Identify a class to search. You can search one concrete class, or
all classes in a class group.
1|Page
All OBJ Methods
(Why database view also Because we can’t provide lock for the
instance)
GetRowKey: Select to include the primary key in the set of property values
returned. Clear to exclude the primary key. (Selected by default.)
Leave unselected if you have the plan to update the embedded pages.
Note: Selecting this Read-only checkbox does not affect your ability to
remove an embedded page completely (with the Obj-Filter or Page-Remove
method).
Logic: Optional. Enter a boolean statement that defines how the rows of the
parameter array are to be combined. Identify rows by the Label field. You
can use the operators AND and OR in this statement, and parentheses for
grouping.
If you leave this blank, the system applies the AND operation to all the rows
of the array.
The below parameters of the array are optional. The rows of this array to
define the selection criteria and the properties to be returned.
Label: Enter a unique letter for this row, referenced in the Logic field.
2|Page
All OBJ Methods
Select: Select to return the value of this property on each embedded page.
In the resulting SQL statement, this property is listed in the SELECT list (as
well as the WHERE condition).
Field: Enter a property reference. You can specify a Single Value property, a
list or group property.
Note1: only Single value properties and exposed as columns can be added
in select stmt as well as WHERE condition of that SELECT stmt.
Note 2:If single value properties are not exposed as columns those
properties will include in SELECT stmt only, not in WHERE condition.
Note 3:List and group properties also will include in SELECT stmt only, not
in WHERE condition.
Note 4: in condition field if you select Value Only even that property
specified in Field parameter is exposed will include in SELECT stmt only, not
in WHERE condition.
Select Value Only to return the value of this property , but this
property value is not to be used as a selection criterion.
3|Page
All OBJ Methods
Results
Performance
This method can return thousands of database rows and create large
clipboard pages.
4|Page
All OBJ Methods
The result for the obj-browse method, when you run this activity is shown
below.
OBJ-Open
Parameters
This method has four base parameters plus an array of property names and
values.
5|Page
All OBJ Methods
Lock: Select this box to acquire a lock. So that you can update and save and
delete the instance.
You cannot lock an object unless the Allow Locking? checkbox (on the
Locking tab of the Class form. If the class is part of a class group, the Allow
Locking? checkbox on the class named for the class group is applicable).
ReleaseonCommit: Select this box if you selected the Lock. And the system
releases the lock when the next Commit method occurs for this instance.(if
not selected after commit method execution also still the lock will be
retained.)
This page holds the like below properties. The class of this page is System-
Locks,
Results.
6|Page
All OBJ Methods
If it finds the specified step page, the system clears the data on it and
reuses the page. If page does not found for the specified step page, the
system creates a new page.
Note:
To test for a page, enter the following the precondition to the activity step:
= @PageExists("myPage", tools)
where myPage is the name of the clipboard page.
7|Page
All OBJ Methods
Obj-Open-By Handle:
A handle identifies the class, certain key parts, and the creation date and
time for a single instance. So, for a new rule the pzInsKey property has no
value until the rule instance is saved.
Parameters
Lock: Select this box to acquire a lock. So that you can update and save and
delete the instance.
8|Page
All OBJ Methods
You cannot lock an object unless the Allow Locking? checkbox (on the
Locking tab of the Class form. If the class is part of a class group, the Allow
Locking? checkbox on the class named for the class group is applicable).
Release on Commit: Select this box if you selected the Lock. And the
system releases the lock when the next Commit method occurs for this
instance.(if not selected after commit method execution also still the lock
will be retained.)
This page holds like below properties. The class of this page is System-
Locks,
Results
This method opens database and finds the unique instance using the handle.
It copies the object's properties and values into a new clipboard page.
Restrictions
9|Page
All OBJ Methods
Obj-Save method:
Unlike the Commit method, the Obj-Save method does not operate on all
objects, previously marked for commit, operates only on the current page,
and does not release locks.
Cautions
When you use the Obj-Save method in an activity with Activity Type as,
Utility, Notify, Assign, or Route, do not check the WriteNow checkbox. and in
situations where you want to mark a page to be saved, but want the system
to perform the database commit later.
Parameters
Select the box to cause the system to write this page's data to the database
(database commit) as this method executes.
WithErrors: Select this box to cause this page to be saved even when it
contains messages, indicating validation errors.
Results
First, the system examines the page's pxObjClass property to determine its
class. It uses the corresponding Rule-Obj-Class instance to find the
Database Table name.
10 | P a g e
All OBJ Methods
Properties with a null value (or equivalently "") are ignored (not saved) by
this method.
Obj-Save-Cancel:
Use this method to cancel the most recent uncommitted Obj-Save and Obj-
Delete method. So that the instance will not written or delete as part of a
later Commit operation.
You can also use Rollback method to cancel all uncommitted Obj-Save and
Obj-Delete operations, not only the most recent one.(Means Rollback will
cancel All pending Obj-Save and Obj-Delete methods).
Parameters
Commit method
Use this method to commit all uncommitted database changes that means
All pending Obj-Save and Obj-Delete methods. This method writes all the
instances specified by one or more Obj-Save methods to the PegaRULES
database (for internal classes) and to external databases (for external
classes).
Note: All locks held by the requestor Thread (except those that were
acquired with the ReleaseOnCommit box not selected in the Obj-Open
method) are released.
Rollback method
Use this method to cancel or withdraw any previous uncommitted changes
to the PegaRULES database (and to external databases accessed from an
external class). All pending Obj-Save and Obj-Delete methods are cancelled.
11 | P a g e
All OBJ Methods
Parameters
Results
Obj-Refresh-Lock :
This method is used to ensures that the contents of the step page is gets
refreshed and a lock is acquired for that object.
This method does not effect when the object is locked and the lock has
not expired.
Parameters
ReleaseonCommit: Select this box if you want the system to release the lock
when the next Commit method occurs for this instance.
If the Obj-Open fails to acquire a lock, this page is created and can be
viewed with the Clipboard tool or the Tracer.
12 | P a g e
All OBJ Methods
When a lock failure occurs during a flow execution, the flow can display
the standard harness Work-.LockInfo to report the situation.
Results
The system checks whether the object on the step page is locked and the
lock has not expired. If the lock is held, the method creates the results page
as specified in the LockInfoPage parameter, but no further processing
occurs.
Obj-Delete
This method can operate on objects of both internal classes and external
classes.
Parameters
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.
13 | P a g e
All OBJ Methods
If this box is cleared, the database instance is deleted by the next Commit
operation.
Results
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.
14 | P a g e
All OBJ Methods
Obj-Delete-By-Handle
Parameters
15 | P a g e
All OBJ Methods
Lock: Select to delete the object only if able to acquire a lock. Leave cleared
to delete the object weather lock acquired or not.(If Lock selected but the
situation, class does not allow locking or object is locked by others the
system will gets deletes the object but produces the warning. means
anyway object will gets deleted even lock not acquired due to lock)
If selected but the class does not allow locking, the Obj-Delete-By-Handle
method deletes the instance but produces a warning: Database-LockFailure-
NotSupported.(it means anyway object will gets deleted even lock not
acquired due to lock
Note:As a best practice, select this box if the object belongs to a class that
allows locking. With rare exceptions, it is not desirable to delete an object
that may be locked
ReleaseonCommit: Select this box if you selected the Lock. And the system
releases the lock when the next Commit method occurs for this instance.(if
not selected after commit method execution also still the lock will be
retained.)
If the Obj-Open fails to acquire a lock, this page is created and can be
viewed with the Clipboard tool or the Tracer.
When a lock failure occurs during a flow execution, the flow can display
the standard harness Work-.LockInfo to report the situation.
16 | P a g e
All OBJ Methods
Immediate:
Results
Next, if Immediate is selected, the method deletes the instance from the
clipboard and from the PegaRULES database. If Immediate is not selected,
the deletion operation is queued until the next Commit occurs.
OBJ-LIST Method
Parameters
The Obj-List method has four base parameters and an optional array of
selection criteria. If you omit optional parameters, the system uses values
from the specified list rule (Rule-Obj-List rule type).
ObjClass: Identify the concrete class to search. When this method references
a list rule, it uses this value as the Applies To key part to find the list rule.
17 | P a g e
All OBJ Methods
RuleObjList: Optional. Identify the name of a list rule that specifies which
properties are to be retrieved. The system uses the ObjClass parameter as
the first key part of the list rule.
If the ObjClass field identifies an external class, enter at least one Selection
Property.
Note: As a best practice for good performance, specify only Single Value
properties that correspond to exposed columns in a database table .
Leave blank when the Selection Property value for a row contains a property
reference and you want the results to include instances which contain no
value for that property.
SelectTo: Optional. Enter a literal case-sensitive end value for this property,
or a property reference.
Leave blank when the Selection Property value for a row contains a property
reference and you want the results to include instances which contain no
value of the property.
If the values in the SelectFrom and SelectTo are identical strings, PRPC uses
a LIKE SQL pattern. This selects database values that contain the string as
an initial prefix rather than as an exact match.For example, if the
SelectFrom and SelectTo values are both APE, then the database returns
rows containing APE, but also returns rows containing APERITIF, APEX, and
APERIODIC.
18 | P a g e
All OBJ Methods
syntax for the LIKE predicate, including the percent sign (%) for a wildcard
character. (If your expression contains no percent sign characters, PRPC
automatically supplies a trailing percent sign character.)
Results
This method creates one embedded page for each instance retrieved.
Performance
This method can return thousands of database rows and create large
clipboard pages.
Obj-ListView:
Parameters
ObjClass: Select the Applies To key part of a list view rule. This may identify
an internal class or class group, or an external class.
19 | P a g e
All OBJ Methods
Results
The system uses rule resolution to find the list view rule and executes it
20 | P a g e
All OBJ Methods
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 in the Content Page Name field on
the Content tab of the List View form, (The Step Page field on the step is
ignored.)
Obj-Sort method
Use this method to sort the clipboard pages based on the values of a
property of Page List(pxResults). You can specify one or more properties to
sort, and 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:
Class: Identify the class of the pages within the Page List property.
The order of your entries in this array is significant. The first property listed
is the major sort.
Descending: Select to cause the method to sort in descending order for the
property. Clear the box to sort in ascending order
Results
The system sorts (reorders) the pages of the indicated Page List property.
The rest of the clipboard is unaffected.
21 | P a g e
All OBJ Methods
Obj-Filter method
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.
For example, if each embedded page on results page contains a Page List
property Child and each Child page contains a Single Value property
FirstName, you can use the Obj-Filter method to remove all embedded
pages where no value of FirstName is "Robert".
22 | P a g e
All OBJ Methods
Parameters
ResultsClass: Select the Applies To key part of one or more when condition
rules (Rule-Obj-When) to be used to test each result. Must match or be an
ancestor class of the class of the embedded pages in the ListPage page.
Obj-Validate method
Use this method 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 validate rules
(Rule-Edit-Validate rule type).
Parameters
If blank, rule resolution begins searching for the validate rule on the class of
the step page. You can override the class of the step page with a higher or
lower class.
Results
The system uses rule resolution to find the validation rule. It then applies
the validation rule to the properties on the step page (or primary page if the
23 | P a g e
All OBJ Methods
Step Page column is blank). If any validations fail, the system adds
messages to the page.
Ordinarily, if any property fails validation, the page cannot be saved from
the clipboard into the database.
The result for the above activity is shown in the clip board page below.
24 | P a g e