Customizing operators
Use advanced customization to define operators that can then be selected from a drop-down menu in decision tables.
You use operators in rule statements to do arithmetic operations, associate or negate conditions, and compare expressions. You keep the decision table operators in a vocabulary file (_<locale>.voc), a key-value property file that stores the verbalization data for the BOM. You have one vocabulary file per locale, so a BOM entry can be associated with several vocabulary files. All the vocabulary files are published to Decision Center, which displays the rules in the user locale.
The decision table operators are predicates, or fact types that yield a boolean. You define them in the BOM, and verbalize them in the .voc file. You must annotate the verbalizations to show the operators in the context menu in the Decision Center decision table.
The following code shows the annotation:
predicate_formats.MyClass#concept.label = my class
predicate_formats.MyClass.method1(int)#phrase.navigation = {this}.method1({0})
predicate_formats.MyClass.method1(int)#predicate.format = method1 {0}
predicate_formats.MyClass.method1(int)#predicate.description = method1
predicate_formats.MyClass.method1(int)#predicate.group = 1
You use the predicate annotations as follows:
- predicate.format
- Used for formatting or parsing cells when copying or importing from an .xls file. The placeholders represent the positional arguments to the method, as usual.
- predicate.description
- The label that is shown in the contextual menu in the decision table.
- predictate.group
-
An optional integer value that groups menu items and insert menu separators in the groups.