...
Note |
---|
|
If errors occur in the context of the activity diagram, they must be handled, otherwise, all persistent state actions, including create, are rolled back Anchor |
---|
| 6_advanced_behavioral_modeling_p_9449 | 6_advanced_behavioral_modeling_p_9449 | .
Related Error Codes
Find a list of all persistent state error codes on System Errors of the Persistent State Adapter.
Error Code | Description |
---|
PSADSM/5 | A persistent object with the same primary key already exists. |
Retrieving Object Handle
After creation, an object handle represents a persistent state object. With these handles, it is possible to retrieve information about and to send signals to the represented objects.
While a handle is returned by the create action and can be passed as parameter in and out of operations and services, it is also possible to retrieve a handle for an object specified by its primary key and class.
A <<PersistentStateAdapter>> instance with action set to getObjectHandle is used to implement this functionality.
The compulsory tagged value class defines what kind of object to look for. This class always has to be of stereotype <<PersistentState>>. A reference to it will also be stored in the attribute classifier of the returned handle.
As input, the persistent state adapter requires all primary keys as defined in the given class. In our example, the attributes id and customerID have the stereotype PrimaryKey and identify a persistent state object unambiguously (see class diagram in figure A Persistent State Class ). The input object flow states purchaseOrderID respectively customerID are mapped to these attributes.
Info |
---|
|
If the result set is not unique, or no persistent state object could be found, an error will be thrown that should be handled. ( This is not done in this example. For more information about error handling, see section Modeling Error Handling). |
If no error occurs, the result is returned in an object of type Handle.
...
Info |
---|
|
The object state poHandle is of complex type Handle. This class is located in the Persistent State module in package Data / Persistent State / Services / Objects. |
Related Error Codes
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
...