7 Replies Latest reply on Sep 2, 2009 4:02 PM by Ronald van Kuijk

    Deploying JBPM project created by Eclipse in Tomcat server

    Jin Strife Newbie

      Hello,

      I'm developping a project using Jboss jBPM.
      So I had designed a workflow using the jPDL Eclipse plugin and my project can be deployed by launching Jboss server (start.bat).

      When done, I have searched where Jboss is deploying the project and discovered that the folder was created in 2 places:

      "jbpm-starters-kit-3.1.4\jbpm\src\resources\jbpm.war\";
      AND
      "jbpm-starters-kit-3.1.4\jbpm-server\server\jbpm\tmp\deploy\tmpXXXjbpm-exp.war\"


      I imagine that the second folder is a temp/cache folder used when the project is deployed (when we shutdown the server, this folder disappears).

      I have followed many wiki and tuto on "How to setup Jboss/jBPM with Apache Tomcat and MySQL" but I didn't make it.

      I wanted to know if it was possible to deploy the project generated by jBoss server in Tomcat by, for example:

      Copy the project folder generated (generated and used by jBoss server) directly into Tomcat webapps.
      OR
      Make a .war of this project generated by Jboss server and deploy it into Tomcat webapps (it's approximatively the same thing i thing...)


      So i tried this 2 methods but i didn't make it...

      The project is not correctly deployed (in the Tomcat manager, I can see the "deployed" status at FALSE).

      Is there a simple solution to take a jBPM project and to run i on Apache Tomcat server (i imagine that the 2 servers or not so different) ?

      My configuration:
      jbpm-starters-kit-3.1.4
      Apache Tomcat/6.0.20

      Thanks for your help.

        • 1. Re: Deploying JBPM project created by Eclipse in Tomcat serv
          Ronald van Kuijk Master

          why do you use jBPM 3.1.4? There is a 3.2.x version and already even a 4.0 version.

          And yes, jBPM 3 runs great on Tomcat, 3.2 even better than 3.1.

          You *cannot* run the JBoss version on Tomcat since there are some differences, but those are described in many places (including the wiki)

          So for us to be helpfull, you have to provide e.g. errors/stacktraces etc, since it should work.

          • 2. Re: Deploying JBPM project created by Eclipse in Tomcat serv
            Jin Strife Newbie

            Thanks for the quick answer kukeltje !

            For the story, I spent my times configuring all sort of possibilities using different version of jBPM and only a few of them "works" sucessfully.

            So I explain what i did and where i am now:

            I have followed this wiki few days ago:

            http://www.jboss.org/community/wiki/JbpmOnTomcat


            I sucessfully launched the jBPM-console with Apache Tomcat/6.0.20 and jBPM 3.2.GA (the same jBPM as the wiki).

            So the example runs well, I can launch the jbpm-console via Apache Tomcat, play with some workflows inside, and it interacts well with the MySQL DB (login, update the workflow table when i play with it inside the application).

            So now, I create a simple jBPM in eclipse, like the one shown in the jBoss jBPM demo here:

            http://docs.jboss.com/jbpm/v3/demos/movies/jbpm-overview.htm


            Like shown in the demo, to deploy the process, i click on the process, then go to the deployment tabs in Eclipse and launch the button "Deploy process archive ...".

            A message saying that it was deployed sucessfully is diplayed.

            I though, now i have configured jBPM using the Apache Tomcat server, that the project will be deploy directly in the webapps folder of Tomcat.

            But no, and the problem is that I don't know where it is deployed (and so I don't know the URL adress of the project... Because generally, it is juste: http://localhost:8080/projectname , with projectname corresponding to the name of the folder deployed in webapps Tomcat).

            The webapps folder doesn't contain the project deployed (and I really have no idea where it is).

            Here's a screenshot describing what i said and some interrogations i have.

            [img]http://img232.imageshack.us/img232/763/jbpm.png[/img]
            http://img232.imageshack.us/img232/763/jbpm.png

            Thanks for your help :)

            • 3. Re: Deploying JBPM project created by Eclipse in Tomcat serv
              Ronald van Kuijk Master

              the PROCESS is deployed to the DB via the deploy servlet.

              jBPM 3 does not deploy do the deploy folder and in 4 this is only experimental

              • 4. Re: Deploying JBPM project created by Eclipse in Tomcat serv
                Jin Strife Newbie

                Oh... I see, that's what I though...
                That's why i saw new workflow added into the jbpm-console when I deployed them (because they are just deployed in the DB, so I can see them once I launch the jbpm-console and use them).

                I'm a little perplex knowing this... Because I read everywhere that the Workflow we draw can be include into a web application, and know, if I undestand how it works, it's not possible (or not easily).

                I used jBPM with that goal:

                1) Draw a worflow into eclipse by using jBPM-JPDL plugin
                2) Generate the workflow (and the .jsp source files needed to run it)
                3) Integrate/Display these .jsp into our project (I have a Web Project in Java J2E technology, using Hibernate and Struts)


                So my question will be like that:

                1) Are these 3 steps are possible with JBPM 3.x ?

                2) If not, is it possible with the latest release (4.1 of the 1st September 2009) ?


                So to be more simple, now I drawn the workflow.
                By launching it on Jboss server, I saw that it generates a website in .jsp format (faces/home.jsp, faces/login.jsp, faces/task.jsp ... ...).

                I'd like to take these pages (the .jsp generated) and integrate them in my own Web Java project.

                My situation is like that:

                I have in my website a template with 3 parts:
                1) A header at the top;
                2) A menu at the left;
                3) And a blank jsp in the middle.


                The final result I'd like is to replace the blank .jsp file by the workflow pages generated by Jboss. Is it possible ?

                If it's not possible, I think that I really misunderstood what Jboss jBPM is.

                Thanks a lot for your answers, it helps me a lot to understand the paradigm of Jboss JBPM.

                • 5. Re: Deploying JBPM project created by Eclipse in Tomcat serv
                  Ronald van Kuijk Master

                  you don't *have* to deploy the definition from the designer, you can also use the jbpm api and retrieve the jpdl file from e.g. your war and use a startup servlet to deploy it and have some checks around that to see if it is not already deployed.

                  This all is totally independent of your webproject structure, frameworks or anything. Same is true for jBPM 4 btw.

                  Integration on e.g. signalling a process/task can be done e.g. from jsf beans. Not really difficult. Just do like is done in lots of testcases.

                  • 6. Re: Deploying JBPM project created by Eclipse in Tomcat serv
                    Jin Strife Newbie

                    Ok, a couple days ago, I studied the door example.

                    So I have understand this simple sample (how to get a token, how to move it to differents state ...).

                    So now, I'd like to see this test directly on the worflow image.

                    For example, I have a JUnit test testing some movement of the token.

                    ou can also use the jbpm api and retrieve the jpdl file from e.g. your war and use a startup servlet to deploy it and have some checks around that to see if it is not already deployed.


                    I understand how to deploy a process via this part of code:

                    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
                    ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(
                     "org/xxx/definitions/yyy/processdefinition.xml");
                    jbpmContext.deployProcessDefinition(processDefinition);
                    jbpmContext.close();


                    I also understand how to run a process via:

                    jbpmContext = jbpmConfiguration.createJbpmContext();
                     processInstance = jbpmContext.newProcessInstance("processname");
                    
                     contextInstance = processInstance.getContextInstance();
                     contextInstance.setVariable("var", myVar);
                    
                     processInstance.getRootToken().signal();
                    


                    So i know how to move the token by using different "signal".

                    But i still don't understand (I didn't find a true example on internet) how to "use the jbpm api and retrieve the jpdl file from" like you said.

                    Because now, as i understand, i can do all the movements i desire with the token on the workflow, but can't display it on the workflow image.

                    Can you show me a part of java code that retrieve this image from the "processdefinition.xml" and how to display it (and update it at each time that we move the token with the method token.signal("xxx")

                    I'd like to have for example the same interface like when we deploy with Jboss server (the image with a red square around the node).


                    =======================


                    In a second time, is there any other method via JBPM 4.1 ?
                    My collegue asks if there's a simple method by using the processdefinition.xml file, and the template folder deployed in the Webapps folder when installing JBPM 4.1 ?

                    Have you ever tested this version since its release ?

                    Thank you ^^ (again :p)

                    • 7. Re: Deploying JBPM project created by Eclipse in Tomcat serv
                      Ronald van Kuijk Master

                       

                      "Nanaki" wrote:

                      ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(
                       "org/xxx/definitions/yyy/processdefinition.xml");
                      

                      But i still don't understand (I didn't find a true example on internet) how to "use the jbpm api and retrieve the jpdl file from" like you said.


                      The parseXmlResouce above does this...

                      "Nanaki" wrote:

                      Because now, as i understand, i can do all the movements i desire with the token on the workflow, but can't display it on the workflow image.

                      Can you show me a part of java code that retrieve this image from the "processdefinition.xml" and how to display it (and update it at each time that we move the token with the method token.signal("xxx")


                      The image is not retrieved from the processdefinition.xml, it is a separate image in a deployment. It is generated by the gpd. Look at the ant task in the source for deployments on how to also deploy this image.

                      "Nanaki" wrote:

                      I'd like to have for example the same interface like when we deploy with Jboss server (the image with a red square around the node).


                      That is part of the console. Look at the sourcecode of that on how the image and processdefinition.xml together are used to implement this.

                      "Nanaki" wrote:

                      In a second time, is there any other method via JBPM 4.1 ?
                      My collegue asks if there's a simple method by using the processdefinition.xml file, and the template folder deployed in the Webapps folder when installing JBPM 4.1 ?



                      I do not get what you mean here?

                      "Nanaki" wrote:

                      Have you ever tested this version since its release ?


                      I used the nightly on a regular basis, but not fully tested it, why?