cancel
Showing results for 
Search instead for 
Did you mean: 

Custom activity with custom attribute for service task

shishirg
Champ in-the-making
Champ in-the-making
Hi,

I want to create a service task which has a custom attribute like activiti:customTask which is similar to activiti:class but implementing my custom interface instead of JavaDelegate. I went through parsing and behavior part of the code and think below would be the steps.
1. Define a custom parseHandler which extends from ServiceTaskParseHandler(since its a service task) and checks for the custom attribute.
2. Define a custom behavior factory which overrides the createTaskActivityBehavior() to create a custom behavior object implementing TaskActivityBehavior which takes the user class object (UserClass which implements MyInterface instead of JavaDelegate).
3. Define a custom task invocation extending DelegateInvocation to handle the custom task class invocation.
4. Define a xml converter(extending ServiceTaskXMLConverter) to add the implementation type to ServiceTask object provided through activiti:customTask attribute.

Now I am able to find properties in ProcessEngineConfigurations for parseHandler and activityBehaviorFactory to take my custom classes, but could not find how to set the XMLConverter in the ProcessEngineConfigurations.

Please help me understand how to add my custom xml converter.


Thanks
Shishir
4 REPLIES 4

shishirg
Champ in-the-making
Champ in-the-making
BpmnXMLConverter adds the converters, but its available as private static method.
I could see that it has been modified to public method.
Which version of activiti will have this change?

trademak
Star Contributor
Star Contributor
The next version of Activiti will have this change. We will release a new version somewhere between mid to end September.

Best regards,

shishirg
Champ in-the-making
Champ in-the-making
Thanks for the info. Is there a work-around I can use to add my Custom XML Converter in the meantime?

jbarrez
Star Contributor
Star Contributor
Probably the only thing is baking your own 'release' of activiti, taking the current github state