Building Criteria
A condition (or criteria) is a logical expression that you can define at certain steps of configuring workflow items; for example, when configuring a Trigger based on condition or when building conditional statements for workflow operations.
A condition consists of one or more statements joined with logical operators into a logical expression. The AND operator is used by default; OR, NOT AND, and NOT OR operators are also available. Each condition involves a field from the object, a macro or a workflow parameter.
The condition type determines how the comparison operates. Alloy Navigator offers these condition types:
-
Standard — With this condition you can check the state of a field or macro, or compare it with another field or value. A number of operators, such as equals and is not blank, are available. Examples:Assignee is not blank, <Initiator> equals Mail Connector, Response Date is not working hours of technician, etc.
-
Compare Two Date Fields — This type of condition enables you to compare two dates. Examples: Due Date is before <Now> by at least 1 hour, Completed Date is after Due Date by at least 1 minute.
-
SQL Criterion — This type of condition allows you to specify any SQL script which returns a true/false value.
To build a condition:
-
In the Criteria dialog box, click Add Condition. The Condition dialog box opens.
-
In the left navigation pane, select a condition type.
-
Depending on the condition type, specify its details:
- For a Standard condition:
Click the ellipsis button in the Field field and use the Select Placeholder dialog box to choose an object field or a macro.
INFO: For details, see Inserting Placeholders.
In the Condition dialog box, choose the comparison operator from the Operator list. The field type selected on the previous step determines what operators are available. Some operators simply check the field’s value (such as: is not blank, has been changed, is unique, etc.), while others compare the value to another value (such as: equals, is less than, is covered by calendar, is member of, etc.).
If the operator compares one value with another value:
To compare it with a fixed value, choose Value from the Compare with list and enter the value in the Value field.
To compare it with a dynamic value (which can be another field's value, macro or a workflow parameter), choose Field from the Compare with list, click the ellipsis button in the Field list, and use the Select Placeholder dialog box to choose another field, macro, or a workflow parameter. Both fields must be of the same data type.
INFO: For details, see Inserting Placeholders.
-
For a Compare Two Date Fields condition:
-
Click the ellipsis button in the Date 1 field and use the Select Placeholder dialog box to select the first date.
-
Select the operator: is before or is after.
-
Click the ellipsis button in the Date 2 field and use the Select Placeholder dialog box to select the second date.
- Specify the time difference between the first date and the second date to watch for:
- Choose one of the following:
- by at most - non-strict comparison (X <= Y)
- by at least - non-strict comparison (X >= Y)
- by more than - strict comparison (X > Y)
- by less than - strict comparison (X < Y)
- by exactly - strict comparison (X = Y)
Enter the number of time units or click the ellipsis button in the field and use the Select Placeholder dialog box to select this number (an object field, a macro, or a workflow parameter). Then specify the time unit: minutes, hours, etc. The time difference will be calculated and rounded up with the precision you choose here.
- Choose one of the following:
-
By default, Alloy Navigator assumes the “round-the-clock (24/7)” calendar when comparing dates. When you want to compare two dates within working hours:
-
To compare the dates within working hours defined in the default work calendar, click Use the default Work Calendar under Options.
-
To compare the dates within working hours defined in a non-default work calendar, click Use this Work Calendar under Options and choose a calendar from the list.
INFO: For details, see Setting Up Work Calendars.
-
-
-
For an SQL Criterion condition type:
-
In the Name field, type the condition name.
-
In the Text field, type the SQL expression in the form of a SQL WHERE clause, without the word
WHERE
. The expression must return a TRUE or FALSE value. To build your SQL expression, click Build Expression and use the Build Expression dialog box to enter your expression and insert placeholders for dynamic data.INFO: For details, see Using the Expression Builder.
IMPORTANT: The SQL expression must refer to objects that exist in the database by the runtime of your Action or Trigger. You cannot refer to objects being created via a Create Object operation at runtime. For details, see Create Object.
-
- For a Standard condition:
-
ClickOK.
Repeat the steps above to add other conditions as needed.
TIP: You can make changes by using the Edit Condition, Delete Row, Move Up, and Move Down buttons. If you want to clear all conditions, click Clear All.
-
If you want to add a new group of conditions, click Add Group. An empty group with the default AND operator appears on the list. OR, NOT AND, and NOT OR operators are also available in the Criteria dialog box. To change the operator, double-click it and choose another one from the list.
Add other conditions to the group as needed.
-
Click Preview to preview the expression.
-
Click OK.