[jboss-user] [JBoss jBPM] - Variable resolver
chawax
do-not-reply at jboss.com
Mon Jun 11 04:43:06 EDT 2007
Hi,
I am a newbie to jBPM and I need help about variable resolvers.
I wrote an Action handler with an "idDemande" parameter. This parameter should be an EL expression, so that I my action handler could be context independant. For what I understood, I should use a variable resolver, but I can't understand how it works (and I found no documentation about it).
My node is configured as following :
<node name="Valider la demande">
| <transition name="" to="Fin"></transition>
| <action class="fr.horoquartz.t4.workflow.actions.absences.ValiderDemandeAbsenceAction">
| <idDemande>#{processInstance.id_element}</idDemande>
| </action>
| </node>
I'm not sure the EL expression is right ...
I wrote this evaluate function in my action handler :
private String evaluate(String expression, ExecutionContext executionContext) {
| VariableResolver variableResolver = JbpmExpressionEvaluator.getUsedVariableResolver();
| if (variableResolver != null) {
| variableResolver = new JbpmVariableResolver();
| }
| return (String) JbpmExpressionEvaluator.evaluate(expression, executionContext, variableResolver);
| }
But I have a NullPointerException when I run it.
Note I can read the process instance variable this way :
Long idElement = (Long) executionContext.getContextInstance().getVariable("id_element");
But it makes my action handler context dependant.
Thanks for your help ;)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053001#4053001
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053001
More information about the jboss-user
mailing list