A While node has associated with it a flow that the While node invokes at runtime when the loop expression in the While node evaluates to Boolean true (see Basic information about While nodes).
When you record a loop during flow recording, the flow recorder (host editor) automatically generates a flow path in the invoked flow. The flow path consists of nodes that manage the application screens that occur during one iteration of the While loop. You can further customize this flow to meet your requirements.
In this subtopic you will open the invoked flow and arrange the nodes in it:

The flow editor opens and displays the invoked flow.
On the flow editor canvas, right-click over any empty part of the canvas and click Zoom Out. (You may need to Zoom Out twice to see all the nodes.)
Save your work (Ctrl-S).
Do not close the flow editor yet. You will use it in the next subtopic.
In this section you will add a Switch node and an Assign node to the invoked flow. These nodes operate as follows:
To add the Switch node:
To add the Assign node:
In this section you will add an ESQL expression to the new Switch node to compare the item number passed as an input parameter to the flow CheckItemAvailability.seqflow with the item numbers extracted from a page of the Inquire Catalog application screen by the Extract actions.
To add the logic:
Edit the ESQL expression for the first (uppermost) output terminal of the Switch node:
Click . The Edit Expression window opens. (The Messages in scope list and the Expression input field are blank.)
In the Edit Expression window:
The message v_CheckItemAvailability is added to the scope.
Add an ESQL expression to the expression input field:
Copy the expression shown in Figure 3 into the expression input field at the bottom of the Edit Expression window. You should be able to copy and paste the lines from this tutorial document directly into the input field of the window.
(i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ1-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ2-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ3-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ4-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ5-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ6-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ7-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ8-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ9-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ10-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ11-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ12-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ13-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ14-ITEMREF") OR (i_CheckItemAvailability.itemNumber = v_CheckItemAvailability."INQ15-ITEMREF")
The expression compares the variable i_CheckItemAvailability.itemNumber (which is of type xsd:string) with each of the item numbers (also of type xsd:string), which the Extraction actions read from the fields in the first column of the Inquire Catalog application screen.
If a match is found then the ESQL expression resolves to Boolean true, otherwise the ESQL expression resolves to Boolean false.
If the ESQL expression resolves to true then the flow of control goes out of the Switch node through the first output terminal, which is connected to the Assign node Assign.
If the ESQL expression resolves to false then the flow of control goes out of the Switch node through the default (bottommost) output terminal, which is connected to the Assign node loopend_variable0.
Click OK to close the Edit Expression window.
Save your work (Ctrl-S).
In this section you will add two mappings to the mapping routine of the new Assign node named Assign in the invoked flow. (Recall that mappings allow you to retrieve, manipulate, and store data in a flow – see Mapping concepts.)
As stated earlier this Assign node is connected in the flow so that it is performed only when the requested item number is found.
You will add two mappings to the mapping routine of this Assign node that perform the following tasks:
Assign the string YES to v_CheckItemAvailability.available to indicate that an item number matching the input item number has been found.
Assign the string FALSE to v_CheckItemAvailability.variable0 to terminate the While loop. (This variable is the loop-control variable for the While loop.)
To create these two mappings:
Open the mapping routine of the Assign node named Assign in the mapping editor:
Right-click the Assign node named Assign.
Click Open Mapping Routine.
The mapping editor opens the mapping file for the flow, automatically creates an empty mapping routine for the Assign node, and displays the mapping routine in the mapping routine area of the mapping editor.
Add the message v_CheckItemAvailability to the mapping routine as a target message. (Actually, a reference to this message is added to the mapping routine.)
On the mapping routine toolbar, click the Add
a target message
icon. The Select Message window
opens.
Click the message .
Click OK.
The target message is added to the right side of the mapping routine area.
The actual message still resides in its place within the message file that it belongs to. When you delete a source message or a target message from a mapping routine, the mapping editor deletes the reference. The actual message in the message file not deleted.
Create a mapping that stores the string YES into the target element v_CheckItemAvailability.available:
Click Create Transform:
The mapping editor displays a new Assign transform in the center area of the mapping routine beside the message element available with a connection running from the Assign transform to the message element available.Open the Properties view of the mapping editor if it is not already open (see Opening or reopening a view).
In the editor view of the mapping editor, click the Assign transform. The mapping editor displays the properties of the selected transform in the Properties view.
The new mapping is now configured to store the string YES into v_CheckItemAvailability.available.
Create a mapping that stores the string FALSE into the message element v_CheckItemAvailability.variable0:
Click Create Transform:
The mapping editor displays a new Assign transform in the center area of the mapping routine beside the message element variable0 with a connection running from the Assign transform to the message element variable0.
Open the Properties view of the mapping editor if it is not already open (see Opening or reopening a view).
In the editor view of the mapping editor, click the new Assign transform. The mapping editor displays the properties of the selected transform in the Properties view.
The new mapping is now configured to store the string FALSE into v_CheckItemAvailability.variable0.
Close the mapping editor.
The flow editor displays the nodes of the invoked flow. To close the invoked flow:
Close the flow editor.