-
1. Re: Use of jBPM variables in action handler fields
kukeltje Apr 28, 2009 3:19 AM (in response to swatis)in the actionclass run the 'subject' variable though the jBPM el parser. See unittests in the sourcecode how that can be done
-
2. Re: Use of jBPM variables in action handler fields
swatis Apr 28, 2009 4:01 AM (in response to swatis)No, that I know. I can use getContext().getVariable() to get the variables used in process instance. But here my question is how can I use varaibles in text content of element #{taskName}
I mean in subject element or any other element what is way to access variables? -
3. Re: Use of jBPM variables in action handler fields
kukeltje Apr 28, 2009 10:38 PM (in response to swatis)by reading what I stated before. Your variable contains the string you passed to it, including the #{.....} and by parsing it with the jBPM EL resolver it will be filled.
-
4. Re: Use of jBPM variables in action handler fields
swatis Apr 29, 2009 4:10 AM (in response to swatis)yes thats what expected right. but its not happening... :(...
-
5. Re: Use of jBPM variables in action handler fields
jbarrez Apr 29, 2009 4:17 AM (in response to swatis)I think you are understanding 100% what Ronald is explaining:
in you Action Handler class implementation, you can simply use the jBPM ExpressionEvaluator and try to get the variable from this object using the string you use between the #{}. This way, you can use your debugger, system.out, ... whatever works for you, without having to set the #{var} in the definition.
So conclusion: check out the JbpmExpressionEvaluator class. -
6. Re: Use of jBPM variables in action handler fields
jbarrez Apr 29, 2009 4:17 AM (in response to swatis)I think you are understanding 100% what Ronald is explaining:
And this should be ofc 'not understanding 100%' ... -
7. Re: Use of jBPM variables in action handler fields
swatis Apr 29, 2009 4:32 AM (in response to swatis)I got what he said thats what I have used
String evaluate(String expression) { if (expression==null) { System.out.println("exp is null"); return null; } VariableResolver variableResolver = JbpmExpressionEvaluator.getUsedVariableResolver(); System.out.println("resolver is " + variableResolver); if (variableResolver!=null) { return (String) JbpmExpressionEvaluator.evaluate(expression, executionContext, variableResolver, null); }
-
8. Re: Use of jBPM variables in action handler fields
kukeltje Apr 29, 2009 6:54 AM (in response to swatis)and this does not work? Or does it now?
-
9. Re: Use of jBPM variables in action handler fields
swatis Apr 29, 2009 8:49 PM (in response to swatis)yes i get spaces instead of value after invoking this method
-
10. Re: Use of jBPM variables in action handler fields
kukeltje Apr 30, 2009 1:10 AM (in response to swatis)can you make a full but small unittest with everything embedded and post that here