AnsweredAssumed Answered

Saving Form Properties and variables when starting a process

Question asked by mf on Nov 10, 2014
Latest reply on Nov 18, 2014 by jbarrez
I want to save 'form properties' and 'variables' together when starting a process.
The first task after 'start event' is a script task, that uses a variable that is saved in starting the process.

I found two possible (not working) solutions:

1- Starting process with RuntimeService.startProcessInstanceById (with variables), then saving form properties with FormService.saveFormData: It's not possible, we have only FormService.saveFormData for tasks, not processInstances.

ProcessInstance startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables) ;
void saveFormData(String taskId, Map<String, String> properties);

2- Submitting form properties with FormService.submitStartFormData, then saving variables with RuntimeService.setVariables: It's not possible, FormService.submitStartFormData has no 'variables' argument. So it starts process without saving variables (and the script task will throw an exception).

ProcessInstance submitStartFormData(String processDefinitionId, String businessKey, Map<String, String> properties);
void setVariables(String executionId, Map<String, ? extends Object> variables);

What should i do?

Thanks in advance