Building conditions

You build conditions using the Condition window.

To build a condition:

  1. Select the condition type in the navigation pane on the left side of the Condition dialog box. The following condition types are available:

    • Standard - This type allows you to 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. ClosedClick here to view examples.

      Response Date is not working hours of Maxwell Newcomb

      %[SYS Initiator ]% equals 'Mail Connector'

    • Compare Two Date Fields - This type allows you to compare two dates. ClosedClick here to view examples.

      Due Date is before Now by at least 1 hour (using default Work Calendar)

      Completed Date is after Due Date by at least 1 minute

    • SQL Criterion - This type provides a free-form text field where you can enter a SQL expression in the form of a SQL WHERE clause. The expression must return a TRUE or FALSE value. Use this condition type when you need to specify a complicated criterion that you can't do with the standard type. ClosedClick here to view examples.

      Select Purchase Orders that have at least one Purchase Order item

      Select technicians who have less than 10 Incidents assigned

  2. Create a condition of the chosen type:

    • ClosedTo create a "Standard" condition:

      1. Click the ellipsis button in the Field field and use the Select Placeholder window to select an object field or a macro whose value should be checked.

      2. Select the comparison operator from the Operator list. The type of field data determines the list of available operators.

      Some operators simply check the field's value (such as: is not blank, has been changed, is unique, is not working hours of technician, etc.), while others compare the chosen field's value to another value (such as: equals, is less than, is covered by calendar, is member of, etc.).

      1. If the operator compares the field’s value with another value:

        • To compare it with a fixed value, select Value in the Compare with list and enter the value in the Value field.

        • To compare it with another field's value or a macro, select Field in the Compare with list, click the ellipsis button in the Field field and use the Select Placeholder window to select the other field or macro. Both fields must be of the same data type.

    • ClosedTo create a "Compare Two Date Fields" condition:

      1. Click the ellipsis button in the Date 1 field and use the Select Placeholder window to select the first date (an object field, a macro, or a workflow parameter).

      2. Select the operator: is before or is after.

      3. Click the ellipsis button in the Date 2 field and use the Select Placeholder window to select the second date (an object field, a macro, or a workflow parameter).

      4. Specify the time difference between the first date and the second date to watch for:

        1. 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)
        2. Enter the number of time units or click the ellipsis button in the field and use the Select Placeholder window to select this number (an object field, a macro, or a workflow parameter). Then choose the time unit: Minute(s), Hour(s), Day(s), Week(s), etc. The time difference will be calculated and rounded up with the precision you choose here.

      5. Under Options, specify whether you want to compare the dates only within working hours or not:

        • To use the "round-the-clock (24/7)" calendar for comparing the dates, click Do not use any Work Calendar.

        • To compare the dates within working hours defined in the default work calendar, click Use the default Work Calendar.

        • To compare the dates within working hours defined in a non-default work calendar, click Use this Work Calendar and choose that calendar from the list. For details, see Work Calendars.

    • ClosedTo create an "SQL Criterion" condition:

      1. Type in a criterion name in the Name field.

      2. In the Text field, type in 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 window to enter your expression and insert placeholders for dynamic data.

      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 by a Create Object operation at runtime.

      For example:

        • An additional criteria on the Condition tab: Select Purchase Orders (POs) with at least one PO item:

          exists (select 1 from [PO_Items] where [PO_ID] = %[DBF ID ]%)
        • A condition in the "IF-<condition>-THEN" construct on the Programming tab: When assigning an Incident to a technician, check whether the specified technician already has 10 or more Incidents assigned:

          exists
          (select 1 from [Incident_List]
          	where [Status] not in ('Closed', 'Completed') AND
          	([Assignee_ID] = %[DBF Assignee_ID ]% OR
          	[Assignee_Group_ID] in (select [Group_ID] from [Group_Members] where [Person_ID] = %[DBF Assignee_ID ]%))
          having count(*) >= 10)
    • TIP: You can modify workflow parameters on the fly when configuring a workflow item or component or modifying Templates for Self Service Portal notifications. To open the Workflow Parameter window, right-click the selected placeholder and choose Placeholder Definition.

  3. Click OK.