Subscribe to task state events

Hello all,

I would like to be able to implement certain functions in the task engine that apply to all task types. I would like to subsribe to all task change events without having to configure that in each task type definition.

I know that there are global rule definitions in task engine that look promising for what I want to achieve but I have no idea on how to call a custom service from it.

I also think that the task engine emits JMS messages on such task state changes. Is that true? How can I subscribe to such events.

Thanks for any helpful input on this.

Mathias

One of our top consultants came up with this solution:

However, I wanted you to know that a colleague has found an alternative way of implementing this functionality, through Rule Contexts. Apparently, one can:
• Create a dummy task type. e.g. “TaskForGlobalThings”
• Create a method in its RuleContext class, e.g. “taskChanged”
• Once this task is deployed, you can call this method from a global task rule with an expression such as “#{TaskForGlobalThingsRuleContext.taskChanged}” . Also, in that method, besides accessing the oldTask and the newTask through EL evaluation, you also can call getCurrentTask() to retrieve the current task data.

Which I guess it is something that anybody can use now, at least from 8.0 onwards.

1 Like

Great - thanks.

I will try this solution proposal.