cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Activiti Designer-Can one jar have multiple task?

yatish
Champ in-the-making
Champ in-the-making
Hi,

I have recently started using Activiti, I am quite impressed with it. Thanks for providing such an open source solution.

I started extending activiti designer, and successfully created one custom task with its java delegate class. When i tried to add another custom task and another java delegate to the same jar, it worked for designer but not for engine. Meaning, engine complained that it was not able to find my second java delegate class. When i created two different jars, everything worked perfect. Is this a limitation or a bug? or as designed? If it is as designed, I do no understand reason for it.

To make question more clear, If my jar contains following:
CustomTasks.jar
   |—CustomTask1.java, Customtask2.java (both these extends AbstractCustomServiceTask)
   |—CustomTask1JavaDelegate.java, CustomTask2JavaDelegate.java (both these implements JavaDelegate)

this jar works for designer, but when i run jUnit for a workflow, that has Customtaks2 in it, it complains java.lang.ClassNotFoundException for CustomTask2JavaDelegate.java

When i split this jar into two jars, it works like a champ.

please let me know if this is a bug or as designed.

Thanks,
Yatish
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi Yatish,

If you get classnotfoundexceptions in the Engine this means that the classpath is not set correct.
It should be no problem to have multiple tasks in one JAR and make that available on the Engine classpath.

Best regards,

yatish
Champ in-the-making
Champ in-the-making
Hi Tijs,

Thanks for your quick reply..

Today again, I got a chance to work on activiti extension. I created new jar file with multiple custom tasks in it and it worked well along with its engine execution. So, You were right, it is not a bug.

I could not figure out problem in my old jar file. All classpaths looked correct to me.

Thanks again,
Yatish