Conditions & Exceptions

Editing transition conditions

The Edit condition panel allows a condition (evaluated during the transition to the next action) to be modified. The banner located above the input area allows the condition’s expression syntax to be edited quickly. Any JavaScript or VBScript expression with a correct syntax can be used as a condition (choose either JavaScript or VBScript next to Language). The syntax is validated upon saving the condition or by clicking the Check the syntax button.

  • This JavaScript implementation is based on ECMAScript 3.5.

  • In JavaScript, time units are expressed in milliseconds:

    • 1 minute = 60,000 milliseconds (1 * 60 * 1000 = 60000)

    • 1 hour = 3,600,000 milliseconds (1 * 60 * 60 * 1000 = 3600000)

    • 1 day = 86,400,000 milliseconds (1 * 24 * 60 * 60 * 1000 = 86400000)

    In conditions, you can divide by the time unit's equivalent in milliseconds to use in comparisons. For example, a notification sent when a request is 12 or more hours late might look like this:

    <WF_SYSTEM_DATETIME> - <WF_ACTIVITY_INST_LIMIT_DATETIME>) / 3600000 >= 12

Functions

Fields

Remarks

Data

List of process data that can be used in the condition

Macros

List of WorkflowGen macros that can be used in the condition

Otherwise

Inserts the keyword OTHERWISE

JavaScript

Fnc()

Encapsulate the condition in an IIFE (see IIFE below)

&&

Inserts the logical operator AND

||

Inserts the logical operator OR

==

Inserts the logical operator EQUAL TO

!=

Inserts the logical operator NOT

null

Test function to find out if the data contains no value

getTime()

Returns the numerical value of a date in milliseconds

VBScript

( )

Enclose the selected text between parentheses

And

Inserts the logical operator AND

Or

Inserts the logical operator OR

Not

Inserts the logical operator NOT

IsNull()

Test function to find out if the data contains no value

DateDiff

Inserts blank DateDiff condition syntax to set values (see Overdue and pre-overdue notifications)

Press Ctrl+Space or Alt+Space directly within the editor to display a drop-down list from which you can insert process data and WorkflowGen macros, instead of choosing them from the Data and Macros drop-down lists above the editor.

IIFE

In JavaScript mode, use the Fnc() button to encapsulate the condition in an IIFE (Immediately-Invoked Function Expression). For example:

(function(){
  var myVar = <DATA>
  return myVar == "Lorem ipsum"
})()

Examples

  • Process data equal to Lorem ipsum:

    • JavaScript: <DATA> == "Lorem ipsum"

    • VBScript: <DATA> = "Lorem ipsum"

  • Process data greater than 5:

    • JavaScript: <DATA> > 5

    • VBScript: <DATA> > 5

  • Compare process data dates:

    • JavaScript: <DATE1> > <DATE2>

    • VBScript: DateDiff("s",<DATE1>,<DATE2>) > 0

  • More than 5 hours have elapsed since:

    • JavaScript: (<WF_SYSTEM_DATETIME> - <DATE1>) * 3600000 > 5

    • VBScript: DateDiff("h",<WF_SYSTEM_DATETIME>, <DATE1>) > 5

  • Combination of different comparisons:

    • JavaScript: <DATA1> == "Lorem ipsum" || (<DATA2> > 10000 && <DATA3> == "Director")

    • VBScript: <DATA1> = "Lorem ipsum" Or (<DATA2> > 10000 And <DATA3> = "Director")

  • Process data file has not been defined:

    • JavaScript: <FILE_DATA> == null

    • VBScript: IsNull(<FILE_DATA>)

  • Process data file has a specific size (less than 1 MB) and a specific file name:

    • JavaScript: <FILE_DATA.SIZE> < 1024000 && <FILE_DATA.NAME>.indexOf("report") > -1

    • VBScript: <FILE_DATA.SIZE> < 1024000 And InStr(1,<FILE_DATA.NAME>,"report") > 0

Condition rules

  • You can only add one condition to a transition. To add more conditions between the same actions, create additional transitions between the actions and place the additional conditions on them.

  • You can only place one condition or one exception on a given transition.

  • Each condition is evaluated individually. For example, if there are two conditions on separate transitions between actions, and both are TRUE, then the next action will be created twice.

Editing exceptions

Exception type

Remarks

Action overdue

Exception triggered by the system when an action is overdue

Action cancellation triggered by

Exception triggered when a user or supervisor cancels an ongoing action or sub-process

To prevent users and/or supervisors from cancelling the action, uncheck Users and/or Supervisors. Otherwise, Users, Supervisors, Administrators, and System are checked by default, and can all cancel actions.

✏️ Note: Administrators and System cannot be unchecked, and can always cancel actions.

Assignment error

Exception triggered when an action is assigned to a user that is not associated with the participant

Execution error

Exception triggered by the system when an error occurs during an automatic application execution (a system action)

Default

Exception triggered by default

Exception rules

  • You can only add one exception to a transition. To add more exceptions between the same actions, create additional transitions between the actions and place the additional exceptions on them.

  • You can only place one exception or one condition on a given transition.

  • Each exception is evaluated individually. For example, if there are two exceptions on separate transitions between actions, and both exceptions occur, then the next action will be created twice.

  • When an exception occurs at runtime, the default exception is assumed if no specific exception path corresponding to the exception type was defined in the process definition.

  • If an exception path is linked to the end of the process and the exception occurs at runtime, all the ongoing actions are cancelled and the request is closed with the status Closed – Cancelled.

Last updated