4 Replies Latest reply on Jul 15, 2009 2:45 PM by Johan Kumps

    dependencies classes used in process

    Johan Kumps Newbie

      Hi all,

      I currently have a process using some custom Java classes (DecisionHandler, ...) These classes have some dependencies (custom domain model classes) contained is a different jar file. How can I make sure these classes are being found when the process is deployed?

      I would like to avoid the use of the server's classpatch. Could a dummy process be used or do all process deployments get a different classloader?

      Thanks,
      Johan,

        • 1. Re: dependencies classes used in process
          Ronald van Kuijk Master

          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)

          • 2. Re: dependencies classes used in process
            Johan Kumps Newbie

            Hi Kukeltje,

            Thanks for replying!

            I'm using 4.0 final.

            • 3. Re: dependencies classes used in process
              Joram Barrez Master

              Johan,

              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.

              • 4. Re: dependencies classes used in process
                Johan Kumps Newbie

                Hi Joram,

                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...

                Johan,