Adding a CREATE entity action is part of creating entity actions in the Action Diagram. In addition to the CREATE entity action, the following list contains other actions you can specify when creating entity actions:
The CREATE entity action records information about entities once they are of interest to the business. CREATE establishes an entity occurrence. To CREATE an entity occurrence, you must have an entity action view for the entity type. When you CREATE an entity, you must assign values to the identifying attributes. All basic and designed attributes should have either a value explicitly SET or a default value defined.
A complete CREATE action statement is as follows:
CREATE entity-view-1 [SET attribute-view-1 TO expression ]... [ASSOCIATE WITH entity-view-2 WHICH relationship IT]... WHEN SUCCESSFUL action-statement-list WHEN ALREADY EXISTS action-statement-list
When you add a CREATE action, CA Gen gives you the choice to automatically generate SET actions. A SET action assigns a value to an individual attribute view. You have the following options when adding the CREATE entity action:
When you set all attributes, CA Gen generates SET statements for mandatory and optional attributes. SET statements are not generated for auto number or derived attributes.
Consistency check will detect and report if the mandatory attribute is not set.
CA Gen also generates the ASSOCIATE actions for all identifying relationships. ASSOCIATE establishes a pairing along a relationship between two entities. You can ASSOCIATE entities when the relationship is optional; you must ASSOCIATE them (before the end of the elementary process) when the relationship is mandatory.
If you elect not to SET attributes and generate ASSOCIATE statements for the CREATE action, you must add SET statements that assign a value to all mandatory attributes and any other attributes. You must also add ASSOCIATE statements to allow pairings to be established for identifying relationships.
A complete CREATE action statement with SET and ASSOCIATE statements is shown in this example.
CREATE received product SET code to "RECD" ASSOCIATE WITH processing warehouse WHICH holds IT
In the READ Action Statement example below, the logic creates an ORDER after a READ action verifies the prior existence of a CUSTOMER. In this example, the create only occurs if the READ of CUSTOMER was successful (that is, if a CUSTOMER with the correct value for its name attribute already exists). The business algorithm order number calculation is assumed to return the value of the next available ORDER Number. In the ASSOCIATE clause, CUSTOMER is the unnamed entity action view into which information about the requesting CUSTOMER entity is placed as a result of the READ action.
READ customer WHERE DESIRED customer name IS EQUAL TO requesting customer name WHEN successful CREATE order SET number USING order number calculation ASSOCIATE number with customer WHICH places IT
|
Copyright © 2014 CA.
All rights reserved.
|
|