cancel
Showing results for 
Search instead for 
Did you mean: 

How can I evaluate expression values in my java code?

chenning007
Champ on-the-rise
Champ on-the-rise
Hi forks,

Can anyone tell me how I can evaluate the expression's value below?

I have a TaskListener implementation in which I add jave code to parse and print a sentence as below

<![CDATA[
<activiti:field name='xxx'>
      <activiti:string>my birthday is ${day}</activiti:string>
</activiti:field>
]>

the ${day} is one variable which is set when an instance of the task is created, however, I can't reference the variable and evaluate the whole expression's value as what I expected like: my birthday is 2000-xx-xx.

If you have any advicement, you will be really appreciated, thanks.

Ning



1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Chen,

May b you can get some thoughts from:


  ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines();

  Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), delegateTask, autoStoreVariables);

Regards
Martin