Let the platform do the work

Troubleshooting Wait Events in Process Definitions

Overview

Process definitions created in SugarBPM may contain Wait events which pause the execution of a process by a certain time interval. If a Wait event or supporting mechanism is not properly configured, the flow will be halted indefinitely, thereby stopping the flow of the process. This article covers some common reasons that a process may get stuck on a Wait event.

Symptom

This article helps troubleshoot processes that have unexpectedly stopped on a Wait event. Symptomatic processes usually take one of two forms:

  • The process stops with an Error status upon reaching a Wait event.
  • The process remains in the In-Progress status without moving beyond the Wait event after the configured time elapses.

As an example, the following process is listed on the Process Management list view with an error. By viewing the process's preview, we can see that the error occurred when it reached a Wait event because that is the last element shown in color. Grayed out elements have not yet occurred in the process flow.
error-process

Note: If the Wait event is still grayed out, then the process has not yet encountered it. In this circumstance, an element that occurs before the Wait event is failing and should be checked.

Resolution

Scheduler Job Not Running

To evaluate and execute timed Wait events, process definitions rely upon the SugarBPM™ Scheduled Job. This scheduler will check for any active time-based process events in a pending state. If any processes meet this criterion, the scheduler will ensure the process flow continues.

Note: This scheduler was formerly titled "Advanced Workflow Scheduled Job".

Use the following steps to confirm the SugarBPM™ Scheduled Job is working properly:

  1. Navigate to Admin > Scheduler and click on the SugarBPM™ Scheduled Job.
  2. Verify that the status is set to "Active" and the interval is set to "As often as possible". You can also see the last time the scheduler ran next to "Last Successful Run".
    aw-scheduled-job
  3. If necessary, click "Edit" to adjust these settings. You must uncheck the Advanced Options field to modify the scheduler's interval.
    aw-scheduler-edit
  4. Click "Save" to finalize any changes.
  5. After saving or canceling the edit, check the Job Log at the bottom of the scheduler's detail view. You should see regular and up-to-date entries of when the scheduler last completed.

If there are no entries or no recent entries, ensure that cron is running on your instance using the Troubleshooting Cron and Schedulers article. Please note that Sugar instances hosted on Sugar's cloud service have the cron scheduler set up automatically, but it must be configured for on-site Sugar instances. For more information on configuring schedulers, please refer to the Setting Up the Scheduler article.

Confirming the Wait Event Settings

If the Wait event settings are not properly configured, an error will interrupt any running processes started by the process definition. Navigate to the design view for the affected process definition and right-click on the Wait event to select the Settings option. For more information on wait events, please refer to the Process Definitions documentation. Confirm that "Duration" or "Fixed Date" is selected and the corresponding criteria are complete.

Duration:
duration

Fixed Date:
fixeddate

If the criteria are empty next to the active option, the Wait event will cause an error in the process.

Checking the Database

Customers hosting an on-site Sugar instance can check the database for more information on the status of the affected process. If the Wait event has properly triggered, the database table pmse_bpm_flow should display the corresponding entries. Run the following query on your database, replacing <process_number> with the actual value in the Process Number field for the stalled process:

  SELECT cas_sugar_object_id,cas_id, cas_flow_status,cas_due_date
FROM 'pmse_bpm_flow' 
WHERE 'cas_id' = <process_number> AND 'cas_flow_status' 
LIKE 'SLEEPING'

You should get a result similar to the following, where the cas_due_date value shows what time the Wait event's timer will expire.
cas due date

If the cas_due_date value is in the future, then wait until that date and time to see if the process resumes. If the cas_due_date value occurred in the past, run cron and the process should progress beyond the Wait event.