6 Replies Latest reply on Mar 11, 2010 9:27 AM by richard.clayton

    Deploy a new process jbpm-console 4.3

    ernestojavier17

      Hello I'm using jBPM 4.3, JBoss 5.0.0GA and Postgres.

       

      I would like to deploy a new process using jbpm console like I used to do with jbpm 3.x. I have tried with all example users but I cannot see any option to deploy a new process. This feature still exists on the 4.3 version?.

       

      Also with the jbpm 3.x eclipe pluggin there was an option to do a remote deployment for a process definition, and now with the new GPD it is gone.

       

      Thanks,

      Ernesto.

        • 1. Re: Deploy a new process jbpm-console 4.3
          swiderski.maciej

          Hi,

           

          afaik there is not possible to deploy process from a console (not yet implemented).

           

          To deploy to remote database can be done in (at least) two ways:

          1. using ant task - check examples shipped with jBPM distribution - there is a build.xml with all required tasks

          2. use public API - RepositoryService (createNewDeployment method) - see java docs for it and all test cases use this approach

           

          In both cases you need to configure hibernate to inform where the process should be deployed.

           

          HTH

          Maciej

          • 2. Re: Deploy a new process jbpm-console 4.3
            richard.clayton

            Maciej,

             

            I too have been struggling with deployment related issues over the last month (jBPM 4.3 into JBoss AS 5.1.0).  I have never once been successfully able to package a Process Definition and related files as a "bar" and deploy it into JBoss.  In fact, I wish I could post some error code, but JBoss doesn't even hint at the fact that the file has been added to the deploy directory.

             

            My next approach was to write my own upload service for manually adding Process Definitions.  I have a Servlet that receives a Zip file, extracts the file into a temporary directory, and then passes a collection of files to a function that adds the resources to a new deployment.  The code to perform the action has been added below:

             

            //This is injected into the class.

            protected RepositoryService repository;

             

            public String addProcessDefinitionFromFileSystem(List<File> resources){

                 NewDeployment deployment = this.repository.createDeployment();

                 for(File resource : resources){

                      deployment.addResourceFromFile(resource);

                 }

                 return deployment.deploy();

            }

             

            This approach works relatively well for uploading new Process Definitions, however, it screws up the way the Freemarker Templates work.  I'm afraid this approach is doesn't allow the jBPM console to locate the templates because I continue to get the "No UI associated with PROCESS 'yadayadayada'" error.

             

            For some reason, I thought all the resources used by jBPM were stored in the database, but this might be a silly assumption on my part.  Is there a way that I "relatively reference" the Freemarker template within the process definition so it can be found?  Or this there a special folder I can copy these resources to so they can be located by the jBPM Console?

             

            Any help would be greatly appreciated.

             

            Thank you,

             

            Richard

            • 3. Re: Deploy a new process jbpm-console 4.3
              swiderski.maciej

              Richard,

               

              you are completely right - all resources are stored in the data base including freemarker templates - they just need to have .ftl extension.

               

              So, in general, deployment is done to a database regardless of what application service the process engine is running on. I have always used ant task to make a deployment. Please find attached build.xml prepared for it.

               

              You need to remember that you must prepare hibernate configuration for you data base inside file: jbpm.hibernate.cfg.xml

               

              I deploy it from eclipse as ant taks (using attached build.xml) and structure of the project is as follow:

              /

                   /src

                        /*.java

                   /to-deploy-conf

                        /jbpm configuration (jbpm.cfg.xml, jbpm.hibernate.cfg.xml, jbpm.mail.properties, jbpm.mail.templates.examples.xml, logging.properties, process_forms.css)

               

              And that works like a charm, tested with few data bases (HSQLDB, PostgreeSQL, MySQL).

               

              HTH

              Maciej

              • 4. Re: Deploy a new process jbpm-console 4.3
                richard.clayton

                Maciej,

                 

                Thank you for the build file.  I was wonder what the reference was to the simple-jar.jar?  Is that supposed to be user code compiled by Eclipse, but needing to be added to the archive?

                 

                Thanks,

                 

                Richard

                • 5. Re: Deploy a new process jbpm-console 4.3
                  swiderski.maciej

                  yes, that is my classes that were packaged externally, you can remove it. Sorry, missed that when preparing the file.

                   

                  /Maciej

                  • 6. Re: Deploy a new process jbpm-console 4.3
                    richard.clayton
                    No problem.  I was a little confused because it was coming out of the Eclipse directory.  Thank you again.  Richard