Action Context Section
The Action Context section (actionContext in the source view) has a similar purpose to the Actions section of a rule.
The Action Context section (actionContext in the source view) has a similar purpose to the Actions section of a rule. The Action Context section, however, defines all possible actions that can be taken by a business rule (after all conditions are met). Only the action context statements that the WebStudio user selects and defines as commands in the business rules are actually taken (depending on rule evaluation at runtime).
Defining the superset of all possible actions simplifies and restricts the configuration of business rules in WebStudio.
The actions are not completely defined in the rule template. Completing the definition of an action is a WebStudio user task. If bindings are used (and a view) then in WebStudio, the business rule writer has to enter only the binding values to complete the definition.
Action context statements are of three types: create, modify, and call, plus arbitrary actions, as explained next.
- Create Statements
- Create statements enable business rule developers to create new concepts or events. Create statement uses fully qualified name for the concepts and events instead of simple name. For example:
create Concepts.Bulk bulk;
In the rule template, that is as far as you go. It’s up to the business rule developer to assign the specific constructor values for the entity type.
- Modify Statements
- Modify statements enable business rule developers to modify concepts or events. For example:
modify bulk;
Only entities in the scope of the rule can be used. As with create statements, it is up to the business rule developer to determine which properties to change and assign values to those properties.
- Call Statements
- Call statements enable business rule developers to call rule functions. Call statement uses fully qualified name for the concepts and events instead of simple name. Call statement uses a variable to store the return value. Call statement uses this return variable even if the return type is void. For example:
call RuleFunctions.matchFound matchfound;
The business rule developer assigns the parameters for the rule function.