TIMEOUT
Another kind of branch is TIMEOUT, which (like TRIGGER) can appear on ManualStep Workflow Step or an
ActivityStep Workflow Step.
You still have a To
field and optional Gosu block. However, instead of using a condition
to determine how to move forward, the workflow executes the TIMEOUT element after the elapse
of a specified amount of time.
You can use a TIMEOUT in the following ways:
- As the default behavior for a
stalled workflow. For example:
Do x if PolicyCenter has not invoked a trigger for a certain amount of time.
- As a deliberate delay. For example:
Go to sleep for 35 days.
You can specify the time to wait using one of the following attributes. (Studio complains if you use neither or both.)
timeDeltatimeAbsolute
The time delta value
The Time Delta value specifies an amount of time to wait, starting from the time the Workflow instance successfully enters the step. (The wait time starts immediately after the workflow executes the Enter Script block for the step.) You specific the time to wait with a number and a unit, for example:
100sfor 100 seconds15mfor 15 minutes35dfor 35 days
You can also combine numbers and units, for example,
2d12h30m for 2 days, 12
hours, and 30 minutes.
The time absolute value
Often, you do not want to wait a certain amount of time. Instead, you want the step to time out after passing a certain point relative to a date in the business model (for example, five days after a specific event occurs). In that case you can set the Time Absolute value, which is a Gosu expression that must resolve to a date.
TIMEOUT. For example,
the time-out never ends for the following expression, java.util.Date.CurrentDate + 1,
as the expression always evaluates to the future.Creating a timeout branch
You use the Workflows editor to define a Timeout branch. To access the
Timeout branch dialog,
right-click the starting step and select New Timeout from the menu. You
must enter either a time absolute expression or a time delta value. This
dialog contains the following fields:
Field |
Description |
|---|---|
Branch ID |
Name you choose for this branch. |
From |
Automatically generated. Workflow step ID of the beginning point of the branch. |
To |
Workflow step ID of the ending point of the branch. |
Time Delta |
Time to wait, starting from the time the Workflow instance successfully enters the step. |
Time Absolute |
Gosu expression that must resolve to a fixed date. |
After you create the branch, click on the link that runs between the two steps. You see the following fields:
Field |
Description |
|---|---|
Branch ID |
Automatically generated. |
From |
Automatically generated. Workflow step ID of the beginning point of the branch. |
To |
Workflow step ID of the ending point of the branch. |
Arrow Visible |
Show an arrow head on the branch line to indicate direction. |
Time Delta |
Time to wait, starting from the time the Workflow instance successfully enters the step. |
Time Absolute |
Gosu expression that must resolve to a fixed date. |
Execution |
Gosu code to execute if the workflow takes this branch. |
