You should address all possible termination conditions for the procedure step's synthesized Procedure Action Diagram.
The following sample code is an example of a procedure step's action diagram immediately after transformation.
Note: Exit State is never set, even for the condition of an invalid command.
Procedure Action Diagram for MAINTAIN CUSTOMER
MAINTAIN CUSTOMER
IMPORTS: Entity Viewimport customer
EXPORTS: Entity Viewexport customer
CASE OF COMMAND
CASE delete
USE delete_customer
WHICH IMPORTS: Entity Viewimport customer
WHICH EXPORTS: Entity Viewexport customer
CASE add
USE add_new_customer
WHICH IMPORTS: Entity Viewimport customer
WHICH EXPORTS: Entity Viewexport customer
OTHERWISE
The following sample code shows the same Procedure Action Diagram after the designer has addressed termination conditions.
Procedure Action Diagram With Exit State Is Actions
MAINTAIN CUSTOMER
IMPORTS: Entity Viewimport customer
EXPORTS: Entity Viewexport customer
EXIT STATE IS requested_operation_complete
CASE OF COMMAND
CASE delete
USE delete_customer
WHICH IMPORTS: Entity Viewimport customer
WHICH EXPORTS: Entity Viewexport customer
CASE add
USE add_new_customer
WHICH IMPORTS: Entity Viewimport customer
WHICH EXPORTS: Entity Viewexport customer
OTHERWISE
EXIT STATE IS invalid_command
This example raises the following two issues:
In this example, the designer has assumed that positive conditions are not addressed in the used action blocks, and has therefore initialized Exit State to the positive condition here, to avoid handling exception conditions throughout the remainder of the procedure step logic.
If Exit State is never set to a different value as the result of an exception, the positive condition will remain set. This design approach may not be safe if you cannot guarantee correct handling of all exception conditions that may arise. For example, can you be sure that all exceptions will be handled correctly after the action blocks are subsequently modified.
The EXIT STATE IS action added at line 15 is a typical case of setting Exit State for an exception.
It is essential that all action diagrams are compatible with the exception handling of any USEd action blocks, and that exception conditions are handled completely and safely. You should modify all parts of synthesized logic so that they remain compatible with any system components with which they interact.
|
Copyright © 2013 CA.
All rights reserved.
|
|