1 2 Previous Next 18 Replies Latest reply on Jul 11, 2006 6:23 PM by Ronald van Kuijk

    How to invoke a business process in JBoss

    Brad O'Hearne Newbie

      I've gone through most of the examples, which address primarily the manual loading of a process definition and invocation (signaling) of processes. I also have successfully executed tests for using an Oracle db for the jBPM schema. What I would like to do now is actually invoke a business process within the context of a JBoss environment (servlet or EJB). The thing I'm not really getting from the documentation or the examples is how to interact with the jBPM central "engine", or even if there is one. Some specific questions I have regarding this are:

      1) How should business process definitions be loaded each time JBoss is started? I do not want to do a manual upload or deployment each time JBoss is started. I also do not want to have to load a business process definition each time it is needed, but once per runtime, and then cache it. Is there a component of jBPM which already does this (i.e. an engine), or is this something that has to be done manually?

      2) How do I invoke a business process? The examples pretty much show how to do this manually, signaling business processes through each stage of their execution. Is there a component of jBPM which manages this (i.e. an engine), and how can I interact with it? How can I tell it to load and execute business process X?

      3) If there is an engine managing the business process execution, what is the extent of what it does? Does it automatically persist all executions to the database, or is this something that has to be done manually?

      4) If there is an engine managing the business process execution, what class / deployment component (sar maybe?) is this deployment contained in?

      Thanks for your help. I think I have a pretty good understanding of the components of jBPM, but I'm not seeing at the moment where it all comes together in a JBoss environment.

      Brad

        • 1. Re: How to invoke a business process in JBoss
          Ronald van Kuijk Master

          Intro:
          Read the docs, getting started, wiki, as well.

          1: If they are deployed they are in the db and do not need to be loaded each time (btw, this is in the docs) The interaction with the engine is though the JbpmContext as can be read/seen in all code (and docs) and JMS or any wrapper you want to write yourself (this is in the docs two)

          2: jBPM IS the engine. See answer 1

          3: jBPM IS the engine, see answer 1

          4: jBPM IS the engine

          To be honest without wanting to offend you, I think you do not (yet) have a pretty good understanding of the components of jBPM.

          • 2. Re: How to invoke a business process in JBoss
            Brad O'Hearne Newbie

            Ronald,

            First off, thank you for the reply. Any help I can get is appreciated. Second, with regards to your comment:

            > To be honest without wanting to offend you, I think you do not (yet)
            > have a pretty good understanding of the components of jBPM.

            I'd just ask you to consider your motivation and intended helpful purpose for posting such a comment. For one, I'm here asking a question, so of course there's something about jBPM I do not know -- that's the whole purpose for the forum. You might as well post this "you do not have...good understanding" comment as a reply to everyone who posts a question. Additionally, does such a comment help? Does it encourage others who might be afraid to ask to post their questions? And in general, does it promote a general courteous atmosphere here on the forum? Or should we all give our own subjective zingers every time we have an opportunity to point out that someone else's understanding isn't as superior as our own?

            Ok, leaving the issue of basic courtesy behind, here's where I'm coming from technically:

            1. There are a number of bugs in the ant files. It is clear that they were not fullly tested.

            2. The documentation is incorrect in places, which causes questions, so I apologize if my questions seem elementary, but I'm attempting to clarify the intent of jBPM usage, which isn't always clear from the documentation.

            3. Regarding your answers:

            1: "If they are deployed in the db" -- in the examples, I see a runtiime method of deployment where a process is uploaded to the server. I also see in the examples, programmatically loading a process definition from a file. Obviously, I want to do neither of these. When JBoss is started/restarted, I want the process definitions to be loaded and stored into the database once, without manual intervention, like every other JBoss archive is handled. I also do not want to have to manually load these process definitions from a file. The examples which do so are helpful, but they somewhat suggest that this is something that you'd need to do, rather than let some central engine load these for you. If I have missed the specific part of the documentation which addresses this, please direct me to it (link) -- it would be helpful not to give a blanket "its in the docs" comment. I'm asking the question as a result of reading the docs.

            For starters, that would be good. Please understand that I've gone through the examples, run successful unit tests, converted my database to Oracle, run successful db tests (I might add here that the documentation and ant files need some help), and read the documentation (which also needs help), have read some source code, and I'm still having questions. Understand that other BPM engines have different architectures, (which I've recently evaluated), so I'm asking questions to be clear, rather than make wrong assumptions.

            Again, your response, and any future ones, are greatly appreicated.

            Cheers,

            Brad

            • 3. Re: How to invoke a business process in JBoss
              Chris OBrien Novice

              I almost posted a reply before Ronald did, and it was almost identical to what he replied (the 4 listed responses at least).

              Going through the source code for the WebApp provides a lot of help too, if you haven't looked.

              Now, back to your first question, you say:

              brado wrote:
              in the examples, I see a runtiime method of deployment where a process is uploaded to the server. I also see in the examples, programmatically loading a process definition from a file. Obviously, I want to do neither of these.


              The thing is, you HAVE to do one of those. You have to deploy a process definition to the jBPM engine for it to be available. Once it is deployed, it is forever in the database, which will never have to be deployed again (even between server restarts).

              • 4. Re: How to invoke a business process in JBoss
                Brad O'Hearne Newbie

                 

                "cpob" wrote:
                The thing is, you HAVE to do one of those. You have to deploy a process definition to the jBPM engine for it to be available. Once it is deployed, it is forever in the database, which will never have to be deployed again (even between server restarts).


                cpob,

                Thanks for the reply, it was very helpful. So if I understand you correctly, you are saying that I either have to load my business process programmatically in my code, or I have to manually deploy it to a running JBoss server. Two questions:

                1. Is there a way to deploy a process archive (PAR) into the JBoss server deploy directory in the same manner as a JAR, WAR, or SAR, and if so, what is the impact on versioning?

                2. One of the configuration files in the starter's kit, specifically jbpm/src/resources/jbpm.sar/jbpm.properties, has a commented out section for the property jbpm.files.dir, which has the comment above it that says: "uncomment the next line to use the file systemm instead of the database for storing files related to a process definition."

                How does this come into play? I understand that this means processes will be stored on the file system, but does this mean that they are *loaded* from the filesystem as well, and should be deployed to that directory, or does this means that an upload to the server or programmatic loading of the process definition still must be done, and the engine will write to that directory instead of the database. Additionally, do you lose versioning if you store on the filesystem vs. the database?

                Thanks for your help.

                Brad

                • 5. Re: How to invoke a business process in JBoss
                  Ronald van Kuijk Master

                  Brad, I said it is in the docs because it IS in the docs:

                  http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted (among others)

                  Regarding the courtesy, no I do not want to tell everybody that my knowledge is superiour to someone else, nor did I do that here (but I do happen to know the answer to life, the universe and everything). On the other hand, I've never seen anyone posting a (basic) question (which by itself is fine) and stating that he/she has a pretty good understanding of the jBPM components. Again I explicity stated that I did not want to offend you and I don't (I'd repond much less nice then ;-))

                  Now back to your new questions:
                  1: Not yet, although it would be nice. I myself am thinking of packaging a process in a war file and have a startup servlet deploy the process if needed (e.g. if it is a newer version)
                  2: This is unrecommended usage and will probably be deleted. It was there because there have been issues with blobs in certain databases.

                  • 6. Re: How to invoke a business process in JBoss
                    Brad O'Hearne Newbie

                    Ronald,

                    Regarding your response --

                    "kukeltje" wrote:
                    Intro:
                    1: If they are deployed they are in the db and do not need to be loaded each time (btw, this is in the docs) The interaction with the engine is though the JbpmContext as can be read/seen in all code (and docs) and JMS or any wrapper you want to write yourself (this is in the docs two)


                    I have looked through all of the code in the starter's kit. I do not see a JbpmContext class anywhere in the starter's kit. Did you mean a class by a different name?

                    Brad

                    • 7. Re: How to invoke a business process in JBoss
                      Brad O'Hearne Newbie

                      Ronald,

                      One more thing, I should have mentioned:

                      "kukeltje" wrote:
                      Brad, I said it is in the docs because it IS in the docs:

                      http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted (among others)


                      I didn't see any reference to the JbpmContext in this doc either. Any chance you can point me to a specific section of a document, and/or specific fully qualified class name to look at in the starter's kit?

                      Thanks,

                      Brad

                      • 8. Re: How to invoke a business process in JBoss
                        Ronald van Kuijk Master

                        google or any other search functionality is your friend

                        • 10. Re: How to invoke a business process in JBoss
                          Brad O'Hearne Newbie

                          Ronald and Koen,

                          Perhaps this is the source of my questions. I am using the Jbpm starter's kit 3.0.3. In the source code included in this distribution, there is no org.jbpm.JbpmContext class. Likewise, your Google reference points to org.jbpm.JbpmContext javadoc, which says:

                          "Obtain JbpmContext's via JbpmConfiguration.createJbpmContext() "

                          Looking in the starter kit's org.jbpm.JbpmConfiguration class, there is no "createJbpmContext()" method.

                          I sincerely appreciate your replies, but so far, responses have been fairly RTFM-oriented. I'm not trying to pester you guys -- I'm asking questions for a reason. I have not found references to the JbpmConfiguration class in the starter's kit documentation, and I have not found any class by this name in the starter's kit, and no example which uses this class.

                          So please, if anyone out there can tell me where in the starter's kit version 3.0.3 where the documentation which describes this class is, where the source code to this class is, and where an example which uses it is.

                          Thanks, your help is greatly appreciated.

                          Brad

                          • 11. Re: How to invoke a business process in JBoss
                            Chris OBrien Novice

                            3.0.3 and 3.1.1 have a lot of differences, especially around the JbpmContext I believe.

                            Is there a reason you are using 3.0.3? I'd suggest 3.1.1 if you could.

                            • 12. Re: How to invoke a business process in JBoss
                              Brad O'Hearne Newbie

                              I should also mention that I've just checked the regular jbpm 3.0.3 distribution (not the starter's kit), and I do not see an org.jbpm.JbpmContext class in this distribution either.

                              Can someone tell me where this class can be found?

                              Brad

                              • 13. Re: How to invoke a business process in JBoss
                                Brad O'Hearne Newbie

                                 

                                "cpob" wrote:
                                3.0.3 and 3.1.1 have a lot of differences, especially around the JbpmContext I believe.

                                Is there a reason you are using 3.0.3? I'd suggest 3.1.1 if you could.


                                cpob,

                                Thanks so much for the helpful reply. Yes there was a reason I was using 3.0.3, because the demo on the JBoss web site used 3.0.3. If the whole ballgame is now 3.1.1, and has significant differences to 3.0.3, it might be a good idea to have a demo that addresses 3.1.1, not 3.0.3. I'll switch to 3.1.1.

                                In retrospect (cpob, this is a reply in general, not to you), after spending 4 days playing ping-pong with vague RTFM-like responses, I really wish that our developer community in general would drop the attitude and just help others, without the need for a jab at others. People ask questions for reasons, sometimes very legitimate reasons that will never be understood if you are jumping to opportunities to be condescending.

                                The one card I haven't showed is that I've had a two-fold purpose in my post, which I intentionally made a basic question, and that was to gauge the quality of JBoss support, and the general demeanor of the people at JBoss. I'm a consultant, with many clients, and I have watched this thread as an indication of what kind of support experience my clients can expect with jBPM: whether they would get courteous answers, or whether they would run into those who would choose instead to put them down and/or send them on an easter egg hunt for answers. People ought to recognize that on a forum, there are opportunities to make friends, associates, and if you are associated with the developer, to gain a customer and a reference. Or likewise, you can alienate people, and send them elsewhere.

                                Thanks to everyone who was helpful. Help is truly appreciated.

                                Brad

                                • 14. Re: How to invoke a business process in JBoss
                                  Ronald van Kuijk Master

                                  This forum is not JBoss support it is community support, and I DO NOT appreciate you acting this way. Can I send you a bill somewhere for the hour I spent answering your posts (Since you are a consultant, I think you have the money)?

                                  I'm so frustrated now that I will not go into the other comments you made about versions. I just hope your clients are smarter http://www.catb.org/~esr/faqs/smart-questions.html

                                  In addition to this, a lot has to happen for me PERSONNALY, (i'm not JBoss) to answer one of your questions in the future.

                                  <Me taking a cooldown period

                                  1 2 Previous Next