Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JBoss jBPM] - Variable resolver

scott.stark@jboss.org

2007-06-11


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.