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.
- More than 1 if-condition diagnosis under 1 table loop:loop interface_table:create dataviewdraw interface & neighborif (status is down)diagnosis message (alert)if (ipaddress is empty)add the interface to a dedicate list
- Loop list under if-condition: If(Down_Device_List is not empty)
- Loop table under Switch-case: loop interface_table:
- Define diagnosis action directly without loop or if-condition:
Compare_Table_Logic(ospf_neighbor_table, current, baseline); - More complex flows:Loop table1Loop table 2If-then…If(…) ThenIf(…) ThenLoop()…
loop Down_Device_List for each element $down_device:
draw $down_device
diagnosis message (alert)
switch (status):
case “down”:
diagnosis message (alert)
case “up”:
diagnosis message (success)
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.
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:
Node | UI |
Loop | ![]() |
If | ![]() |
Elseif | ![]() |
Else | ![]() |
Switch | ![]() |
Case | ![]() |
Default | ![]() |
Logic | Logic nodes such as Draw Map, Diagnosis Message, Export CSV, Follow-up Intent, etc,. |
- 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.
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.
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.
The order of nodes inside a block can also be adjusted as follows.