How do I get all process variables in a servicetask
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011 05:16 AM
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
or another way I could imagine is:
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
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 thispublic void myMethod(Map<String, Object> processVariables);
or another way I could imagine is:
#{myService.myMethod(processid)}
and my java code would look like thispublic 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
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011 01:08 AM
I have the same problem.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011 03:22 AM
You could just pass the execution:
The execution passed is a DelegateExecution, from which you can request all variables you might need
#{myService.myMethod(execution)}
The execution passed is a DelegateExecution, from which you can request all variables you might need
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011 07:42 AM
Thank you frederikheremans
it was exactly what I was looking for
it was exactly what I was looking for