AnsweredAssumed Answered

How can add a variables when start a new process via java rest api?

Question asked by swwong9 on Sep 11, 2018

Hi,

 

I am new for activiti rest api. I can use the java rest api to create new process without variables by GitHub - Alfresco/activiti-client-sdk. SDK. However, when add new variables to new process. Then, it will response 404 error code

 

The code is shown as following:

 

ProcessInstanceRepresentation result = new ProcessInstanceRepresentation();
ProcessInstanceAPI processAPI = client.getProcessInstanceAPI();
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("CreateDate", "2017-08-11 15:23");

 

CreateProcessInstanceRepresentation newProcess =
new CreateProcessInstanceRepresentation("poc:1:7504","new process",variables,strOutcome);


Response<ProcessInstanceRepresentation> response = processAPI.startNewProcessInstance(newProcess).execute();

How can i create the variables when create new process?

 

And how can i retrieve the variables when call taskapi by filterTasks? Thanks

Outcomes