AnsweredAssumed Answered

Setting process variable at run time

Question asked by niyas.m on Jul 26, 2016
Latest reply on Jul 27, 2016 by niyas.m

  I am new  to Activiti . I would like to know how to set process variables to an existing process instance ( already instantiated ) at run time. The use case to provide condition value for an exclusive gateway following an user task completion .

I tried the following methods .

1. runtimeService.setVariable(processInstance.getId(),"variable","value");

2. Upon completing the task prior to the exclusive gateway
      taskService.complete(tasks.get(0).getId(), vars);

  (The conditional value for the gateway will be known only at this point in time , ie task completion, not prior to process instantiation)

Both are not working .

The only thing working is when i pass process variables as part of process instantiation.

How to accomplish this ? Any working examples / workarounds ?

Please help