Previous Topic: Execute a Command Using a FlowNext Topic: Flows Between CA Gen Business Systems


Pass Data Through a Flow

It is possible and often useful to send data between procedure steps along a dialog flow. For example, consider the online Take Order procedure in the illustration Annotated Dialog Flow Diagram in Example From MENU Procedure.

The illustration shows two procedure steps, Add Order Header and Add Order Items. Assume that the Order Number is assigned in the Add Header procedure step. The ability to pass its value from Add Header to Add Lines eliminates the need for the user to retype it when Add Lines starts.

The Dialog Flow Diagram in the following illustration represents a slightly more complex example, Airline Reservation System Fragment.

Airline Reservation System Fragment

The Check Reservation online procedure is intended to show the flight on which a particular passenger is booked.

The Locate Passenger procedure, given a passenger name, such as Smith, attempts to find it, and list all names like Smiff, Smithe, or Smythe with which it might be confused.

If Check Reservation fails because it cannot find the passenger's name, Locate Passenger is invoked to resolve a possible misspelling.

In this case, sending the passenger's name along the dialog flow from Check Reservation to Locate Passenger frees the user from having to retype the name when Locate Passenger is invoked.

Likewise, after Locate Passenger identifies the correct passenger name, sending it back to Check Reservation over the link's return executes Check Reservation again without additional user intervention. It is not necessary for the course procedure step to store data values for later use by the destination procedure step.

These examples demonstrate that passing data between procedure steps can improve system flow, simplify dialog interactions, and reduce the chance for error.

Data can pass over both transfers and links from the source of the flow to its destination. Any data in the source procedure step's export data view can be passed to the destination procedure's import data view, as long as the views are compatible.

Links can also return data from the destination of the link to its source. Any data in the destination's export data view can be passed to the source procedure step's import data view, as long as the views are compatible. Remember that during a return from a link, the source procedure step's import view is populated from the export view of its previous execution. However, any data returned from the destination to the source procedure step overlays the corresponding elements of that step's import view.

For example, consider the illustration Airline Reservation System Fragment again. For this example, assume that the following points:

When Check Reservation links to Locate Passenger, the following takes place, assuming an Execute First dialog flow:

  1. The export view from Check Reservation is saved, including the name John Doe.
  2. The appropriate elements of the export view are placed in the import view of Locate Passenger. In this case the import view receives the passenger's name, John Doe.
  3. Locate Passenger begins execution, looking for names that are similar to John Doe. In its export view, it returns Shawn Toe, Jon Deaux, and John Dough.

The user may now select from these possibilities to identify the correct passenger. If John Dough is the correct choice, the following takes place when Locate Passenger returns to Check Reservation (assuming that the return has a flow action of Execute First):

  1. The import view of Check Reservation is populated from its saved export view. John Doe appears as the passenger name.
  2. The appropriate elements of the export view of Locate Passenger are then used to overlay the import view of Check Reservation. John Dough replaces John Doe as the passenger name.
  3. Check Reservation executes. This time, the procedure finds the passenger John Dough and displays the list of flights reserved for him.