![]() |
As you create rules, you must create rule fragments that perform the rule logic. This section describes in detail how to create and work with rule fragments.
Use these procedures to define or modify a rule's fragments when you are creating ( To Define a Rule) or modifying ( To Modify a Rule) a rule.
When you are creating a rule, the Fragment area appears as in Figure 336.
Click the New Fragment icon here to create a fragment at the currently displayed level (in this case, the top level) in the rule structure. Click New Fragment again to create a second fragment at the currently displayed level. In other words, the rule would be:
FragmentA AND FragmentB
Clicking the New Operator icon creates a nested level for creating fragments, as shown in Figure 337. The new level displays a new set of New Fragment and New Operator links. You use this New Fragment link to create the fragments at this nested level. If you click New Operator at this level, then you will create another nested level below this one with another set of New Fragment and New Operator links for that level.
In this example, you are attempting to create a rule consisting of two fragments, joined by a single operator, with no nested levels: FragmentA AND FragmentB. When you access the tab, the New Rule tab appears as in Figure 338.
See Table 13, Operators.
See If Not Specified for an explanation of these values.
This re-displays the New Rule tab with the new fragment, as shown in Figure 340. Also, notice the infix representation.
This re-displays the New Rule tab with the fragment you created, as shown in Figure 341. Notice that the rule has two fragments now.
You can click Save to save the rule and continue defining the rule. Click Save and Return to return to the list of rules in the Define tab.
In this example, the modeler is creating the following rule with nested fragments:
(FragmentA AND FragmentB) OR (FragmentC AND FragmentD)
A nested level appears in the New Rule tab, as shown in Figure 343. This level has its own drop-down boolean operators, as well as its own New Fragment, New Operator, and Delete Operator icons.
Use the nested drop-down list to select the boolean operator for these fragments. The default is AND.
Use the nested New Fragment icon to create the fragments at this nested level.
When the two fragments are completed, the New Rule tab appears as in Figure 344.
You can nest as many fragments as you want by clicking the nested New Operator icon. Each time, a new nested operator will appear with a new set of nested icons. You use these nested icons to create the fragments for the nested level.
A new nested level appears in the fragments tab, as shown in Figure 346. This level has its own drop-down boolean operators, as well as its own New Fragment, New Operator, and Delete Operator icons.
Use the nested drop-down list of boolean operators and the nested New Fragment icon for these fragments.
When the two fragments are completed, the New Rule tab appears as in Figure 347.
See If Not Specified for an explanation of these values.
Find the fragment you want to delete in the Fragments table, then click the Delete icon in the Actions column on the same line as the fragment.
Perform these tasks when you want to include a rule action when you are creating ( To Define a Rule) or modifying ( To Modify a Rule) a rule.
You define rule actions in the lower part of the New Rule or Edit Rule tab. Rule actions comprise three types of actions:
When you are creating ( To Define a Rule) or modifying ( To Modify a Rule) a rule, you perform this task in the Message Actions area of the New Rule or Edit Rule tab.
When you are creating ( To Define a Rule) or modifying ( To Modify a Rule) a rule, you perform this task in the Expansion Actions area of the New Rule or Edit Rule tab.
The results of formula will be used to perform the expansion. See Expansion for an explanation of rule formulas.
The minimum amount is the minimum value the rule formula result must be greater than. This value can be negative or greater than or equal to zero. The value must be less than the maximum value (Max). The maximum amount is the maximum value the rule formula result must match. This value must be greater than the minimum value (Min).
You must provide the full path to the expansion item within the current model. In the figure above, for example, the rule adds an option item called either 64MB, 128MB, or 256MB, located in option class AutoMemory in the current model.
When a rule is used in multiple models, this fully qualified path could be difficult to specify since the current model name will very likely not be "MXWS-7650" for all the models where the rule is attached. To facilitate the use of expansion rules across multiple models, you can usual special symbols as follows:
x = value(Tubing.3\"pipe.threading.gauge)x = value('Tubing.3"pipe.threading.gauge') x = value(Board.8\'plank.thickness) x = value("Board.8'plank.thickness")
Typically, the result of an expansion action is to pick a quantity selected on an option item. If the option item quantity is a drop-down list, then you should take to ensure that the possible calculated values are consistent with the pickable values: otherwise, the drop-down list will not be able to display the calculated value.
When you are creating ( To Define a Rule) or modifying ( To Modify a Rule) a rule, you perform this task in the Assignment Actions area at the bottom of the New Rule or Edit Rule tab.
When you are assigning a value to a property whose type is String, then you must use the following syntax to refer to properties:
${function(arg1, arg2, ..., arg N}
For example, ${expand("Color", "Black", 0)}. See Example Uses of Expand for other examples of the usage of the expand function.
If you leave this field blank, then the assignment defaults to the entity to which the rule is attached.
The following table summarizes some of the available properties for assignment. These properties can be changed each release so check with your Comergent Technologies representative for further information if required.
The syntax of the expand function should follow ${expand(property[,defaultValue[,format[,lookup]]])}.
For example, suppose that you want to display the name of the model as the name of the associated product together with the product description. Then at the model level, set the value of the UI: DISPLAY NAME property to: ${expand("UI: PRODUCT NAME")} or ${expand("UI: PRODUCT DESCRIPTION","Description not available")}.
This has the advantage that if the product name or description gets changed, then if you recompile the model, then the name or description is displayed with the new version when users next configure product.
Here are some further examples of the expand function:
|