5 Replies Latest reply on Nov 8, 2007 4:28 AM by David Roberts

    How to get Pocess from server

    sidkennedy Newbie

      Hello to all,
      Here http://www.jboss.com/products/jbpm/docs/tutorial I found a description how to start a Process Instance on a server with that code snippet:

      ExecutionService executionService =
       JbpmServiceFactory.getInstance().openExecutionService("AlbertEinstein");
      executionService.startProcessInstance( "payraise" );
      executionService.close();
      


      My problem is that I can't find the ExecutionService. In which jar it can be found or is it replaced with another class in a newer verision?

      greets
      Sid

        • 1. Re: How to get Pocess from server
          sidkennedy Newbie

          or in another way the question is: How can I connect to a JBoss-server(working with a mysql-DB) to get a process?

          • 2. Re: How to get Pocess from server
            sidkennedy Newbie

            meanwhile I found out that I can connect and get the ProcessDefinitions stored in the DB like this:

            JbpmConfiguration config = JbpmConfiguration.getInstance();
            JbpmContext context = config.createJbpmContext();
            List processes = context.getGraphSession().findLatestProcessDefinitions();
            


            but in the third line an exception is thrown.

            java.lang.NoClassDefFoundError: org/hibernate/Session
            at org.jbpm.persistence.db.DbPersistenceServiceFactory.openService(DbPersistenceServiceFactory.java:56)
            at org.jbpm.svc.Services.getService(Services.java:136)
            at org.jbpm.svc.Services.getPersistenceService(Services.java:175)
            at org.jbpm.JbpmContext.getPersistenceService(JbpmContext.java:596)
            at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
            ....


            what does that mean?

            • 3. Re: How to get Pocess from server
              David Roberts Apprentice

              Means it cannot find the class org/hibernate/Session .
              Looks like you haven't got the required hibernate jar files in your classpath.

              • 4. Re: How to get Pocess from server
                sidkennedy Newbie

                meanwhile I discovered that the code above is only possible if that class was deployed to the JBoss AS. But I want to get a ProcessDefinition/Instance from outside the AS. How can I do this? With EJB? Or is there an easier way?

                • 5. Re: How to get Pocess from server
                  David Roberts Apprentice

                  As I said, check your jars. You can run that code outside JBoss AS. I run the same code in Tomcat. You can run it anywhere, as long as you have setup your classpath/libraries correctly.

                  Look at the deployment section in the documentation. Make sure you are referencing all relevant jar files.