Siebel Product Administration Guide > Siebel Configurator Rule Assembly Language > About Operators in Rule Assembly Language >

Special Operators in Rule Assembly Language


Special 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:

  • It returns a null value.
  • When it is evaluated in a subexpression, this causes the Siebel Configurator engine to contribute the value requested.

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.

req(X, inc(Y, Z))

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.

Table 37. Special Operators
Operator
Syntax              
Properties

Constraint

con(A)

Makes A a constraint. Returns no result. A can be an item or sub-expression. Use to make sub-expressions into constraints. Redundant for top-level expressions. Rarely used.

Increment

inc(A,B)

Each A requires a B. A can be a number, item, or sub-expression but must resolve to a number. B must be an item and cannot be a sub-expression. inc(1, B) increments the quantity of B in the solution by 1. Use inc(A,B), where A and B are items, to implement cumulative require constraints.

Message

msg(A) "string"

Causes message signal when A is true (selected). User-defined message displays in user message area. Returns no result. A can be an item or sub-expression.

Check

chk(A) "string"

Causes a message-signal when A is false (not selected). User-defined message displays in user message area. Returns no result. A can be an item or sub-expression.

Preference

prefer(expression, priority)

The expression is enforced as a constraint only if it does not conflict with any other constraint type or with any user selections. The priority determines the order in which multiple preference constraints for an item are evaluated. Preference constraints with priority 0 that apply to a specific item are evaluated first. Those with priority 1 that apply to that item are evaluated next, and so on.

With Members

withMembers(A,B)

Enforce the constraint B only on instances in A.

This operator allows you to move the context for enforcement of a constraint from the root of a customizable product to a location within it. For example, A can be a path to a relationship within the customizable product. This causes the constraint B to be enforced only within that relationship.

A can be a relationship, a class within a relationship, or a single product. B can be any expression or constraint.

In B, the path must be specified relative to the path in A. For example, if A specifies relationship R1, the paths to items in B, must be specified relative to R1, not the product root. When specifying items in B, do not include any part of the path specified in A.

When adding items to B using the pick applet in the Assisted Advanced Constraint template, you must manually edit the item paths in B to make them relative to the path specified in A.

With Tuples

withTuples (((A, B, C), (D,E F), ...), ruleA(%1, %2, %3,...),...)

This operator allows you to specify multiple sets of operands for one or more constraints. The first operand in a group is assigned to the variable %1, the second to %2, and so on. You can specify more than one constraint.

More on withTuples

The 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:

req(and([A],[B]),excl([C],[G]))

When both A and B are present, C and G exclude each other

req(and([D],[E]),excl([F],[G]))

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:

withTuples((([A],[B],[C]),([D],[E],[F])),req(and(%1,%2),

excl(%3,[G]))

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:

req(and([A],[B]),[C])

inc([C], [Resource1])

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:

withTuples((([A],[B],[C])),req(and(%1,%2),%3),inc(%3,[Resource1]))

More on withMembers

The 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.

Siebel Product Administration Guide Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices.