Please rate how useful you found this document: 
Average: 2.3 (3 votes)

Case Scheduler Endpoints

The current methods implemented for the case scheduler resources in the ProcessMaker API designer are listed below:

Case Scheduler Resources

NameDescriptionType Value
sch_uidCase scheduler UIDStringString with the case scheduler UID
sch_optionOption where the period of time when the case will be active can be configured.Number1. Daily 2. Weekly 3. Monthly 4. One time only 5. Every
sch_nameCase scheduler nameStringString
sch_del_user_nameUsernameStringString
sch_del_user_passUser passwordStringString
tas_uidTask UIDStringAlphanumeric string
sch_start_timeStart time of the taskDateHH: MM.
sch_start_dateStart date of the taskDateYYYY-mm-dd.
sch_every_daysThe case scheduler will trigger every number of days set here.IntegerInteger
sch_week_daysWeekdaysInteger1.Monday 2.Tuesday 3.Wednesday 4.Thursday 5.Friday 6.Saturday 7.Sunday
The days of the week separated by a pipeline. E.g. 1|2|3
sch_start_dayInitial optionInteger1. Day of month or 2. The day.
sch_start_day_opt_1Day of the monthInteger1 to 31.
sch_start_day_opt_2Compound dataStringTwo items of data separated by pipeline. The first item of data: 1.First 2.Second 3.Third 4.Fourth 5.Last. The second item of data:d 1.Monday 2.Tuesday 3.Wednesday 4.Thursday 5.Friday 6.Saturday 7.Sunday. E.g. 1|7
sch_monthsMonthsIntegerE.g. Separated by pipeline 1|2|3
sch_end_dateEnd date of the taskDateYYYY-mm-dd.
sch_repeat_everyHours when the case scheduler will be repeatedDateHH. MM.
sch_repeat_untilRepeat untilStringString
sch_repeat_stop_if_runningStop whenStringString
case_sh_plugin_uidPlugin UIDStringString
sch_time_next_runNext execution dateDateYYYY-mm-dd HH:MM:SS.
sch_last_run_timeLast execution dateStringYYYY-mm-dd HH:MM:SS.
sch_stateCurrent statusStringString
sch_last_statePrevious statusStringString
usr_uidCurrently logged userStringString

Get Case Schedulers List: GET project/{prj_uid}/case-schedulers

Gets the list of the case schedulers in a project.

GET /api/1.0/{workspace}/project/{prj_uid}/case-schedulers

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Result:

TypeDescription
arrayReturns an array of objects containing information about the case schedulers.

Example:

Response

 200 (OK)
 [
  {
    "sch_uid": "32034912252d93011706986023277342",
    "sch_name": "Test scheduler POST",
    "sch_del_user_name": "admin",
    "sch_del_user_uid": "00000000000000000000000000000001",
    "pro_uid": "1265557095225ff5c688f46031700471",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_time_next_run": "2014-01-17 18:00:00",
    "sch_last_run_time": "2014-01-16 18:00:00",
    "sch_state": "ACTIVE",
    "sch_last_state": "CREATED",
    "usr_uid": "00000000000000000000000000000001",
    "sch_option": "1",
    "sch_start_time": "2014-01-17 18:00:00",
    "sch_start_date": "2014-01-19 00:00:00",
    "sch_days_perform_task": "1|1",
    "sch_every_days": "0",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19 00:00:00",
    "sch_repeat_every": "1",
    "sch_repeat_until": "1",
    "sch_repeat_stop_if_running": "0",
    "case_sh_plugin_uid": null
  },
  {
    "sch_uid": "32034912252d93011706986023277342",
    "sch_name": "Test scheduler POST 2",
    "sch_del_user_name": "admin",
    "sch_del_user_uid": "00000000000000000000000000000001",
    "pro_uid": "1265557095225ff5c688f46031700471",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_time_next_run": "2014-01-17 18:00:00",
    "sch_last_run_time": "2014-01-16 18:00:00",
    "sch_state": "ACTIVE",
    "sch_last_state": "CREATED",
    "usr_uid": "00000000000000000000000000000001",
    "sch_option": "1",
    "sch_start_time": "2014-01-17 18:00:00",
    "sch_start_date": "2014-01-19 00:00:00",
    "sch_days_perform_task": "1|1",
    "sch_every_days": "0",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19 00:00:00",
    "sch_repeat_every": "1",
    "sch_repeat_until": "1",
    "sch_repeat_stop_if_running": "0",
    "case_sh_plugin_uid": null
  }
 ]

Get Case Scheduler: GET project/{prj_uid}/case-scheduler/{sch_uid}

Gets a specified case scheduler.

GET /api/1.0/{workspace}/project/{prj_uid}/case-scheduler/{sch_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
sch_uidStringCase scheduler UID

Result:

TypeDescription
objectReturns a case scheduler object

Example:

Response

 200 (OK)
 {
    "sch_uid": "32034912252d93011706986023277342",
    "sch_name": "Test scheduler POST 2",
    "sch_del_user_name": "admin",
    "sch_del_user_uid": "00000000000000000000000000000001",
    "pro_uid": "1265557095225ff5c688f46031700471",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_time_next_run": "2014-01-17 18:00:00",
    "sch_last_run_time": "2014-01-16 18:00:00",
    "sch_state": "ACTIVE",
    "sch_last_state": "CREATED",
    "usr_uid": "00000000000000000000000000000001",
    "sch_option": "1",
    "sch_start_time": "2014-01-17 18:00:00",
    "sch_start_date": "2014-01-19 00:00:00",
    "sch_days_perform_task": "1|1",
    "sch_every_days": "0",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19 00:00:00",
    "sch_repeat_every": "1",
    "sch_repeat_until": "1",
    "sch_repeat_stop_if_running": "0",
    "case_sh_plugin_uid": null
 }

Create Case Scheduler: POST project/{prj_uid}/case-scheduler

Creates a new Case Scheduler.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

POST /api/1.0/{workspace}/project/{prj_uid}/case-scheduler

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID

Required Fields:

NameTypeDescription
sch_optionNumberThe period of time the case scheduler will be activated in the case can be set with this option.
sch_start_time (Mandatory when sch_option=1,2,3, or 4)DateTask start time
sch_start_date (Mandatory when sch_option=1,2,3, or 4)DateTask start date
sch_week_days (Mandatory when sch_option=2)IntegerDays of the week (1-7, they may be separated by a pipeline)
sch_start_day (Mandatory when sch_option=3)IntegerDays of the week (1. Day of the month, 2. The day)
sch_start_day_opt_1 (Mandatory when sch_start_day=1)IntegerDays of the month (1-30)
sch_start_day_opt_2 (Mandatory when sch_start_day=2)IntegerCompound data. (Check their definitions in the main table)
sch_months (Mandatory when sch_option=3)IntegerMonths
sch_end_date (Mandatory when sch_option=1,2 or 3)DateEnd date of the task
sch_repeat_every (Mandatory when sch_option=5)DateHours when the case scheduler will be repeated
sch_nameStringCase scheduler name
sch_del_user_nameStringCase scheduler username
tas_uidStringTask UID

Optional Fields:

NameTypeDescription
sch_del_user_passStringCase scheduler password
sch_repeat_untilStringRepeat until
sch_repeat_stop_if_runningIntegerStop when
case_sh_plugin_uidStringPlugin UID
sch_stateStringCurrent status
sch_last_stateStringPrevious status

Result:

TypeDescription
objectReturns an object containing information about the new case scheduler.

Example:

Request

 Content-Type: application/json
 {
    "sch_option": "3",
    "sch_name": "Test scheduler POST",
    "sch_del_user_name": "admin",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_start_time": "15:00",
    "sch_start_date": "2014-01-16",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_start_day_opt_1": "1",
    "sch_start_day_opt_2": "1|2",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19",
    "sch_repeat_every": "22.00"
 }

Response

 201 (Created)
 {
    "sch_uid": "32034912252d93011706986023277342",
    "sch_name": "Test scheduler POST 2",
    "sch_del_user_name": "admin",
    "sch_del_user_uid": "00000000000000000000000000000001",
    "pro_uid": "1265557095225ff5c688f46031700471",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_time_next_run": "2014-01-17 18:00:00",
    "sch_last_run_time": "2014-01-16 18:00:00",
    "sch_state": "ACTIVE",
    "sch_last_state": "CREATED",
    "usr_uid": "00000000000000000000000000000001",
    "sch_option": "1",
    "sch_start_time": "2014-01-17 18:00:00",
    "sch_start_date": "2014-01-19 00:00:00",
    "sch_days_perform_task": "1|1",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19 00:00:00",
    "sch_repeat_every": "22.00",
    "sch_repeat_until": "",
    "sch_repeat_stop_if_running": "0",
    "case_sh_plugin_uid": null
 }

Update Case Scheduler: PUT project/{prj_uid}/case-scheduler/{sch_uid}

Updates a Case Scheduler.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

PUT /api/1.0/{workspace}/project/{prj_uid}/case-scheduler/{sch_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
sch_uidStringCase scheduler UID

Required Fields:

NameTypeDescription
sch_optionNumberThe period of time the case scheduler will be activated in the case can be set with this option.
sch_nameStringCase scheduler name
sch_del_user_nameStringCase scheduler username
tas_uidStringTask UID
sch_stateStringCase scheduler status
sch_start_time (Mandatory when sch_option=1,2,3, or 4)DateTask start time
sch_start_date (Mandatory when sch_option=1,2,3, or 4)DateTask start date
sch_week_days (Mandatory when sch_option=2)IntegerDays of the week (1-7, they may be separated by a pipeline)
sch_start_day (Mandatory when sch_option=3)IntegerDays of the week (1. Day of the month, 2. The day)
sch_start_day_opt_1 (Mandatory when sch_start_day=1)IntegerDays of the month (1-30)
sch_start_day_opt_2 (Mandatory when sch_start_day=2)IntegerCompound data. (View their definitions in the main table)
sch_months (Mandatory when sch_option=3)IntegerMonths
sch_end_date (Mandatory when sch_option=1,2 or 3)DateEnd date of the task
sch_repeat_every (Mandatory when sch_option=5)DateHours when the case scheduler will be repeated

Optional Fields:

NameTypeDescription
sch_del_user_passStringCase scheduler password
sch_repeat_untilStringRepeat until
sch_repeat_stop_if_runningIntegerStop when
case_sh_plugin_uidStringPlugin UID
sch_last_stateStringPrevious status

Result:

TypeDescription
objectReturns an object containing new information about the case scheduler.

Example:

Request

 Content-Type: application/json
 {
    "sch_name": "Test scheduler PUT",
    "sch_del_user_name": "admin",
    "sch_del_user_pass": "admin",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_start_time": "15:00",
    "sch_start_date": "2014-01-16",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_start_day_opt_1": "1",
    "sch_start_day_opt_2": "1|2",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12"
    "sch_end_date": "2014-01-19",
    "sch_repeat_every": "11.00",
    "sch_state": "ACTIVE"
    "sch_option": "1"
 }

Response

 200 (OK)
 {
    "sch_uid": "32034912252d93011706986023277342",
    "sch_name": "Test scheduler POST 2",
    "sch_del_user_name": "admin",
    "sch_del_user_pass": "7a5a743821232f297a594a0e4a801fc3",
    "sch_del_user_uid": "00000000000000000000000000000001",
    "pro_uid": "1265557095225ff5c688f46031700471",
    "tas_uid": "46941969352af5be2ab3f39001216717",
    "sch_time_next_run": "2014-01-17 18:00:00",
    "sch_last_run_time": "2014-01-16 18:00:00",
    "sch_state": "ACTIVE",
    "sch_last_state": "CREATED",
    "usr_uid": "00000000000000000000000000000001",
    "sch_option": "1",
    "sch_start_time": "2014-01-17 18:00:00",
    "sch_start_date": "2014-01-19 00:00:00",
    "sch_days_perform_task": "1|1",
    "sch_week_days": "1|2|3|4|5|6|7",
    "sch_start_day": "1",
    "sch_months": "1|2|3|4|5|6|7|8|9|10|11|12",
    "sch_end_date": "2014-01-19 00:00:00",
    "sch_repeat_every": "1",
    "sch_repeat_until": "1",
    "sch_repeat_stop_if_running": "0",
    "case_sh_plugin_uid": null
 }

Delete Case Scheduler: DELETE project/{prj_uid}/case-scheduler/{sch_uid}

Deletes a Case Scheduler.

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/project/{prj_uid}/case-scheduler/{sch_uid}

Parameters:

NameTypeDescription
workspaceStringWorkspace name
prj_uidStringProject UID
sch_uidStringCase scheduler UID

Result:

TypeDescription
emptyNo return

Example:

Response

  200 (OK)