Creating a rule
To create a rule, follow the procedure described in this topic.
- Click . The Rules page opens.
- Click Add.
The Add Rule page opens.
- Specify a unique name for the new rule in the Name field.
- Specify a concise, meaningful comment that accurately describes the rule in the Description field.
- Click Add New Data to associate data with the rule.
- Select a data association that you want to use with this rule from the Data Association list. The association you select determines what data the rule administers. You can view the details of the data association that you select by clicking View next to your selection.
- Define data associations in the Meta Data module. For more
information on data associations, see Data associations. From the Allowed
Actions list, select the actions that you want users to
be able to perform on the data specified in step 6. You can choose
from the following selections:
- Add: Add new data
- Persist: Add and update data
- Update: Update existing data
- View: View existing data
- All: View, add, and update data
- Repeat steps 6 and 7 to associate additional data with
You can add as many data associations to the rule as necessary. Before you submit the rule, you can also remove associations that you have added by clicking the Scissors icon.
- Click Add New Constraint to add
a constraint and further refine the rule. Note: Adding constraints to a rule is not mandatory. If you do not need to add constraints, proceed to step 18.
- Make a selection from the Constraint Type list
under Evaluation Target. You can choose from the following constraint
- Attribute Level: Evaluates if the data specified is present in the response (for view transactions) or the request (for persistency transactions). If the data is not present in neither the response nor request, the constraint is not evaluated. The constraint is based on an attribute of a business object contained anywhere in the system.
- Entitlement Level: Used if the data you are evaluating in the constraint is not provided with the transaction. It is usually implemented with an external Java™ class or Operational Decision Manager rule that contains the logic to retrieve the necessary data from the database.
- Object Level: Evaluates the constraint based on an attribute of a business object contained in the transaction.
- Select the group or element to match the constraint type:
- If you chose Attribute Level or Object Level as your constraint type in step 10, from the Group Name list, select the business group that the constraint is being applied to.
- If you chose Attribute Level or Object Level as your constraint type in step 10, from the Element Name list, select the element belonging to the group that you selected in the previous step that the constraint is being applied to.
- If you chose Entitlement Level as your constraint type in step 10, select a Java class or rule-set name from the Extension Rule list.
- Select an operator to apply to the constraint from the Operator list.
Note: The following operators cannot be used to compare alphanumeric values: less than, less than or equal to, greater than, and greater than or equal to.
- Select the type of operand from the Operand
Type list. You can choose from the following selections:
- Any: Used in conjunction with the Negation field for attribute-level constraints. When you set the operand type to Any and set the negation to Yes, access to the element specified in the Element Name list is disallowed.
- Static Value(s): Requires at least one value into the Value field (to a maximum of 999; multiple entries must be separated by a comma). The number you enter is the value being evaluated against.
- System Date: Compares a date attribute with the system date.
- XML Header Element: Compares the values of elements in the DWLControl object to the element you selected in step 12. The DWLControl object is an object found within the header of an XML request during a transaction.
- Date Arithmetic: Adds or subtracts days, months, and years to or from the system date. You can use this option when you want to create a rule that grants access to records based on a time value. When you select this option, you can use the following expressions in the Value field: +, -, systemdate, day, days, month, months, year, years.
- Specify the values of the operand in the Value field
if you selected Static Value(s), XML Header
Element, or Date Arithmetic as the operand
type in step 13. For example, systemdate - 6 months + 2 days. If you are entering more than one value, separate them with a comma.
- Select an error message ID from the Error Message list
if you want to associate an error with this constraint. If the transaction returns as fatal because of the constraint, the user will receive the error message specified here. Once you select an error message ID, you can view the message's text by clicking Show Message.Note: You can create and edit error messages in the Code Tables module. For more information, see Code tables and error messages.
- Select Yes from the Negation list
if you want to activate negation for this rule.
By default this field is set to No. When you activate negation, you are reversing the parameters of the constraint and enforcing the exact opposite of what the constraint signifies.
- Repeat steps 9 through 16 to add additional constraints
to this rule.
You can add as many constraints to the rule as necessary. Before you submit the rule, you can also remove constraints that you have added by clicking the Scissors icon. If you add more than one constraint to a rule, each constraint must evaluate to true in order for users to view or take action on the data contained in the rule.
- Click Submit.
A confirmation message asks you to confirm your action.
- Click OK.