jBPM 3 or 4? In 3 deployment do not have a classloader. Processinstances when actualy running in a thread (so not when they are just in the db) have a classloader. That behaviour is configurable to some extend. But you should be able to use e.g. the war classloader when jBPM is running embedded.
For 4 I have no idea (yet)
Thanks for replying!
I'm using 4.0 final.
The main issue here is that classes need to be found by the classloader on deploy-time, since they are instantiated for caching purposes.
If you use the JBoss integration, you could put these dependencies in the userlibs folder.
The other 'workaround' is to have the deployment of processes in your webapp itself. Eg write an EJB to deploy the processes, so that your domain classes can be found on the regular classpath.
But thanks for pointing us to this issue. We'll definitely have a discussion on how to ease the development in regular web apps.
I think we need to consider the operations part of a project.
A central Jbpm engine is running somewhere. The ProcessEngine can be retrieved from JNDI to be used to create new processInstances (excecutions).
Next to that part we should have some kind of "deployer". Getting the ProcessEngine from JNDI or even better by connecting directly to the Jbpm database and deploy the new process. Currently I have a deployer implemented using the build-in ant task. But I'm not feeling happy with this due to having a dependency to ant.
Using this deployer I can deploy processes. Using a JUnit test I can create instances. But whitin the Eclipse project the classes used in my process are in the run classpath. I'm wondering whether it will be working in the described setup in paragraph 1...