Adding a TaskListener at runtime
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2014 09:15 AM
Hi,
I am trying to to initialize some process local variables when my userTask's start. The easiest was I have found t do this is to attach a TaskListener to each userTask in the process definition, and then in the notify method of the listener, I can create my local variables via:
delegate.createVariableLocal("EVENT_ID","1234576")
This seems to work ok however I have to define the same listener for each userTask Definition.
Is there a way to add a task listener to all userTask's for a given process at runtime?
I've seen the api for adding a ActivitiEventListener at runtime, however with these, I seem to lose the ability to set local variables unless I'm missing something.
Any help appreciated..
I am trying to to initialize some process local variables when my userTask's start. The easiest was I have found t do this is to attach a TaskListener to each userTask in the process definition, and then in the notify method of the listener, I can create my local variables via:
delegate.createVariableLocal("EVENT_ID","1234576")
This seems to work ok however I have to define the same listener for each userTask Definition.
Is there a way to add a task listener to all userTask's for a given process at runtime?
I've seen the api for adding a ActivitiEventListener at runtime, however with these, I seem to lose the ability to set local variables unless I'm missing something.
Any help appreciated..
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2014 10:49 PM
I also have the same requirement, appreciate any help on this!
-Raj
-Raj
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2014 03:04 AM
Hi,
I think following jUnit test from activiti sources could help you
Regards
Martin
I think following jUnit test from activiti sources could help you
org.activiti.standalone.parsing.CustomListenerFactoryTest
Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2014 05:14 AM
I just found this:
https://github.com/jbarrez/activiti-advanced-scripting/blob/master/src/test/java/org/activiti/Execut...
I haven't tried it out but seems to be alon the lines of what I need.
https://github.com/jbarrez/activiti-advanced-scripting/blob/master/src/test/java/org/activiti/Execut...
I haven't tried it out but seems to be alon the lines of what I need.
