Logic Loop

This diagram element is used to perform an operation on an object repeatedly until a certain condition is met.

Diagram Element

Parameter Description

  • Node Name: name of a node.
  • Description: details of a node.
  • Counter: flow variable that stores the number of elements in a list.
  • Loops: objects to be traversed. Generally, the object list is the value obtained by the previous node, for example, the customer list obtained by a stored procedure.
  • Loop Object: flow variable that stores the value of the object obtained each time when the object list is traversed.

In addition to four variables, the Logic Loop diagram element provides two default branches: inLoop and outLoop. The inLoop branch executes the logic when a loop is entered, that is, some actions during object list traversal. The outLoop branch executes the actions after object list traversal.

Condition Branch Description

Table 1 Condition branch description

Condition Branch

Description

Usage

inLoop

Loop list traversing

Triggered when the loop list traversing is not completed.

outLoop

Completed loop list traversing

Triggered when the loop list traversing is completed.

SYSERROR_INNER

ODFS internal error

Triggered when an unknown error occurs in the ODFS. If no option is selected, the flow goes to the exception handling flow.

Using the Diagram Element

The Logic Loop diagram element is used when an operation needs to be performed repeatedly until a certain condition is met.

Click the diagram element or drag it to the canvas, and set loop conditions and objects.

Typical Application Scenario

The following describes how to use the Logic Loop diagram element to combine strings using a loop.

  1. Sign in to the AICC and choose Configuration Center > Flow Configuration > Intelligent IVR.
  2. Configure an intelligent IVR flow.

    1. Choose Flow > Orchestration and click New to add a simple flow.
    2. Click + in the Flow Variable area. In the dialog box that is displayed, set the variable name and data type.
      Figure 1 Flow variables to be added
      Figure 2 Flow orchestration example (Logic Loop diagram element)
      • The Robot Reply diagram element of the inLoop condition branch traverses FLOW.list and outputs the values in FLOW.list.
      • The Robot Reply diagram element of the outLoop condition branch outputs FLOW.out, indicating that the loop ends.
    3. Save and publish the flow.

  3. Choose Intelligent Chatbot and bind the flow to a robot.
  4. Choose Intelligent Chatbot. In the last column corresponding to the robot, click Test Call.

    In the test dialog box that is displayed, click Start Call to test the robot. If the robot outputs the combined string after the strings in the list are combined, the configuration is successful.
    Figure 3 Testing the robot