Workflows

Workflow objects are exposed under the /openidm/workflow context path. IDM provides access to the workflow module over REST, as listed in the following table:

URIHTTP OperationDescription
/openidm/workflow/execution?_action=messagePOSTInvokes a message event. When the processVariables field is non-null the message is sent synchronously; otherwise, asynchronously.
/openidm/workflow/execution?_action=signalPOSTInvokes a signal event. When the processVariables field is non-null the message is sent synchronously; otherwise, asynchronously.
/openidm/workflow/execution?_action=triggerPOSTTriggers an execution asynchronously; for example, to continue a process instance that is waiting at a Receive Task. When the transientVariables field is non-null the trigger is sent synchronously; otherwise, asynchronously.
/openidm/workflow/execution?_queryFilter=trueGETQueries the executions. Only supports _queryFilter=true.
/openidm/workflow/execution?_queryId=filtered-query&filterGETReturns a list of executions, based on the specified query filter.
  • executionId

  • executionParentId

  • processDefinitionCategory

  • processDefinitionId

  • processDefinitionKey

  • processDefinitionName

  • processDefinitionVersion

  • processInstanceBusinessKey

  • processInstanceId

  • activityId

  • signalName

  • messageName

  • startedBefore

  • startedAfter

  • startedBy

  • processVariableName

  • processVariableValue

  • processVariableValueType

  • processVariableOperator

  • variableName

  • variableValue

  • variableValueType

  • variableOperator

/openidm/workflow/job?_queryFilter=trueGETQueries jobs. Only supports _queryFilter=true.
/openidm/workflow/job?_queryId=filtered-query&filterGETReturns a list of jobs, based on the specified query filter. You can't combine timersOnly=true with messagesOnly=true in the same query.
  • jobId

  • processDefinitionId

  • processInstanceId

  • executionId

  • timersOnly

  • messagesOnly

  • withException

  • exceptionMessage

  • dueAfter

  • dueBefore

/openidm/workflow/job/deadletter?_queryFilter=trueGETQueries dead-letter jobs. Only supports _queryFilter=true.
/openidm/workflow/job/deadletter?_queryId=filtered-query&filterGETReturns a list of dead-letter jobs, based on the specified query filter. You can't combine timersOnly=true with messagesOnly=true in the same query.
  • jobId

  • processDefinitionId

  • processInstanceId

  • executionId

  • timersOnly

  • messagesOnly

  • withException

  • exceptionMessage

  • dueAfter

  • dueBefore

/openidm/workflow/job/deadletter/id?_action=executePOSTExecutes a dead-letter job. If successful, runs as a normal job.
/openidm/workflow/job/deadletter/id?_action=stacktracePOSTDisplays the stacktrace for a dead-letter job that triggered an exception.
/openidm/workflow/job/deadletter/idDELETEDeletes a dead-letter job.
/openidm/workflow/job/deadletter/idGETReads a dead-letter job.
/openidm/workflow/job/id?_action=executePOSTForces the synchronous execution of a job, even if it is suspended.
/openidm/workflow/job/id?_action=stacktracePOSTDisplays the stacktrace for a job that triggered an exception.
/openidm/workflow/job/idDELETEDeletes a job.
/openidm/workflow/job/idGETReads a job.
/openidm/workflow/model?_action=validate_bpmnPOSTValidates a BPMN 2.0 XML file.
/openidm/workflow/modelPOSTCreates a new model. Omitting the bpmnXML field generates a template. Also see the deploy action.
/openidm/workflow/model?_queryFilter=queryGETQueries the existing models. bpmnXML and resourceMap fields are omitted from results by default.
openidm/workflow/model/id?_action=deployPOSTDeploys a model and creates associated process definitions. Existing process definition IDs will be returned if duplicate model detected. See workflow/processdefinition endpoints.
/openidm/workflow/model/id?_action=list_deploymentsPOSTLists process definition IDs for model deployments.
/openidm/workflow/model/idDELETEDeletes a model.
/openidm/workflow/model/idGETReads a model.
/openidm/workflow/model/idPUTUpdates a model.
/openidm/workflow/processdefinition?_queryFilter=trueGETQueries the process definitions. Only supports _queryFilter=true. Use the READ endpoint to get form-related fields.
/openidm/workflow/processdefinition?_queryId=filtered-query&filterGETReturns a list of workflow process definitions, based on the specified query filter.
  • version

  • deploymentId

  • category

  • key

  • name

  • processDefinitionResourceName

/openidm/workflow/processdefinition/idDELETEDeletes a process definition.
/openidm/workflow/processdefinition/idGETReads a process definition with form-related fields included.
/openidm/workflow/processdefinition/procdefid/taskdefinition?_queryFilter=trueGETQueries the task definitions. Only supports _queryFilter=true.
/openidm/workflow/processdefinition/procdefid/taskdefinition/idGETReads a task definition.
/openidm/workflow/processinstancePOSTCreates a process instance. JSON request object must contain either the _processDefinitionId or _key fields, but not both. Additional JSON fields will be passed to the create-operation and utilized if applicable.
/openidm/workflow/processinstance?_queryFilter=trueGETQueries the process instances. Only supports _queryFilter=true.
/openidm/workflow/processinstance?_queryId=filtered-query&filterGETReturns a list of workflow process instances, based on the specified query filter.
  • processDefinitionId

  • processDefinitionKey

  • processInstanceBusinessKey

  • processInstanceId

  • superProcessInstanceId

  • finished

  • unfinished

  • involvedUserId

  • startUserId

  • startedAfter

  • startedBefore

/openidm/workflow/processinstance/history?_queryFilter=trueGETQueries the process instance history. Only supports _queryFilter=true.
/openidm/workflow/processinstance/history?_queryId=filtered-query&filterGETReturns a list of process instance history, based on the specified query filter.
  • processDefinitionId

  • processDefinitionKey

  • processInstanceBusinessKey

  • processInstanceId

  • superProcessInstanceId

  • finished

  • unfinished

  • involvedUserId

  • startUserId

  • startedAfter

  • startedBefore

/openidm/workflow/processinstance/history/idDELETEDeletes process instance history.
/openidm/workflow/processinstance/history/idGETReads process instance history. diagram field returned when defined and requested in _fields parameter.
/openidm/workflow/processinstance/id?_action=migratePOSTMigrates a process instance to a different process definition. To simulate the migration first, see the action validateMigration.
{
  "processDefinitionId": "string",
  "variables": {},
  "fromActivityIdMap": {
    "123": {
      "toActivityId": "string",
      "localVariables": {}
    }
  }
}
/openidm/workflow/processinstance/id?_action=validateMigrationPOSTSimulates a process instance migration (migrate action).
/openidm/workflow/processinstance/idDELETEDeletes a process instance.
/openidm/workflow/processinstance/idGETReads a process instance. diagram field returned when defined and requested in _fields parameter.
/openidm/workflow/taskinstance?_queryFilter=trueGETQueries the task instances. Only supports _queryFilter=true.
/openidm/workflow/taskinstance?_queryId=filtered-query&filterGETReturns a list of task instances, based on the specified query filter.
  • executionId

  • processDefinitionId

  • processDefinitionKey

  • processInstanceId

  • assignee

  • taskCandidateGroup

  • taskCandidateUser

  • name

  • owner

  • description

  • priority

  • unassigned

/openidm/workflow/taskinstance?_queryId=unassignedTaskQueryGETQueries unassigned task instances for which the authenticated user is authorized to assign.
/openidm/workflow/taskinstance/history?_queryFilter=trueGETQueries the task instance history. Only supports _queryFilter=true.
/openidm/workflow/taskinstance/history?_queryId=filtered-query&filterGETReturns a list of task instance history, based on the specified query filter.
  • executionId

  • processDefinitionId

  • processDefinitionKey

  • processInstanceId

  • assignee

  • taskCandidateGroup

  • taskCandidateUser

  • taskId

  • taskName

  • owner

  • description

  • finished

  • unfinished

  • processFinished

  • processUnfinished

  • priority

  • deleteReason

/openidm/workflow/taskinstance/history/idGETReads a task instance history.
/openidm/workflow/taskinstance/id?_action=claimPOSTAssigns a task to a userId.
/openidm/workflow/taskinstance/id?_action=completePOSTTo complete a task, supply the required task parameters, as specified in the BPMN 2.0 XML file.
/openidm/workflow/taskinstance/idDELETEDeletes a task instance.
/openidm/workflow/taskinstance/idGETReads a task instance.
/openidm/workflow/taskinstance/idPUTUpdates a task instance. Must include one or more supported fields in JSON payload:
  • assignee

  • description

  • name

  • owner

  • category

  • dueDate

  • priority

The following examples list the defined workflows. For a workflow to appear in this list, the corresponding workflow definition must be in the openidm/workflow directory:

curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request GET \
"http://localhost:8080/openidm/workflow/processdefinition?_queryId=query-all-ids"

Depending on the defined workflows, the output will be something like the following:

{
  "result": [
    {
      "_id": "contractorOnboarding:1:5"
    },
    {
      "_id": "contractorOnboarding:2:9"
    }
  ],
  "resultCount": 2,
  "pagedResultsCookie": null,
  "totalPagedResultsPolicy": "NONE",
  "totalPagedResults": -1,
  "remainingPagedResults": -1
}

The following example invokes a workflow named "myWorkflow". The foo parameter is given the value bar in the workflow invocation:

curl \
--header "Content-Type: application/json" \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request POST \
--data '{
  "_key":"contractorOnboarding",
  "foo":"bar"
}' \
"http://localhost:8080/openidm/workflow/processinstance?_action=create"
Read a different version of :