Create operation

The create operation creates new instances of a given class. A navigation or data flow may be used to provide initialization data for the new instance. Usually, the initialization data are obtained from a form based on the same class. A flow from the form to the create operation passes the values for all necessary attributes except for the OID, which is generated automatically by the create operation. For example, Figure 12.55 shows a structure for creating instances of Book.

Figure 12.56 shows the rendering of the form that is the origin of the flow to the create operation. The flow is rendered as the Save button.

As we can see, the user may type in the form the initialization values for the new book. The flow from the form binds the data and takes the data to the create operation. The create operation then creates the new instance and defines its attributes with the values received from the flow.

If the operation is successful, then the OK flow is followed to a details component that shows the newly created book. The OK flow binds automatically the OID of the new book so that the conditional expression at the details may be used to define which book to present.

If the operation fails, the control goes to an error page following the KO flow.

< Prev   CONTENTS   Source   Next >