AnsweredAssumed Answered

Set process variables before process start

Question asked by jolo_ on Aug 23, 2013
Latest reply on Aug 25, 2013 by one87
What I have:
1. Process model that looks like: process_start –> service_task –> ..
2. The process starts in startProcessMethod()


What the problem:
I want to pass objects, that are created in startProcessMethod(), to service_task method.
BUT to put objects into process context I should firstly to start it:

startProcessMethod() {
……..
   Object obj = new Object();
   ProcessInstance newHiringProcess = runtimeService.startProcessInstanceByKey("myProcess");
   newHiringProcess.getProcessVariables().put("obj", obj);
…….
}


Questions:
1. Can I set process variables before process start?
2. If not, how can I pass variables from startProcessMethod() method into service_task?

Outcomes