Business Rules 10.7 | webMethods Business Rules Web Help | webMethods Rules Development Help | Working with Data Models and Parameters
 
Working with Data Models and Parameters
 
About Data Types
Accessing the Data Model Wizard
Creating a Data Model
Synchronizing a Data Model with the Underlying IS Document Type
Renaming a Data Model
Deleting a Data Model
The rules you create with Software AG Designer operate on the basis of Integration Server (IS) document types. An IS document type contains a set of fields that define the structure and type of data in a document. To create document types, follow the instructions as described in webMethods Service Development Help.
Before you can actually create and modify rules, you must map the IS document type to a data model, which is then stored in your workspace as part of the rule project. The mapped data model serves as a class or blueprint. At runtime, specific instances of this data model will be used in Rules Engine.
Data Model Elements and Data Types
The properties of a data model are referred to as data model elements. They correspond to the fields of the IS document type. Each data model element has a data type that corresponds to the data type of the imported IS document field. For an overview of supported data types, see About Data Types.
Example
You can create a supplier document type with fields such as delivery time, delivery history, discount, etc. After you imported this document type, a supplier data model with the data model elements delivery time, delivery history, discount, etc. is created and stored under workspace\ [RuleProjectName] \Data Models.
Parameters
It can be necessary to use the same data model more than once in a decision entity. This is the case if you want to compare two or more instances that are based on the same data model with each other. To enable this, the data model is mapped to a parameter when you create a decision entity. Within one decision entity, you can use several parameters of the same data model type, but each must have a unique name.
Parameter Input/Output Type
A parameter can have a different input/output type (I/O type) depending on whether it is used only as a condition/event source, only as a result, or as a condition/event source and a result of a decision entity. This is explained in the following table:
Parameters is used
I/O Type is set to
Only as a condition/event source
Input
Only as a result
Output
As a condition/event source and a result
Both
Parameter Matching with the Any Option
The Any option can be set for a parameter of a decision entity. It is used to match any named parameters of the same data model type. In a rule set, you can specify for each parameter if the rule:
*Refers to this specific parameter (Any check box is cleared).
*Refers to all parameters in the rule set that are based on the same data model (Any check box is selected). This works only if:
*The parameter is used as a condition of a decision table or decision tree.
*The parameter is used as an event source of an event rule.
*The same parameter is used as a condition and result of a decision table or decision tree.
*The same parameter is used as an event source and result of an event rule.
Note:
The Any check box can only be selected if you use a parameter of a certain data model type only once in a decision entity.
Note:
The Any check box is not selectable for parameters that were mapped from event models, see Working with Event Models.
Example
A company has a standard and a backup supplier for each item on sale. The following rules exist:
Rule 1:
In case of urgent delivery, the supplier with the shortest delivery time gets the order, unless this supplier is blocked.
Rule 2:
A supplier is blocked if the company has had more than two negative experiences with the supplier.
Rule 3:
If both suppliers are blocked, an email is sent to the person controlling the order processing.
These three rules can be modeled in two decision tables within the same rule set.
When creating the Urgent Delivery decision table, the supplier data model is mapped to the two parameters standSupp and backSupp. The Any check box is cleared.
When creating the Negative Experience decision table, the supplier data model is mapped to the parameter anySupp. The Any check box is selected. In this way, the decision entity applies to all parameters within the rule set that are based on the supplier data model, including the standSupp and backSupp parameters.
Negative Experience Decision Table
Urgent Delivery Decision Table