Logic

Format

All logic within A-Ops takes the same simple format that follows Python in similarity.

if value (==|!=|<|>|<=|>=|in|match) value

[Examples]
if 1 == 1

if 2 < 1

if "test" in "this is a test"

if "12" match "[0-9]{2}"

if 1 == 2 or 1 == 1

if 1 == 1 and 2 == 2

if "test" in "this is a test" and 2 < 1

if (1 == 2 or 1 == 3 or 1 == 1) and 1 == 1

if 1 == 1 and not 1 == 2

As shown in the examples above logic can be built up to become very powerful giving you complete control over the flow, its actions and its execution.

It is also possible to reference functions and flow data within logic.

 if length("12") == 2

 if "test" in data[action][data]

NOTE

When using logic statements sometimes you need to wrap the statement with %% to enable A-Ops to understand the sides of the logic statements.

We have provided a few known examples whereby %% replacement syntax is required, this list is not definitive so its recommended if you run into problems to try and wrap the statement.

Examples:

if var[local][test] == "" --> if var[local][test] == %%""%%

if "test\test\" in "test\test\test" --> if %%"test\test\"%% in "test\test\test"

Where Logic Can Be Used

Actions

A-Ops actions support logic "if" statements that control whether or not the given action is executed.

Objects

Similar to action logic links themselves also support Link Logic which controls whether or not the link is followed and the attached action is executed.

Objects

Variable

Advanced variable panel supports logic statements that works by setting the variable to the value associated to the 1st "True" logic statement. If none of the logic statements return True then the default value is used.

Objects

Because variables are set after actions have already executed there is an additional key that can be used within logic called action. This action key is used to reference the data output of the action that 'just' executed as data[action] in this context will still reference the previous action objects result.

if "test" in action[data]