1 Reply Latest reply on May 6, 2014 9:11 PM by Marco Rietveld

    invoke a deployed jBPM 3 process problem

    Brahim BARHOUMI Newbie

      I'beginner in jBPM 'im using jBPM 3 and i want to invoke a deployed process with a main methode.

      here my Class  main

       

      package com.sample;

       

      import org.jbpm.JbpmConfiguration;

      import org.jbpm.JbpmContext;

      import org.jbpm.db.GraphSession;

      import org.jbpm.graph.def.ProcessDefinition;

      import org.jbpm.graph.exe.ProcessInstance;

       

      public class ClientApp {

         

          static JbpmConfiguration jbpmConfiguration=null;

          public static void main(String[] args) {

              jbpmConfiguration=JbpmConfiguration.parseResource("jbpm.cfg.xml");

              JbpmContext jbpmContext=jbpmConfiguration.createJbpmContext();

              GraphSession graphSession=jbpmContext.getGraphSession();

             

              //create parent process

             

              ProcessDefinition pdef=graphSession.findLatestProcessDefinition("loanProcess");

              ProcessInstance processInstance=pdef.createProcessInstance();

             

              //set default valus to the parent context variable

             

              processInstance.getContextInstance().setVariable("SSNValue", "123");

              processInstance.getContextInstance().setVariable("status", "false");

              org.jbpm.graph.exe.Token token=processInstance.getRootToken();

              token.signal();

              String ssn =(String) processInstance.getContextInstance().getVariable("SSNValue");

             

              System.out.println("***********************SSNVAlue: "+ssn );

              jbpmContext.close();

          }

       

      }

       

      When i run it i have this trace:

       

      Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/SystemException

          at java.lang.Class.getDeclaredConstructors0(Native Method)

          at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)

          at java.lang.Class.getConstructor0(Class.java:2671)

          at java.lang.Class.newInstance0(Class.java:321)

          at java.lang.Class.newInstance(Class.java:303)

          at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:37)

          at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:418)

          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:138)

          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)

          at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:105)

          at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:81)

          at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:86)

          at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:330)

          at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:636)

          at com.sample.ClientApp.main(ClientApp.java:15)