Overview

Cases Scheduler provides a way to automatically start new cases at specified times. Those cases can be programmed to be started depending on the user requirements (Daily, weekly, monthly, etc.). In order to configure the case scheduler is demanding to have an initial task defined. Note that the case scheduler ONLY starts cases, it does not execute any step inside the task.

Note: The Cases Scheduler has some limitations:

  1. When starting a new case, it automatically routes cases to the second task in the process, which means that it can only be used with processes which have a sequential routing rule between the initial and second tasks.
  2. The cases can only be started by users who are individually assigned to the initial task in the process, not by members of a group.

Case Scheduler List

To see a list of the scheduled timings for new cases to automatically start, open a Process and go to PROCESSES > CASES SCHEDULER:

Above the list, there are links to create new scheduled timings and search for scheduled timings:

  • New: Click this link to define a new Cases Scheduler.
  • Search: To filter the list of Case Schedulers, enter a text to search in the "Name" column and click the Search button. Note that the search is case insensitive and wildcards can not be used.

The options list are described as follows:

  • Name: Name of the Case Scheduler created.
  • Process: Name of the process where Case Scheduler is configured.
  • Task: Name of the task where case will be created. It always will be the first task of the process.
  • Time next run: Next time where Case Scheduler will be executed.
  • Last Time Run: It will display time in case of a previous execution.

Three options on the right side are:

  • ACTIVE/INACTIVE: Click this link to turn on or off the Case Scheduler. If set to INACTIVE, new cases won't be started by the Case Scheduler.
  • Edit: Click this link to edit the settings for the Case Scheduler.
  • Delete: Click this link to delete the Case Scheduler.

Note: When running a case with case scheduler, the user must initiate it from DRAFT, this status is established by default when case scheduler it's been used, because the first task to start a case with this property is a dummy task. From the second task and on, the status of the case will appear on the Inbox as usually.

Set the Case Scheduler

To set a new timing when cases are scheduled to automatically start, open a process and go to DESIGNER > CASES SCHEDULER to view the Case Scheduler List. In the upper left-hand corner, click on the New link to define a new Case Scheduler:

General Information:

  • User Name: Enter the username of a user who has rights to start the case because he/she is assigned to an initial task of the case.
  • Password: Enter the password for the user.

Note: If the user changes his/her password, then the case scheduler will stop working. For this reason, it is a good idea to create an imaginary user for the purpose of starting cases who won't change his/her password.

After entering the username and password, click the Test User button to verify that the specified user has rights to start the case and his/her password is correct. If the information is correct, the Properties for the Case Scheduler will appear below.

Properties:

  • Task: This dropdown box field has a list of task for the user registered.
  • Description: This field is to type the cases scheduler name
  • Perform this task: Select how often the case will be started:
Daily: Cases will be automatically started on a daily basis.
Weekly: Cases will be automatically started on a weekly basis.
Monthly: Cases will be automatically started on a monthly basis.
One time only: A case will be automatically started only once.
Every: A case will be created automatically EVERY hour. Also, it is possible to configure hour, minutes and seconds by dividing time, it means when an hour is set it is completed with .00, and if seconds need to be set just enter 0.01.

The option selected for the Perform this task property will determine which properties are displayed below.

For cases scheduled Daily:

  • Start Date: Select a date when the cases will begin to be scheduled.
  • End Date: Select a date when the cases will stop being scheduled. If no date is selected, then cases will continue being scheduled forever.
  • Execution Time: The time of day when the cases will be scheduled to start. Use a 24 hour clock, so 9:30am would be 09:30 and 5pm would be 17:00.

For cases scheduled Weekly:

  • Start Date: Select a date when the cases will begin to be scheduled.
  • End Date: Select a date when the cases will stop being scheduled. If no date is selected, then cases will continue being scheduled forever.
  • Execution Time: The time of day when the cases will be scheduled to start. Use a 24 hour clock, so 9:30am would be 09:30 and 5pm would be 17:00.
  • Select the day(s) of the week below: Select the days of the week when cases will automatically start.

For cases scheduled Monthly:

  • Start Date: Select a date when the cases will begin to be scheduled.
  • End Date: Select a date when the cases will stop being scheduled. If no date is selected, then cases will continue being scheduled forever.
  • Execution Time: The time of day when the cases will be scheduled to start. Use a 24 hour clock, so 5pm would be 17:00.
  • Select whether cases will be scheduled on a numerical day of the month or on the relative day of a specified week:
    • Day of Month: Selecting this option displays a textbox to enter the fixed number of the day of the month when the case will be scheduled.
    • The Day: Selecting this option displays two dropdown boxes to select the relative day of a specified week. In the first, select which week of the month: First, Second, Third, Fourth or Last. In the second dropdown box, select which day of the week: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday or Saturday.
  • Of the month(s): Select in which months cases will be automatically started.

For cases scheduled One time only:

  • Start date: Select a date when the cases will begin to be scheduled.
  • Execution time: The time of day when the cases will be scheduled to start. Use a 24 hour clock, so 9:30am would be 09:30 and 5pm would be 17:00.

For cases scheduled Every:

  • Execution time: The time of day when the cases will be scheduled to start. Use a hours, so 1.00 would be 1 hour or 0.01 would be 1 second.

Executing the Cases Scheduler

After defining the timing for the Cases Scheduler, the workflow/engine/bin/cron.php script has to be executed to initiate any pending cases. For testing purposes, this script can be executed manually from the command line, but for production use, the server running ProcessMaker should be configured to periodically execute this script as a cron job in Linux/UNIX or as a Scheduled Task in Windows. For more information, see Executing cron.php.

When a new case is started by the cron.php script, a message will appear on the command line:

$ php -f /opt/pm4260/workflow/engine/bin/cron.php
Processing workspace: workflow
* Resending emails............................................[DONE]
* Unpausing applications......................................[DONE]
* Calculating Duration........................................[DONE]
* Executing events............................................[PROCESSING]
* |- End Execution events.....................................[Processed 0]
* Executing the scheduled starting cases......................[PROCESSING]
 - Connecting webservice: http://192.168.1.100/sysworkflow/en/green/services/wsdl2
 - Logging as user admin.............OK+
 - Creating the new case.............OK+ CASE #3 was created!
- Routing the case #3..............OK+ Task 2(admin)
[DONE]

Finished 1 workspaces processed.

Cases Scheduler Log

To see a list of the cases which have been started by the Cases Scheduler, go to the ADMIN > Logs > Case Scheduler. The list of cases started by the Cases Scheduler can also be found by querying the wf_.LOG_CASES_SCHEDULER table.