Commands in procedural rules may fall into different categories. They will be available in Procedural logic that your application can create an instance of and execute the rules. These commands are suitable for implementing low level functionality, algorithms implementation, complex logic validation, communication to external resources, object creation and variable value manipulation, object and class level method invocation, accomplishing repetitive tasks, implementing modular rules and logic, database access and so on. Also, it is possible to extend the commands in this Procedural logic and define your required behavior.
- 1 Procedural Commands
- 1.1 Declaration and Assignment commands
- 1.2 Flow Control commands
- 1.3 Object Creation commands
- 1.4 Task Commands
- 1.5 Database commands
Declaration and Assignment commands
This group of commands are responsible for declaring and defining the rule structure and available commands on the rule.
This command defines a procedure that is executable in the procedural logic. The entire rule logic must be placed inside this command. A procedure is a low level functionality or behaviour that can handle complex rules or logic. It is also a reusable part of flow logic. It may have calculations, conditions, assignments, etc. A procedure is an executable routine of a rule or logic. It may have input, output or local parameters from different CLR types. In order for a procedure to execute different commands it must include a Handlers command. Handlers define what commands are available inside a procedure. Procedures can be divided into different sections named Scope. Each Scope will also be able to accept some parameters.
This is the section that contains all of the command handlers. This section of a rule will be loaded automatically and is responsible for registering all of the other handlers of the rule. Each command in the rule must be introduced by a handler.
A handler is a factory that provides all the command execution and definition mechanisms in the rule. This is the command extension points of the procedural logic. If you want to conduct any specific task for which we do not provide a command at the procedural rule level then you need to create a handler and register it using this command. All out-of-the-box commands also follow the same pattern to be registered in the rule logic and allow the rules to behave in a defined way using a particular command (e.g., If | While | Database, etc.).
Each rule has a specific signature that defines all of the rule parameters. These rule parameters can be defined in different modes: Input, Output, and Local. And their parameters can be in any internal or custom CLR types. That allows the calling application to be able to send any type of value to rules for processing and then retrieve any types of result from the engine when the processing is finished or even during the execution. Also Usings can be defined in this section of rule.
This command defines the rule parameters. It can be in different directions: Input, Output and local. There is no limitation on the numbers or types of the defining parameters. It can either have none or as many parameters as required. The input parameters must be passed through with the executing applications.
If there is a type whose static members are required during the evaluation, it has to be registered by this command
This command will manage a defined parameter's value. It can access the value and manipulate it. The value can be in any type and the command is able to read and write the value or a properties of a value.
Flow Control commands
This group of commands is responsible for managing the execution flow inside the running rule.
This command creates a loop and all the child commands inside it get executed until you ask it to exit the loop by using ExitDo. The 'do' statement executes a statement or a block of statements repeatedly.
While this is similar to Do, this involves entering a condition which will be evaluated in every iteration of the loop. The engine will exit the execution of loop when the condition is evaluated as a false value or it reaches the ExitWhile command.
This command can be used when iterating a collection or list. The engine exits the iteration when it reaches the end of the collection or ExitIterate command.
This command will handle any exception occurring inside its execution block. If any exception occurs during the execution, it will go to its Catch block.
When an exception occurs, the execution path will come to this block. Then it is time for processing what has gone wrong.
For any conditions for which you may want to halt the rule execution. In this case, this command can throw an exception and halt the rule execution. Your calling application will then receive a signal because of the thrown exception.
When you need to group similar logic inside a rule so that you avoid duplicating these all over your code, this command will be useful. The other parts of the rule can then Call to a specific named scope and pass some input parameters and retrieve some results. Also scope can be a reusable module between different procedural rules.
Object Creation commands
When dynamic creation of objects is required, this set of commands can be used.
If instantiation of a type is required in the rule execution, this command can be used. It allows the creation of objects from any type using their constructors.
This command is a type constructor selector. It selects a suitable constructor of a type to be used to instantiate an object.
Creating an array of objects is possible using New command. However it might be easier to use this command instead to populate the values of the array directly.
This command will be used inside the Array command and will add values for each index of the array.
This command creates a list that can act as a collection or set.
This command allows the building of a template to generate a table of data based on a set of inputs.
Calls out to any REST API and returns the results.
When there are objects defined inside a rule, this command can make a call to the object methods.
Calling a function and method by passing input parameters as embedded elements rather than attribute values.
If your application logic is complex and requires multiple Procedural rules, this command can call an externally defined rule and return the result to the running execution context.
When your rule has some scopes this command can call to and execute the scope, and then return to its previous execution path.
Sometimes the calling application requires signals to be received from the executing rules. This command will send an event to the running engine and then your application, and handle the event required to respond to the rule signal.
When scopes are defined on a separate physical layer (different files than the actual rule), this command will load the external scope inside the current loaded rule.
For lots of commands, some initialization values are required. This command is responsible for preparing and passing the values to the Rule commands.
This set of commands enables the rule to communicate with a data source (database) and retrieve a value, single row or multiple rows as part of the rule execution process.
This command defines a connection to a data source: MsAccess, MsSql, Oracle, ODBC.
When rows are required to be retrieved from a database table, this command can be used.
When rows are required to be retrieved from a database table this command can be used to create a list of values, either simple primitive values or complex object values.
When a single value (cell value) is required to be selected from a database table, this command can be used.
When the Insert, Delete or Update command is required, this command can be used.
If the result of executing a query returns a value, this command should be used.