Back Forward Obj-Open method

Methods and instructions by function

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.

The system uses the specified class and key fields to find and open the object and place its data into the specified step page. The system searches up the class hierarchy as appropriate to find the instance. If it finds the specified step page, the system clears any data that is on it and reuses the page. If no existing page has a name matching the specified step page, the system creates a new page.

CautionExcept in rare cases, identify in the Step Page field the name of a page to be created by this method. If the Step Page field of the step is blank, this method opens the object into the primary page of the current activity, replacing the current contents of the primary page and changing the class of the primary page if necessary to match the class of the object. Typically, this is not desirable. OLSOK 11/1/06 OSMAE

Parameters

This method has four base parameters plus an array of property names and values. BUG-1006

Parameter

Description

OpenClass

SmartPromptOptional. Identify the concrete class of the instance to be opened. If left blank, the class is obtained from the Pages & Classes tab of the activity based on the property references in the parameter array. B-19177B-14192 B-21369 validation

CautionYou can't open an instance of a class that corresponds to a view in the PegaRULES database (rather than a table).

Lock

Select this box to acquire a lock. Lock the instance if you plan to change and save the instance or delete it.

Your session cannot lock the object unless your access role includes the ability to update objects of the class. R-17476

Locking an object from an external class prevents updates by other requestors in the Process Commander system. Such locking does not prevent changes to the external database   — including changes to a row open and locked in Process Commander — by other systems. GENTJ 03/17/05DELETED If you do not check this box, the page is marked read-only. Attempts to update the value of properties on the page can cause a Java exception (unless the prconfig.xml setting fulltransaction is set to "no".)C-1804 R-19627

ReleaseonCommit

Select this box if you selected the Lock box and want the system to release the lock when the next Commit method occurs for this instance.

In most cases, select this box if you selected the Lock box. In the unusual case that you want to retain the lock after Commit (perhaps because additional changes are expected), your activity can later use the Page-Unlock method to release the lock.

LockInfoPage

Optional. As a debugging aid, identify the name of a page to be created by this method to hold the results of the locking attempt, when it fails. GAGNJ 04-02-41The page, of class System-Locks, contains the following properties:

  • pxOwnerID — Requestor who holds the lock
  • pxExpireDateTime — Date and time the lock will go soft
  • pxUpdateOperatorpyUserIdentifier value for the requestor who holds the lock
  • pxLockHandle — Text string that defines the lock

If the Obj-Open fails to acquire a lock, this page is created and can be viewed with the Clipboard tool or the Tracer. BUG-6144

MARIK TURBT 2/24/06 By convention, this page is named LockInfo in standard rules. When a lock failure occurs during a flow execution, the flow can display the standard harness rule Work-.LockInfo (or a similar harness rule incorporating the standard section rule System-Locks.LockInfo) to report the situation. If the lock requested but not acquired is held by the same Operator ID in a separate requestor session, that user can click the  Release Lock    button to release the lock.

PropertyName

SmartPrompt Enter in this array the name of each property or properties and the associated values that together make up the key of the instance to be opened. Type a period before the property name. Enter at least one property name. B-19177

Review the Basics  tab of the Class form for the class (or of superclasses of this class) to determine which properties form the key.

NoteWhen acquiring a lock, include the properties that make up the lock key when they differ from the properties that make up the instance key. (This is rare.) Information about the properties that make up locks is on the  Locking  tab of the Class form (or in some cases on the Class Group form).

PropertyValue

SmartPromptFor the value, specify either a literal value or a property reference.

Results

The system computes a pzInsKey value by concatenating the property values identified in the Keys definition on the Basic tab of the class rule. C-1854 If the OpenClass parameter identifies an external class, the system sets the value of the pxObjClass property on the clipboard to the class name.

If the step page does not exist, a new page is created. SDAS/OLSOK 12/05/05 and SR-210 and B-15556 rejected (The pxObjClass property, part of every instance, identifies its class.) If the Step Page field is blank, the system clears and reuses the primary page of the activity.

It reads the persistent object instance from the database and adds all properties of the object to the step page.

If the Lock checkbox is selected and the requestor has permission to update objects of this class, the system locks the instance.

The step page may be an embedded page, or one page in a list or group. In these cases, the page, if it exists, is replaced completely. For example, if the page is seventh in a Page List, or “Customer” in a Page Group, your application can still reference the page as "7" or “Customer” after the replacement.

To avoid overwriting an existing page

R-8710 You may want an activity to check whether a page of a certain name exists before you open a new page.

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.

Fail and Warn conditions

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

Checking the method status

This method updates the pxMethodStatus property. See How to test method results using a transition.

The Activity-Clear-Status method may be useful following an Obj-Open method. VAGUE

Restrictions

B-11491 This method cannot be used in a step that involves iteration.

Definitions external class, internal class
Related topics Activity-Clear-Status method
Page-Unlock method
Obj-Refresh-and-Lock method

UpMethods and instructions by function