Adding Condition to Rule

  1. On the Fulfillment Order UI, click Condition. The Condition Editor tab is displayed.
    Adding Condition to Rule


  2. Click Edit Attribute in Condition Editor tab to add or edit conditions. Condition Builder screen will appear as a pop which can be used to configure conditions for this rule.
    Edit Attribute


  3. A criteria has the Left Operand, Operator and Right Operand, as displayed:
    Left Operand Operator Right Operand
    The left side of a quantity upon which a criteria operation is performed Performs calculations on the operands in a query or an expression The right side of a quantity upon which a criteria operation is performed

Select Left Operand, Operator and Right Operand from the Condition Builder to create a condition. Left and Right Operand can be selected from a predefined list of attributes or utility methods. Similarly, Operator can also be selected from a predefined list of attributes depending on the selection of Left Operand.

Selecting Left Operand

To select Left Operand click the Edit icon besides Left Operand in the Condition section. A predefined list of Attributes/utility methods will appear on right side in Attributes section to select as Left Operand. An attribute or utility method from this available list can be selected.

Using attributes as Left Operand

Select an attribute from the available list and click the Map icon to assign this value as left operand. Please refer Plan Jeopardy and Plan Item jeopardy section for list of attributes which can be selected as Left Operand.

Condition Builder


Using Utility methods as Left Operand

List of utility methods will appear in Attributes section under utility node. Select a utility method from this list and click Map icon to assign the return value of this method as Left Operand.

Following table shows the utility methods listed under utility node in Attributes section:

Utility methods as Left Operand


Values to the input parameters of the method can be assigned using the Edit icon appearing besides method parameter. When you click Edit, a list of attributes appears on right side and value can be assigned by selecting any attribute. Use Data Input to assign any input value for an input parameter of the method.

Utility Methods


The following table shows supported utility methods with description:

Method Signature Description
public boolean wildCardMatch( java.lang.String text, java.lang.String pattern) Test if the pattern matches with given text. Parameters: text - java.lang.String to be searched in an effort to find pattern pattern - character or java.lang.String of one or more characters to be searched for Returns: Returns value true if the given text matches the pattern and false otherwise
public java.util.Date getDateFromTimeStamp( java.lang.Long inputTimeStamp) Indicating java.util.Date for specified timestamp in milliseconds. Parameters: inputTimeStamp - milliseconds value as java.lang.Long Returns: java.util.Date object and initializes it to represent the specified number of milliseconds.
public java.lang.Integer getDayOfWeek( java.lang.String timezone, java.lang.String country, java.lang.String language, java.lang.Long timestamp) Indicating the day of week for specified timestamp in milliseconds Parameters: timezone - the timezone (e.g. 'America/Chicago') country - the country (e.g. 'US') language - the language (e.g. 'en') timestamp - the timestamp as milliseconds Returns: Day of the week as an Integer value for the timestamp value using the time zone, country and language specified
public java.lang.Integer getDayOfMonth( java.lang.String timezone, java.lang.String country, java.lang.String language, java.lang.Long timestamp) Indicating the day of month for specified timestamp in milliseconds Parameters: timezone -the timezone (e.g. 'America/Chicago') country - the country (e.g. 'US') language - the language (e.g. 'en') timestamp - the timestamp as milliseconds Returns: Day of the month as an Integer value for the timestamp value using the timezone, country and language specified.

Select an Operator

To select an Operator, click Edit icon besides Operator in condition section a list of operators with description will appear on right side. Select any operator to assign Operator value.

Selecting an Operator


Select Right Operand

To select Right Operand click Edit button besides Right Operand in Condition section. A list of attributes appears on the right side in the Attributes section to select as Right Operand. Select any attribute from the available list or input a value by selecting Data Input from Attributes section and click Map icon to assign this value as the Right Operand.
Selecting Right Operand


4. Click Generate Groovy Method to verify the criteria and generate a corresponding expression
Groovy Method


An expression is generated using the selected Left Operand, Operator, Right Operand and it is displayed in the Condition Expression section.
Expression


5. Click Save to add condition to Condition Editor.

6. To add more condition click Add icon as shown below. To add a nested condition click Add Nested icon. Match All will be used if all the conditions need to be evaluated true for this rule to execute. Match Any will be used if any of the specified conditions need to be evaluated true for this rule to execute.
Condition Editor


Conditions in the Condition Editor are shown as follows: You can delete a Condition or nested condition from the Condition Editor using the Delete icon.

Deleting Condition


Groovy script generated from a defined condition is shown in the Expression tab as follows.
Groovy script generated from a defined condition