ServletProcessEngine_REST - pdvrieze/ProcessManager GitHub Wiki

REST methods for nl.adaptivity.process.engine.servlet.ServletProcessEngine

Method HTTP Path Description
getProcesModelRefs GET /processModels? Get the list of all process models in the engine.
getProcessModel GET /processModels/${handle}? Get the full process model content for the model with the given handle.
updateProcessModel POST /processModels/${handle}? Update the process model with the given handle.
postProcessModel POST /processModels? Add a process model to the system.
renameProcess POST /processModels/${handle}? Rename the given process model.
deleteProcess DELETE /processModels/${handle}? Delete the process model.
startProcess POST /processModels/${handle}?op=newInstance Create a new process instance and start it.
getProcesInstanceRefs GET /processInstances? Get a list of all process instances owned by the current user.
getProcessInstance GET /processInstances/${handle}? Get the given process instance.
tickleProcessInstance GET /processInstances/${handle}?op=tickle Cause the process instance state to be re-evaluated.
cancelProcessInstance DELETE /processInstances/${handle}? Cancel the process instance execution.
getProcessNodeInstance GET /tasks/${handle}? Get the information for a specific task.
updateTaskState POST /tasks/${handle}?state Update the state of a task.
finishTask POST /tasks/${handle}?state=Complete finish a task.

Get the list of all process models in the engine. This will be limited to user owned ones. The list will contain only a summary of each model including name,

Path: /processModels

Actual parameters

Parameter Param type Data Type Description
return SerializableList

Path: /processModels/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the process model
user PRINCIPAL Principal The user whose permissions are verified
return ProcessModelImpl The process model

Path: /processModels/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The model handle
processUpload ATTACHMENT DataHandler The actual new model
user PRINCIPAL Principal The user performing the update. This will be verified against ownership and permissions
return ProcessModelRef A reference to the model. This may include a newly generated uuid if not was provided.

Path: /processModels

Actual parameters

Parameter Param type Data Type Description
processUpload ATTACHMENT DataHandler The process model to add.
owner PRINCIPAL Principal The creator/owner of the model.
return ProcessModelRef A reference to the model with handle and a new uuid if none was provided.

Path: /processModels/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle to the model
name QUERY String The new name
user PRINCIPAL Principal The user performing the action.
return void

Path: /processModels/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the process model to delete
user PRINCIPAL Principal A user with permission to delete the model.
return void

Path: /processModels/${handle}

Mandatory parameters

These will determine the actual method invoked, more specific over less specific.

Kind content Explanation
query op=newInstance Must be set on the GET url or POST body

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the process to start.
name QUERY String The name that will allow the user to remember the instance. If null a name will be assigned. This name has no semantic meaning.
uuid QUERY String
owner PRINCIPAL Principal The owner of the process instance. (Who started it).
return XmlHandle A handle to the process

Get a list of all process instances owned by the current user. This will provide

Path: /processInstances

Actual parameters

Parameter Param type Data Type Description
owner PRINCIPAL Principal The user.
return Collection A list of process instances.

Path: /processInstances/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the instance.
user PRINCIPAL Principal A user with permission to see the model.
return ProcessInstance The full process instance.

Cause the process instance state to be re-evaluated. For failed service

Path: /processInstances/${handle}

Mandatory parameters

These will determine the actual method invoked, more specific over less specific.

Kind content Explanation
query op=tickle Must be set on the GET url or POST body

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the instance
user PRINCIPAL Principal A user with appropriate permissions.
return String A string indicating success.

Cancel the process instance execution. This will cause all aspects of the

Path: /processInstances/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The instance to cancel
user PRINCIPAL Principal A user with permission to cancel the instance.
return ProcessInstance The instance that was cancelled.

Path: /tasks/${handle}

Actual parameters

Parameter Param type Data Type Description
handle VAR long The handle of the task
user PRINCIPAL Principal A user with appropriate permissions
return XmlProcessNodeInstance the task

Path: /tasks/${handle}

Mandatory parameters

These will determine the actual method invoked, more specific over less specific.

Kind content Explanation
query state Must be set on the GET url or POST body

Actual parameters

Parameter Param type Data Type Description
handle VAR long Handle of the task to update
state QUERY IProcessNodeInstance.NodeInstanceState The new state
user PRINCIPAL Principal A user with appropriate permissions
return IProcessNodeInstance.NodeInstanceState the new state of the task. This may be different than requested, for example due to engine semantics. (either further, or no change at all)

finish a task. Process aware services will need to call this to signal

Path: /tasks/${handle}

Mandatory parameters

These will determine the actual method invoked, more specific over less specific.

Kind content Explanation
query state=Complete Must be set on the GET url or POST body

Actual parameters

Parameter Param type Data Type Description
handle VAR long Handle of the task to update
payload QUERY Node An XML document that is the "result" of the service.
user PRINCIPAL Principal A user with appropriate permissions
return IProcessNodeInstance.NodeInstanceState the new state of the task. This may be different than requested, for example due to engine semantics. (either further, or no change at all)

Legend

There are various parameter types available RestParam.ParamType:

Type Description
QUERY This will use both POST and GET parameters, where GET overrides POST.
POST The parameter will be resolved through a post body only. The body should be multipart/form-data or application/x-www-form-urlencoded.
GET The parameter will be resolved through the request query only.
XPATH The request body is an xml document and the parameter is the result of evaluating the xpath expression on it. Requires setting {@link #xpath()}
VAR The parameter is resolved through a variable defined in the {@link RestMethod} annotation on the method.
BODY The parameter is the entire request body. This will be processed using the regular unmarshalling algorithms.
ATTACHMENT The parameter is the request body, but the method will handle it itself.
PRINCIPAL The parameter is fulfilled by the server by providing the logged in user.
⚠️ **GitHub.com Fallback** ⚠️