In the iWD solution, Rule templates are used to set up different business rules for task classification, departments, and processes, as well as rules at the global level. Business rules usually have the following:
Conditions—“when” or “if” expressions
Actions—“then” expressions
Parameters—Used in the conditions and actions
Business rules within iWD are based on Rule Templates that are created by IT personnel. As with templates for Microsoft Office Word, business-rule templates are the foundation for business users to create or configure existing business rules that govern tasks in iWD. Business users are empowered to make the necessary changes, when required, while IT personnel can focus on tasks that are related to IT.
Note: Definition of Rule templates requires a basic knowledge of the Java programming language.
The iWD solution provides a set of predefined, standard rule templates and the possibility to define custom extensions as new rule templates. When creating a new rule template, you can specify the various properties, select conditions and actions (including various parameters), and if necessary, define functions for more complex conditions. Once the rule template is created it must be added to your solution.
The following properties and actions are available in the Rule Template panel:
|
Rule Template Name |
The name of the rule template. This field is mandatory. |
|
Conditions |
The rule condition template—that is, a "when" or" if" expression (for example, "when due time is in x hours"). The Rule template can contain any number of (or no) conditions. |
|
Actions |
The rule action template—that is, a "then" expression (for example, "then assign priority"). The Rule template can contain any number of actions. |
|
Parameters |
Rule parameters that are used in conditions and actions, and describe how parameters are presented to the user (who is creating the rule), how input is validated, and so on. |
|
Functions |
Allows definition of more complex functions, which then can be referenced in actions and conditions. |
|
Save/Save & Close/Cancel |
Standard iWD Manager functions as described in the Object Actions section of the Details Panel topic of this Help file. |
Although conditions and actions have different purposes, their definition is the same and consists of the following property specifications:
|
Language Expression |
Semantics of the rule language; meant for business users. They are simple enough to be understood by non-Java specialists. Language expressions can contain different parameters. |
|
Rule Language Mapping |
The same rule language expression, in Java code. This is the real code that is executed; it requires an understanding of Java and JBoss rules. JBoss is the underlying rule engine that is used in iWD. The rule-language mappings can contain different parameters. |
Rule-language expressions and the corresponding language mappings (used in conditions and actions) can contain different parameters. For example, the expression Process is {process} has the parameter process.
Parameters that are used as simple input controls appear only as specific names in action and condition definitions. If a parameter (such as a combo box) is more complex than a simple input control, it must be defined in the Parameters tab. Parameters in the Parameters tab have the following definition properties:
|
Parameter Name |
The name of the parameter. This field is mandatory. |
|
Parameter Type |
The type of input control for the parameter. There are several input-control types:
This field is mandatory. |
|
Configuration |
The attributes for SelectConstant and SelectDynamic type parameters. The pattern for SelectConstant is the following: “<value_1>”:”<label_1>”, “<value_2>”:”<label_2>”, ..., “<value_n>”:”<label_n>” The pattern for SelectDynamic is the following: <package name>.<class name> This field is mandatory for SelectConstant and SelectDynamic type parameters. |
During definition of Rule templates, elements are required that are more complex than conditions and actions that allow only one input line. The Functions tab enables you to write specific Java functions for different purposes in Rule templates. The specified functions are used in the Rule Language Mappings.
Note: During use
of a rule function in a condition or action, make sure that each function
name and parameter is prefixed with a space, such as the following:
eval( someFunction( param1, param2) )
otherwise, the function might not be recognized by the rules parser.
The following properties are available in the Functions tab:
|
Function Name |
The name of the function. This field is mandatory. |
|
Description |
A short description of the function. This property is optional. |
|
Body |
The function code, with the following syntax: function <return type> <function name>(<arguments>) {...} This field is mandatory. |
You must explicitly add new Rule Templates to your Solution. The following steps outline how this is done.
Create the new Rule Template (Modules & Components > Rule Templates > New) and save it (refer to the table above for the configurable properties). Your new Rule Template will become a new Component, which needs to be added to a Module.
Add the new Rule Template Component to an existing Module, or create a new Module and add it there. Do this by going to Modules & Components > Modules. You should see your new Rule Template in the Unassigned Components list. Check it and click the arrow to move it to the Assigned Components list. Save the change.
If you used an existing Module in Step 2, and that Module is already assigned to your Solution, you should be done. If you created a new Module in Step 2, then you need to add this Module to your Solution. Go to Services, select your Tenant, and then click on the name of your Solution. There you will see a list of Assigned Modules and Unassigned Modules. Select your new Module (with your Rule Template in it) from the list of Unassigned Components. Click the arrow to move it to the Assigned Modules list. Save the change.
If you added the Rule Template to an existing Module, you do not need to redeploy your Solution in order to use the new template. If you created a new Module in Step 2, you will be prompted to deploy the Solution first.
These steps assume you have created the Rule Template under a specific iWD Tenant. You can follow the same steps to create a new template under the System Tenant, if desired.