Previous Topic: Refine Synthesized Procedure Action DiagramsNext Topic: Dynamically Modifying Video Properties in Online Procedures


Handle Termination Conditions

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:

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.