AnsweredAssumed Answered

How do I get all process variables in a servicetask

Question asked by fan_42 on Sep 15, 2011
Latest reply on Sep 16, 2011 by fan_42
Hi

in the last task (a service task) of my process I want to collect most of the process variables in order complete the process.

Is there an implicit or default object I could use to pass it my method?

Example:
in the modeler I would have something like that

#{myService.myMethod(processVariables)}
and my java code would look like this
public void myMethod(Map<String, Object> processVariables);

or another way I could imagine is:

#{myService.myMethod(processid)}
and my java code would look like this

public void myMethod(String processId){
    runtimeService.getVariables(processId);
}

The question is do I need to put myself the processId in the workflow variables so that I can retrieve it or is there a natural way of doing this?

Thanks

Outcomes