Work

The work app is our generic extension to the workflow app. The Flow database model is a link to the Flowable process.

API

Add the apiUrl variable to the start process of the workflow. This will add the URL of the API to the variables for the process.

Create Workflow

Use a script task to set the following parameters:

var ObjectMapper = com.fasterxml.jackson.databind.ObjectMapper;

var data = {};
data.processKey = "navigatorTrainingTwo";
data.processId = execution.getProcessInstanceId();
# comma separated list of user IDs e.g. '1,2,3'
data.userPks = execution.getVariable("userPk");

var httpTaskData = JSON.stringify(data);
var json = new ObjectMapper().readTree(httpTaskData);
execution.setVariable("httpTaskData", json);]]></script>

Note

Additional variables will be added to the new workflow (if they are included in the start event).

POST to this URL in an HTTP task:

${apiUrl}/workflow/

Refresh Workflow

Update the workflow variables. Useful for long running process where information may change over time e.g. the manager for an employee.

PUT to this URL in an HTTP task:

${apiUrl}/refresh-variables/${execution.getProcessInstanceId()}/