cancel
Showing results for 
Search instead for 
Did you mean: 

Replace activiti:class throughout all deployments?

dognose
Champ in-the-making
Champ in-the-making
Hello,

we have multiple processes deployed where have a lot of different TaskDelegations in use.
Due to recent cleanup in our own source-code some of the package names have changed.

However Activiti seems to also store the full package name inside the BPMN-Diagramm.
There are now processes deployed having the activiti:class-attribute pointing to a no longer valid class.

beside of the diagram itself - where do we need to perform updates to fix "running" processes? I think,
Activiti stores a serialized copy of each diagram upon deployment, that now needs to be altered?

(Or is there a smarter way of telling activiti: "my.namespace.old.someDelegate is a deprecated alias for my.namespace.new.someDelegate" without messing arround with the serialized versions of the bpmn files?)

kind regards,
dognose
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Implementing new versions of delegate classes always involves backwards compatibility. So there's no out of the box solution for this.
You could look into using the SetProcessDefinitionVersionCmd to move an existing process instance to a new process definition.

Best regards,

dognose
Champ in-the-making
Champ in-the-making
Hi,

unfortunately moving the old processes to the new version is no option. We ofc. use the Versioning to introduce Business-Changes. However, we can not introduce a "Business Change" to older Versions of the process still running, just because of a "technical" Need
to move them to newer definition versions.

So the only Options that are available are:

- Keeping a depcrecated Version of the Classes until all running processes are done.
- Manually altering the serialized BPMN-Diagrams to replace references to the "old" class.

Both are not really satisfying.

I would suggest, that - if activit would address this problem in some way - you extend Activitis way of storing those Information. Rather than storing "com.my.namespace.something.class" in the diagram, just use the simplified class Name, and add a possibility (In the processengine-configuration) to define packages that should be scanned for the respective classes used.

Something like the "PHP-Include-DIR" so to say.

This would also allow to define different "packages" with different implementations for certain delegates, and just replace them by changing the package path to scan for those classes.

Even if not required on a daily basis, this would decouple activiti from the namespace-layout of the containing project.

(Still seeing Forward to more answers, maybe there is another Option than the two mentioned above?)

best regards,
dognose

jbarrez
Star Contributor
Star Contributor
" if activit would address this problem in some way"

This problem is addressed in environments where you have dependency injection, like Spring. There, you delegate to bean names rather than using classnames directly. Not sure if we need to do something similar for Activiti out of the box, but it is an interesting idea.