cancel
Showing results for 
Search instead for 
Did you mean: 

jar deployment for human tasks

shizanu
Champ in-the-making
Champ in-the-making
Hello,

I am using the camunda fox community edition, which is activiti readily deployed on a jboss AS7.1

When trying to use expressions in human tasks I get the following problem:
The human task form generator in the activiti explorer doesn´t find my java classes deployed to the web-inf/lib directory, where I put them for service tasks (my Delegates for service tasks work fine and find all other classes as well).
I managed to get my .jar to load for the human tasks by putting them into jboss-as-7.1.0.Final\modules\com\camunda\fox\platform\fox-platform-service\main
Now my task forms generate fine, but when trying to access the result objects later, I get a ClassCastException, because while its the same type of objects, its from different .jars and java doesn´t like that. When loading the task form this doesn´t cause an error, because its first serialized to the db with one definition and then deserialized with the defition from the other jar, which works because its the same class.

Does someone know if this problem is specific to the camunda community edition? Or is there a special way to deploy custom java classes for human tasks in standard activiti as well?

best wishes
Shizanu
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
The best practice is to place your custom classes right next to the activiti-classes (activiti-engine.jar) so they're loaded with the same class loader. I'm not aware of how the fox-platform handles class-deployment and resolving, so I'm not much of a help for that matter…

shizanu
Champ in-the-making
Champ in-the-making
I am doing that (with fox-engine.jar). It works perfectly fine for service task delegates and on process level.

However the human task form generator of the activiti explorer seems to be getting his classes from a different place.

I am faced with the same problem while creating custom task forms via cdi now. I could write code to bind a object from my web application to a process variable. However I wont be able to use it in the process, because the process doesn´t have access to the class definition, which is in the lib folder of my web application.

I would very much like to do that though, because it would enable me to use a consistent object based datamodel in my processes, that would be far easier to maintain then a huge number of process variables, that are never defined in a central place.
Some kind of mapping between task form variables and process variables would do the job too (though being rather inconvenient), however task forms seem to always access process variables directly. While this has a lot of advantages, it really hurts the ability to easily exchange one delegate for another without having to know everything about the process. Also it forces me to bind all my input paramters in forms directly to process variables, because of above problem. Exactly this last thing is what I want to get away from somehow.