ing variables before starting the process businessProcess.startProcessByKey("billingProcess"); conversation.end();
2nd unit of work ("perform a user task"): conversation.begin(); businessProcess.startTask(id); // now we have associated a task with the current conversation ... // this allows us to retrieve and change process variables // and @BusinessProcessScoped beans businessProcess.setVariable("billingDetails", "someValue"); // these changes are cached in the conversation ... businessProcess.completeTask(); // now all changed process variables are flushed conversation.end();
NOTE: in the absence of a conversation, (non faces request, i.e. when processing a JAX-RS, JAX-WS, JMS, remote EJB or plain Servlet requests), the {@link BusinessProcess} bean associates with the current Request (see {@link RequestScoped @RequestScoped}).
NOTE: in the absence of a request, ie. when the activiti JobExecutor accesses {@link BusinessProcessScoped @BusinessProcessScoped} beans, the execution is associated with the current thread.
@author Daniel Meyer
@author Falko Menge