Bookshelf Home | Contents | Index | PDF |
Product Administration Guide > Siebel Configurator Rule Assembly Language > About Operators in Rule Assembly Language > Special Operators in Rule Assembly LanguageSpecial operators provide functions that manipulate the Siebel Configurator engine directly, rather than the underlying customizable product. They also provide defined types of access to the components of a customizable product. The inc() operator is used to implement provide and consume constraints. It has two important characteristics:
This means that writing constraints with the inc() operator as a subexpression based on a condition do not work. The contribution will always occur. For example, you write the following constraint. The Siebel Configurator engine will contribute the value of Y to Z, regardless of whether X is present in the solution. This is because the Siebel Configurator must evaluate the two arguments to req() before determining what action to take. Evaluating the inc() argument causes the engine to contribute the value of Y to Z. In addition, regardless of the value of X, the inc() argument always evaluates to null, which makes the constraint meaningless. To write constraints that contribute conditionally, use the numeric conditional operator, ?(). Special operators are shown in Table 37. More on withTuplesThe withTuples operator lets you provide more than one set of operands to a constraint. It has the following syntax: withTuples (((A, B, C),(D,E F),...), ruleA(%1,%2,%3,...),...) For example, you have the following two constraints:
When both A and B are present, C and G exclude each other
When both D and E are present, F and G exclude each other. The above two constraints can be thought of as one require constraint that has two sets of operands. The withTuples operator lets you write the constraint in this fashion. This makes constraint maintenance easier. If the operands change, you can edit them in one location, rather than having to locate all the constraints in which they appear. Here is one way to combine the two constraints using withTuples:
Notice that each group of operands is enclosed in parentheses. Also notice that the whole section where the operands are specified is itself enclosed in parentheses. You can also use the withTuples operator to specify the operands for multiple constraints. For example, you have the following two constraints: If both A and B are present, C is required, and contribute the value of C to Resource1. The above two constraints are different but they make use of the same operands. You could use the withTuples operator to show that these two constraints use the same operands as follows:
More on withMembersThe withMembers operator shifts the context for application of a constraint from the root of the customizable product to a specified location within the product. This means the constraint applies only to the items in the specified path, rather than wherever these items appear in the product. The withMembers operator adds no other functionality and does not alter the function of other operators. For example, you define Relationship A that contains only the customizable product desktop PC. The desktop PC includes two relationships: CPU and Hard Drive. You want to write the constraint CPU requires Hard Drive and enforce the constraint for each instance of the desktop PC. If the user adds a CPU and hard drive to a desktop PC but later removes the hard drive, you want the user to receive a configuration error for that PC. You would write this constraint as follows: withMembers(@.Relationship A, req(@.CPU, @.Hard Drive)) This constraint enforces "CPU requires Hard Drive" separately on each instance of desktop PC in Relationship A. All the desktop PCs from Relationship A must have a hard drive if they have a CPU. The constraint is not enforced for PCs that appear elsewhere in the customizable product other than Relationship A. |
Product Administration Guide | Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |