Page History
...
The main tagged value provided by the <<PersistentStateAdapter>> stereotype used throughout this chapter is action. It describes the adapter functionality to be invoked. Currently the following actions are supported:
After an object has been created, the only way to influence its behavior is to send signals targeted at this object. These actions are described in detail on Sending Persistent State Signals.
...
Find a list of all persistent state error codes on System Errors of the Persistent State Adapter.
Error Code | Description |
---|---|
PSADSM/12 | Requested persistent object does not exist. |
Retrieving Multiple Object Handles
...
The <<PersistentStateAdapter>> action getObjectCopy returns a copy of a given persisted object. As input, the action requires an object handle.
Note | ||
---|---|---|
| ||
Please note, that the output of this adapter action, even though an instance of the persistent state class, is only a snapshot of the persisted object. Any changes to the |
...
returned object or to the persisted objects will have no influence on each other. |
Runtime 2019.8 Builder 7.6.0 If you have defined the persistent state class as to have external attributes (see Persistent State Classes > External Persistent Data), these attributes will only be loaded to the object copy, if you set tag withExternals to true on the adapter action.
In the following example, a list of object handles to PurchaseOrders PurchaseOrders newer than a given date and in the state "Checked out, waiting for closing" is retrieved. Then it iterates over the array of object handles to retrieve a copy of the content of each PurchaseOrder object.
Figure: Getting Copies of Persisted State Objects (Activity Diagram Get Purchase Orders by Date)
Getting State Info
Loading External Persistent State Data
Runtime 2019.8 Builder 7.6.0 You can define persistent state attributes as to be external (see Persistent State Classes > External Persistent Data), so their content will only be loaded on demand. This applies to getObjectCopy as well as to the self context within persistent state transactions.
To load the externally stored data in self context, you need to call the <<PersistentStateAdapter>> with action loadExternals.
Note | ||
---|---|---|
| ||
If you change external attributes in self context, they will be stored at the end of the transaction. This applies only if they have been loaded before. |
Multiexcerpt include | ||||||
---|---|---|---|---|---|---|
|
Getting State Info
Note | ||
---|---|---|
| ||
Deprecated This function is deprecated. Please use the Persistent State Control Adapter instead, esp. queryObjects(). |
The <<PersistentStateAdapter>> action getStateInfo returns information about the current state(s) of an object.
A persisted object can be in multiple states at once. The obvious case occurs when using fork to split the process flow into parallel execution. The other, non-obvious but more common case is the use of composite states. When inside a subflowsub-flow, the persisted object actually is in two states: the current state inside the subflow sub-flow and in the enclosing parent state.
Output of getStateInfo is an Array containing elements of type StateInfo:
Attribute | Description | Example | |
---|---|---|---|
id | Name of the state. | Purchase_order_is_initialized__waiting_for_further_orders | |
type | Type of the state, see States for more information. | One of: STATE , FORK , JOIN , CHOICE , ENTRY , EXIT , COMPOSITE , SUBMACHINE , ORTHOGONAL , HISTORY , INITIAL | |
entryTime | Time object entered the state. | 2019-09-16T09:00:06.0Z | |
token | Internal id. | ||
parentToken | Internal id. |
Committing Changes to the Persistent State Database
...