Dynamic Service Task Listener Fields

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2014 06:31 PM
I would like to create a generic execution listener to update key/value pairs. The keys are dynamic so I don't want to create an Expression for each one in my ExecutionListener.
After reading the documentation (http://activiti.org/userguide/index.html#serviceTaskFieldInjection) and code I found that the fields key/values specified are injected into the object thus I can't access all the fields from a delegate or execution listener. Is this correct?
One post that I did find from a few years ago was http://forums.activiti.org/content/servicetask-field-types which is essentially what I'm after.
Can someone suggest how this maybe achieved with Activiti?
Thanks.
After reading the documentation (http://activiti.org/userguide/index.html#serviceTaskFieldInjection) and code I found that the fields key/values specified are injected into the object thus I can't access all the fields from a delegate or execution listener. Is this correct?
One post that I did find from a few years ago was http://forums.activiti.org/content/servicetask-field-types which is essentially what I'm after.
Can someone suggest how this maybe achieved with Activiti?
Thanks.
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2014 03:11 AM
Dynamic injection is not possible indeed, you need to have setters/getters for each of of the values you define. This is not possible for the moment, using plain field-injection. A solution can be to use a JSON-structure (or whatever format you like) as value of the <activiti:string> element, containing the key/value combinations. Use Jackson or whatever JSON parser you want in the delegate listener to get a Map from the JSON-structure, defined in the BPMN.
