You can create a ruleset to group a set of logically related rules.
All rules related to discounts can be grouped under the discountrules ruleset.
In the Project Explorer view, expand the process composer DC node and the Process Modeling node and choose New Ruleset in the context menu of the Rulesets node.
In the dialog box that appears, enter a name in the Name field.
The namespace is predefined and it is the namespace of the development component (DC) that contains your project.
Locate Return type and choose a return type in the drop down menu.
By default, the drop down menu displays all the XSD types. You can also import XSD files and use them as a return type.
More Information :
The return type of a ruleset should be either primitive XSD or should match with the parameter type.
Choose Add to add parameters.
Choose the default value in the Type column and choose a type in the drop down menu.
You can choose the parameter's name in the Name column and rename the parameter.
Choose Finish .
In the Project Explorer view, the ruleset node appears when you expand the Rulesets node.
The Ruleset Editor
The Ruleset Editor has tabs such as :
Overview : You can create, open, and delete If-Then rules and decision tables in this tab page.
In the Overview tab, under General Information , enter the description of the ruleset in the Documentation field.
In the Overview tab, under Signature , choose the Result field and in the drop down menu
If the return type matches a parameter type, choose a parameter name
If the return type is a primitive XSD type, create a definition and choose a definition name
You can edit the Return Type and Parameters fields in the Overview tab
Definitions : This tab is a link to the Definition Editor, where you can create and edit definitions.
Aliases : This tab is a link to the Ruleset Aliases Editor, which gives an overview of all the ruleset aliases available in the process composer DC.
Rules : This tab is a link to the Rule Editor, where you can create and edit rules.
Decision Tables : This tab is a link to the Decision Table Editor, where you can create and edit decision tables.
Test Scenario : This tab is a link to the test case editor, where you can add XML documents and Definitions for test input.
In the context menu of the ruleset node, there are options such as:
Open : This option allows you to open the ruleset editor
Delete : This option allows you to permanently remove a ruleset from the process composer DC
New Decision Table : This option allows you to create a decision table in the ruleset
New Rule : This option allows you to create a rule in the ruleset
Compare With : This option allows you to compare rulesets
More Information: Comparing Aliases and Rulesets
Invoking a Ruleset
While invoking a ruleset, the input parameter of a ruleset function whose value is not passed at runtime or whose value is null at runtime will not be taken into consideration by the rule engine. If there are any actions written on these parameters, they will fail.
Consider the ruleset function: OrderRules . It has two parameters named orderVolume and success .
orderVolume is a complex XSD type and success is a string type.
If the return type matches a type of parameter, choose a parameter name. In this example, the return type of a ruleset function is string, so success is mapped as a return type. The value of success is set in rules.
If the ruleset function is used in a process and no value is passed for success at runtime, the rules will not fire and there will be an exception from the rule engine.
At run time, if a data object passed as a ruleset parameter is of primitive type, it must have an assigned value even if it is an output parameter.