2 Replies Latest reply on Nov 24, 2009 11:48 AM by Bertrand Goetzmann

    The most simple jBPM jbpm.cfg.xml configuration file

    Bertrand Goetzmann Newbie

      Hello,

      I'm new in jBPM, and think it is a very powerful tool!

      My first goal is to use a ProcessEngine object, init a simple process definition, and run an instance of this, by code.
      The documentation says (jBPM 4) that I must use a jbpm.cfg.xml.
      What would be, in my case, the simplest definition in that configuration file, knowing that I would to have jBPM embedded in my java application?
      I suppose I must use a in memory database?

      Thank a lot!

      Bertrand.

        • 1. Re: The most simple jBPM jbpm.cfg.xml configuration file
          Ronald van Kuijk Master

          There is a 'default' cfg in jbpm that is 'minimal´ If you want less, you have to describe in detail what functionality of jBPM you do not want to use (there is not much difference in using jBPM in a webapp or standalone app)

          Regarding the database, that is totally up to you to decide.

          • 2. Re: The most simple jBPM jbpm.cfg.xml configuration file
            Bertrand Goetzmann Newbie

            Thank you Ronald,

            In a NetBeans project I reused the configuration files jbpm.cfg.xml and jbpm.hiernate.xml coming from the <jbpm_4_2>\install\generated\cfg folder (I put them at the root of my source code). Of course, I added the required jars.

            My main method looks like this:

            ProcessEngine processEngine = new Configuration().buildProcessEngine();
             RepositoryService repoService = processEngine.getRepositoryService();
             ExecutionService executionService = processEngine.getExecutionService();
            
             NewDeployment deployment = repoService.createDeployment().addResourceFromClasspath("process.jpdl.xml");
             deployment.deploy();
             executionService.startProcessInstanceByKey("helloWorld");


            As you can see in the code, I used the process.jpdl.xml process definition file (also in the classpath).
            And before running it, I executed a HSQLDB server instance by running the Ant task start.hsqldb.server from <jbpm_4_2>\install.
            And it works!

            I also implement a custom activity (and use it in the process) in Groovy language by implementing ExternalActivityBehaviour, in order to invoke a remote service also in Groovy. This service is even running as a script in the Groovy console using the XML-RPC Groovy module.

            Best regards,

            Bertrand.


            "kukeltje" wrote:
            There is a 'default' cfg in jbpm that is 'minimal´ If you want less, you have to describe in detail what functionality of jBPM you do not want to use (there is not much difference in using jBPM in a webapp or standalone app)

            Regarding the database, that is totally up to you to decide.