1 2 Previous Next 15 Replies Latest reply on Jun 19, 2008 12:21 PM by kukeltje

    Tutorial or guide to create instances of processes in java

    mikool

      Hello!

      I'm new to JBpm but I've red the Getting Started Documentation, went through the documentation of JBpm and played a lot with it. I also tried to find help in this forum and the jbpm wiki. But I couldn't find anywhere a guide how to make an instance of a process or how to start a process with simple java code. I want to build a web application with servlets or jsps and would like use the JBoss JBpm for it.
      Is there any guide that can be helpful?

      Mike K.

        • 1. Re: Tutorial or guide to create instances of processes in ja
          joy_wind

          Mike,I'm new to jbpm too.But i think you can find sample code of creating process instance in the userguide(3.2.2) section 3.1 "Hello World example".It's a junit test code,but of course you can put them in your main method or your servlet/jsp.

          • 2. Re: Tutorial or guide to create instances of processes in ja
            mikool

            Thanks. I already tried this tutorials but maybe it is out of date because I just get errors. I mean there is no guide, no book, that explains how to configure jbpm, how to create a little project from scratch (with own java code). I also don't know how to configure the DB behind jbpm. There is some source code but unfortunately this is not enough because I can type it in my eclipse and then?

            • 3. Re: Tutorial or guide to create instances of processes in ja
              kukeltje

              There is the documentation, there is a book (more than one) there is the wiki (with a very good new tutorial), there are *many* testcases

              Maybe (without wanting to offend you) it is not right for your level of knowledge of certain technologies or the amount of time you want to put into finding things out. For many users it is the right level (not that it can't be improved)

              • 4. Re: Tutorial or guide to create instances of processes in ja
                mikool


                The only book I found is this:
                http://www.amazon.com/Business-Process-Management-JBoss-jBPM/dp/184719236X/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1211105390&sr=8-1
                But this book is only for business analysts and not for developers.
                The best tutorial I found on the wiki is the jbpm-getting-started:
                http://wiki.jboss.org/wiki/JbpmGettingStarted
                This is a very good tutorial, but it only explains you how to use the jbpm-console and how to build processes with jpdl. That's it.

                Would be great great if you can posts some more sites except the documention and the wiki.

                Bye
                Mike

                • 5. Re: Tutorial or guide to create instances of processes in ja
                  joy_wind

                  Mike,jbpm depend heavily on Hibernate.Many error can be raised from it.So if you dont know hibernate,I think you should go for it to equip yourself some concept of o-r mapping. Many errors will raised by missing the dependency libs,so make sure that you have them all in your classpath.

                  • 6. Re: Tutorial or guide to create instances of processes in ja
                    kukeltje

                    Mike,

                    Strange, a blog entry by Tom himself says this about the book you mention:

                    The book targets architects, analysts and developers that want to get started with jBPM. Matt succeeded in bringing great value for all three target groups. It starts with a fresh look at the value of BPM and practical guidelines on how to start a BPM project. Installation of every required piece of software is explained in detail. Even less technical people will have no problems to get the software up and running with these very simple step by step instructions.


                    The other books are about using jBPM in combination with seam (or in fact the other way around)

                    And (as usual) I did mention the many, many testcases in the source for a reason: they give you good insight in how to use the api.

                    Oh... and there is a new document in the wiki as well. It's in fact on the *second* link on the wiki page in the contributed documentation section http://wiki.jboss.org/wiki/JbpmContributedDocs

                    If that is not enough for you to even get started, I'm sorry. The best thing to do then is either have someone else do it, or choose another product.

                    When you get going and run into problems, we are of course always willing to help out with specific questions.

                    • 7. Re: Tutorial or guide to create instances of processes in ja
                      mikool

                      Ok, many thanks. I will take a closer look on these books and the wiki.

                      • 8. Re: Tutorial or guide to create instances of processes in ja
                        joestevens

                        Just wanted to comment on this a bit. While I think the user guide that ships with jbpm is very useful, there are certainly some gaps.

                        The first gap is that all the examples of kicking off instances and interacting with jbpm are stand-alone type apps. There aren't any examples where you deploy the jbpm ear and interact with jbpm through the deployed service. Is the preferred way of interacting here through the CommandService bean using Commands? I'm sort of leaning that way from poking around, but I'm not sure.

                        The second gap is that there aren't any examples showing how to package up a simple process and deploy with ant. The examples I've seen do deployment in java code.

                        I've used jbpm pretty extensively in the past, but am just coming back to it after about 18 months away. Since I still have the lingering questions from above, I'm sure that someone coming in completely cold will have questions as well. Anyone have any information or links relating to the two issues above? Thanks.

                        • 9. Re: Tutorial or guide to create instances of processes in ja
                          fornachari

                          Hello!

                          I am having the same difficulty that mikool.
                          I want to do a client application to make an instance of a process.
                          I did this, using this hands on http://wiki.jboss.org/wiki/_Files/Main/jbpm3.2.2-handsontutorial.pdf, but when I do a new instance of my process, I can't see the open tasks of my process through the jBPM Admnistrator WebConsole. Is it possible to start a process through a Java Application and complete the tasks using the jBPM WebConsole?
                          I am using the jBPM version 3.2.2 and my application code are below:

                          
                          import org.jbpm.graph.def.ProcessDefinition;
                          import org.jbpm.graph.exe.ProcessInstance;
                          import org.jbpm.graph.exe.Token;
                          
                          public class ClientApp
                          {
                           public static void main(String[] args)
                           {
                           try
                           {
                           ProcessDefinition definition = ProcessDefinition.parseXmlResource("request/processdefinition.xml");
                          
                           ProcessInstance instance = new ProcessInstance(definition);
                           instance.getRootToken().getNode().getName();
                          
                           instance.getContextInstance().setVariable("infoDoc", "C:\\Document.pdf");
                          
                           Token token = instance.getRootToken();
                           token.signal();
                          
                           String infoDoc = (String)instance.getContextInstance().getVariable("infoDoc");
                           System.out.println("*************************** Document Information: " + dadosDoc);
                          
                           instance.hasEnded();
                           }
                           catch (Exception ex)
                           {
                           System.out.println("------>ERROR: "+ex.getMessage());
                           }
                          
                           }
                          }


                          Any help would be appreciated.
                          Thank you in advance!

                          • 10. Re: Tutorial or guide to create instances of processes in ja
                            kukeltje

                            first thing to check as mentioned in other posts is that the SAME database is used

                            • 11. Re: Tutorial or guide to create instances of processes in ja
                              kukeltje

                               

                              "joestevens" wrote:
                              The first gap is that all the examples of kicking off instances and interacting with jbpm are stand-alone type apps. There aren't any examples where you deploy the jbpm ear and interact with jbpm through the deployed service.


                              Basically, it is the same, no difference

                              "joestevens" wrote:
                              Is the preferred way of interacting here through the CommandService bean using Commands? I'm sort of leaning that way from poking around, but I'm not sure.
                              Not the preferred way, but an option, especially if you want to connect remotely
                              "joestevens" wrote:


                              The second gap is that there aren't any examples showing how to package up a simple process and deploy with ant.
                              There is an additional ant task in the wiki (or at least here) which does not deploy it via the database but via the deploy servlet (better imo).
                              "joestevens" wrote:

                              The examples I've seen do deployment in java code.

                              There are many examples in the testcases in the source...
                              "joestevens" wrote:

                              I've used jbpm pretty extensively in the past, but am just coming back to it after about 18 months away. Since I still have the lingering questions from above, I'm sure that someone coming in completely cold will have questions as well. Anyone have any information or links relating to the two issues above?
                              Yes, I do
                              "joestevens" wrote:
                              Thanks.

                              You are welcome

                              • 12. Re: Tutorial or guide to create instances of processes in ja
                                joestevens

                                Ronald,
                                Thanks a lot for your thoughts. Hopefully I can pick your brain a little further here.

                                "kukeltje" wrote:
                                "joestevens" wrote:
                                Is the preferred way of interacting here through the CommandService bean using Commands? I'm sort of leaning that way from poking around, but I'm not sure.
                                Not the preferred way, but an option, especially if you want to connect remotely


                                Here's what I'm trying to get my head around. A while back when I was first using jbpm, the main way to deploy was using the jmx service. Then any local apps that wanted to use jbpm would just grab the configuration object out of jndi and be happily on their way. I'm trying to understand if that's still considered a good way to do things. I see the MBean for jbpm in the source tree. I don't see any mention of it in the docs or any examples.

                                So, what method would typically be used by a few local apps that need to share a configuration of jbpm? Is the jmx service a reasonable solution? Any thoughts you can give on accepted practice would be great.

                                Thanks again.



                                • 13. Re: Tutorial or guide to create instances of processes in ja
                                  kukeltje

                                  the JMX bean as it was is not used anymore since it made jBPM somewhat JBoss AS dependant. You can easily circumvent this, but the docs also would not be generic. Besides that, you could not package actionhandler classes is your own war/ear then, but only server generic or in the processarchive. These were the reasons to abandon the MBean

                                  • 14. Re: Tutorial or guide to create instances of processes in ja
                                    lblaauw

                                    Ok,

                                    I am also sorta debating on what route to take on this scenario. So we have deployed jBPM as the ear file including the console and the EJBs since we need the timerservices to be ejb timers this seemed a reasonable approach.

                                    I have been reading a lot in the documentation and also the sources and tests but still I cannot figour out how to go about and create a server based webservice to expose jBPM services like getting taskLists, proces Tasks etc etc.

                                    Basically I can see two options right now and I would love some feedback on both of these:

                                    Option 1 would be to just approach the CommandService EJB from my webservice, as far as i can see it that would use ONE configuration set ie jbpm conf xml, hibernate xml etc etc. This however does mean we get extra overhead in using EJB(2)...

                                    Option 2, would be to use seperate configuration files all together, effectively meaning we bypass the whole configuration allready deployed on the JBoss server and user another one on the client. Basically as i can see this means we just share the jBPM database then ??

                                    Or are there better other options that I just missed so far ?

                                    Greetings,
                                    Leo

                                    "kukeltje" wrote:
                                    the JMX bean as it was is not used anymore since it made jBPM somewhat JBoss AS dependant. You can easily circumvent this, but the docs also would not be generic. Besides that, you could not package actionhandler classes is your own war/ear then, but only server generic or in the processarchive. These were the reasons to abandon the MBean


                                    1 2 Previous Next