If you know that a workflow has to wait for a response from an outside source for a predictable time, you can implement it as a timer-based long-running workflow. A timer-based long-running workflow waits until a given time and date before resuming.
You implement a workflow as a timer-based long-running workflow by using the Waiting timer element.
Prerequisites
- Create a workflow.
- Open the workflow for editing in the workflow editor.
- Add some elements to the workflow schema.
Procedure
- Drag a Waiting timer element from the Generic menu in the left pane to the workflow schema, and position it where you want to suspend the workflow run.
If you implement a scriptable task to calculate the time and date, the scriptable task element must precede the
Waiting timer element.
- Click the Waiting timer element.
- Enter a description of the reason for implementing the timer in the Details properties tab in the right pane.
- Click the Inputs tab.
The
timer.date parameter appears in the list of variables.
- Bind the timer.date parameter to an appropriate Date object.
- Select a predefined Date object from the proposed list, for example one defined by a Scriptable task element elsewhere in the workflow.
- Alternatively, create a Date object that sets a specific date and time for the workflow to await.
- (Optional) Create a Date object that sets a specific date and time that the workflow awaits.
- Click the Select variable text box, and then click Create New.
The
New Variable dialog box appears.
- Enter a name and description for the variable.
- Click the Value text box to set the variable value.
A calendar appears.
- Use the calendar to set a date and time at which to restart the workflow.
- Click Create.
- Click Save and confirm your selection.
Results
You defined a timer that suspends a timer-based long-running workflow until a set time and date.
What to do next
You can create a long-running workflow that waits for a trigger event before continuing.