cancel
Showing results for 
Search instead for 
Did you mean: 

passing parameters to tasklisteners ?

heymjo
Champ on-the-rise
Champ on-the-rise
Hi,

Since this does not work


<activiti:taskListener event="create" delegateExpression="${fourEyesTaskListener}">
  <activiti:field name="fourEyesTask" stringValue="createReport"/>
</activiti:taskListener>

what are my options to declaratively (i.e. from the workflow definition) pass static information to a tasklistener ? Using process variables is not really an option for my usecase.

See also http://jira.codehaus.org/browse/ACT-847

Thanks
Jorg
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
Since the delegateExpression isn't in our controll, we can't just set "Expression" fields in it. If you want to configure it, you should so so in your spring-context (or where you create the beans).

If the value should be context-dependent, try using an expression, and passing on the data:

activiti:expression="${myHandler.doParametrisedMethodThing('configuredValue', execution)}"

or use variables perhaps, that you set in another listener/script-task…

heymjo
Champ on-the-rise
Champ on-the-rise
thanks for the advice.

one thing i had overlooked is that you can start a process with a Map of process variables apparently. This is also a very convenient way to inject business context info.