R12.1-JA-2025June05

Flexible Action Flow Inside Diagnosis

You can define flexible action flow inside the diagnosis.

Flexible programming flow enables you to define multiple sequential logic blocks or incorporate one logic block in another (e.g., multiple if-then blocks in a loop table block). In a diagnosis:

  • It can be various flexible combinations of diagnosis logic block, statement, and control logic block.
  • It can have a ‘defining local variable’ statement, or you can directly add various logics such as draw device, output diagnosis message, etc.
  • It can be assembled by various control logic blocks, such as loop table/list, if-then-else, and switch-case.
  • The diagnosis logic can also be defined directly and not placed in any of the above control logic blocks.

Example: You can define several logics in a loop, and then define 2 parallel ‘if-then’ statements. The sample codes are as follows.

  1. More than 1 if-condition diagnosis under 1 table loop:
    loop interface_table:
         create dataview
         draw interface & neighbor
         if (status is down)
               diagnosis message (alert)
         if (ipaddress is empty)
               add the interface to a dedicate list

  2. Loop list under if-condition:
  3. If(Down_Device_List is not empty)
          loop Down_Device_List for each element $down_device:
            draw $down_device
            diagnosis message (alert)
  4. Loop table under Switch-case:
  5. loop interface_table:
           switch (status):
              case “down”:
                 diagnosis message (alert)
              case “up”:
                 diagnosis message (success)
  6. Define diagnosis action directly without loop or if-condition:
    Compare_Table_Logic(ospf_neighbor_table, current, baseline);
  7. More complex flows:
    Loop table1
       Loop table 2
           If-then…
    If(…) Then
       If(…) Then
           Loop()…

Define Flexible Programming Flow

With the ‘Add Loop’, ‘Add If-then’, and ‘Add Action’ buttons in the diagnosis, you can add parallel nodes to the end of the current diagnosis.

A screenshot of a computer

Description automatically generated

With these three buttons by hovering on each node, you can add child nodes to the current node.

All diagnosis nodes are listed as follows:

NodeUI
Loop
If
Elseif
Else
Switch
Case
Default
LogicLogic nodes such as Draw Map, Diagnosis Message, Export CSV, Follow-up Intent, etc,.
These diagnosis nodes have three states:
  • Current: There is only one current node in a diagnosis at the same time. Clicking a diagnosis node can set it as the Current node, and the previous Current node will be reset to Normal status.
    Information Note: Open a diagnosis and the last node will be automatically set as the Current node.
  • Focus: Hovering over a node by mouse can set it as the Focus node, which will be highlighted with dark blue.
    Information Note: The Current state has a higher priority than the Focus state. If the mouse hovers over a Current node, it is still regarded as the Current state.
  • Normal: A node that is neither a Current node nor a Focus node will be categorized into Normal node.

When a node is in the Current or Focus state, you can add child nodes to this node by adding the corresponding actions.

Additionally, you can manually adjust the following execution order of logic nodes and action nodes in a diagnosis in the NI Editor.
For Example: There are 2 parallel ‘if-then’ blocks in a loop. The order of the two statements can be adjusted.
A screenshot of a computer

Description automatically generated
The order of nodes inside a block can also be adjusted as follows.