-
1. Re: Getting a list of the process variables in a process ins
wfenthusiast Jun 1, 2007 5:15 AM (in response to lachelt)You can get to the variables using the
Map processVars = processInstance.getContextInstance().getVariables();
-
2. Re: Getting a list of the process variables in a process ins
ricardomarques Jun 1, 2007 5:36 AM (in response to lachelt)I get a null value on that value, is there some obvious reason on that may happend ?
-
3. Re: Getting a list of the process variables in a process ins
kukeltje Jun 1, 2007 6:55 AM (in response to lachelt)Seems overkill.... correct, seems, since it realy isn't. Writing your own hibernate queries is much more complex.
-
4. Re: Getting a list of the process variables in a process ins
lachelt Jun 1, 2007 10:07 AM (in response to lachelt)"wfenthusiast" wrote:
You can get to the variables using theMap processVars = processInstance.getContextInstance().getVariables();
Well that certainly seems like it should do what I want... but like Ricardo I also get a null value back from this. Can someone please shed light on why this is the case?
kukeltje - Sounds like you are saying that the way I am doing it is the right way (and only way other than my own hibernate queries)? This still doesn't give me access to a list of the variables? How can I do that?
Thanks for the quick responses.
-Jon -
5. Re: Getting a list of the process variables in a process ins
lachelt Jun 1, 2007 10:28 AM (in response to lachelt)I think I have answered my own question.
What wfenthusiast told me to do works fine - if there is at least one variable in the process instance. If there are not any variables, then the map seems to come back null (rather than an empty Map).
This seems like a defect to me... but since the method isn't really documented it is not clear what the expected behavior is. -
6. Re: Getting a list of the process variables in a process ins
kukeltje Jun 1, 2007 11:38 AM (in response to lachelt)please file a jira issue for this so we can return an empty map (or just null) but at least add something to the javadoc to make it more clear
Ronald -
7. Re: Getting a list of the process variables in a process ins
ricardomarques Jun 4, 2007 7:33 AM (in response to lachelt)I have discovered an working example on taskbean.java on jbpm 3.1 starters kit (web console). With that code it work's fine.
-
8. Re: Getting a list of the process variables in a process ins
gubespam Dec 22, 2009 12:23 PM (in response to wfenthusiast)How would this be done in jBPM 4? -
9. Re: Getting a list of the process variables in a process ins
jbarrez Dec 28, 2009 5:43 AM (in response to gubespam)Use the executionService:
Set<String> getVariableNames(String executionId);
and
Map<String, Object> getVariables(String executionId, Set<String> variableNames);