Previous Topic: Review Generated PAD for READNext Topic: Review Generated PAD for DELETE


Review Generated PAD for UPDATE

The generated update Action Diagram reads and then modifies each occurrence of the subject entity type. The diagram also reads each related entity type that you have specified.

TRANSFER statements appear for transferable relationships if you have selected this option during Process Synthesis.

If you have indicated disassociate for related entity types, READ EACH statements are generated for each entity type involved in relationships with the subject entity type where the destination has a cardinality of many. All occurrences will then be disassociated.

The following example shows the generated Process Action Diagram for UPDATE CUSTOMER.

The following example is an UPDATE CUSTOMER Generated Process Action Diagram:

UPDATE_CUSTOMER
IMPORTS: Entity View import customer
EXPORTS: Entity View export customer
LOCAL
ENTITY ACTIONS: Entity View customer
READ customer
WHERE DESIRED customer number IS EQUAL TO input
customer number
WHEN successful
UPDATE customer
SET name TO input customer name
SET address TO input customer address
SET city TO input customer city
SET state TO input customer state
SET zip TO input customer zip
WHEN successful
MOVE customer TO output customer
WHEN not unique
WHEN not found

Import, export, and entity action views are views of the subject entity type in this example.

The MOVE statement after the exception logic WHEN successful executes only if the read succeeds. By moving import to export after execution of the process, the keyed input displays as output on the original screen only if the process succeeds.

The READ statement selects the correct subject entity type by its identifying attribute or attributes.

The update action has two branches for exception logic: WHEN successful and WHEN not unique. The UPDATE action statements follow the WHEN successful branch of the READ statement.

Action statements following the WHEN not unique branch are not populated. You need to add them to specify what logic occurs if the subject entity type is found to have the same identifier as another entity type.

After the WHEN not found branch of the read, specify what to do if the specific occurrence of the subject entity type does not exist.