7 Replies Latest reply on Nov 17, 2008 11:26 AM by kukeltje

    jBPM 4 Design Question: Stateful Process Instance

    benhu

      I am designing a service in my system based on jBPM and I am trying to make the service stateless for scalability issue. For current jBPM 3, the process instance is stateless, so I can design my stateless service to start an instance, signal the token and deal with tasks. Today when I am reading wiki page related to jBPM 4 design topics and it mentions about changing current stateless Process Instance into stateful. I am asking how will this change affect my existing design?

      Thanks!

        • 1. Re: jBPM 4 Design Question: Stateful Process Instance
          kukeltje

          how do you mean stateless? Is that the same as no persistence to you? 95% of current jBPM usage is with persistance, Can you point me to the wiki page and tell me what you think this statefull means?

          • 2. Re: jBPM 4 Design Question: Stateful Process Instance
            benhu

             

            "kukeltje" wrote:
            how do you mean stateless? Is that the same as no persistence to you? 95% of current jBPM usage is with persistance, Can you point me to the wiki page and tell me what you think this statefull means?


            The wiki page is here:
            http://www.jboss.org/community/docs/DOC-12855

            My understanding for current jBPM is, the state of a process instance (during the execution, where the token points) is persistent in the database. Thus suppose I have a service to call jBPM to execute a process, I can make this service stateless because this service does not need to carry the state of current process (the state is in the persistence). This service does not need to wait for jBPM and keep its state. It simply call jBPM, signal the token and return. Next time when the service access this process instance again, it will know the state from the persistence. Otherwise, I have to make my service stateful which from my perspective may affect scalability of my system.

            I am not sure if this is what jBPM team means by stateless process instance or statefull process instance.

            I am just concerned whether or not I can still keep my service stateless.

            BTW, in existing code base, jbpm enterprise has a stateless EJB implemenation. That is why I think I can have a stateless service in my system to interact with jBPM.

            • 3. Re: jBPM 4 Design Question: Stateful Process Instance
              kukeltje

              Stateless EJB and the way the core works are separate things. The statefulness described in the design topics document (which was a discussion document and needs some updating since there were some not totally valid assumptions about current behaviour) is about being able to set runtime properties on a processinstance other then process variables so e.g. a mail node can be runtime configured to use othe smtp host. The option to you jBPM in a non-persistent (fully stateless, e.g. for STP) way will certainly remain or even made better.

              So yes you can keep your service stateless

              • 4. Re: jBPM 4 Design Question: Stateful Process Instance
                benhu

                 

                "kukeltje" wrote:
                Stateless EJB and the way the core works are separate things. The statefulness described in the design topics document (which was a discussion document and needs some updating since there were some not totally valid assumptions about current behaviour) is about being able to set runtime properties on a processinstance other then process variables so e.g. a mail node can be runtime configured to use othe smtp host. The option to you jBPM in a non-persistent (fully stateless, e.g. for STP) way will certainly remain or even made better.


                Kuketlje, I am just a little bit confused by the last sentence. You say "jbpm in a non-persistent way". Do you mean the way jBPM 4 will do or the way I want to do? From my perspective, the major reason why I can make my service stateless is jBPM 3 is with persistence. So my service does not need to carry the state along and it simply gets from persistence.

                Thank you for answering all my questions. You are really warm-hearted! =D

                • 5. Re: jBPM 4 Design Question: Stateful Process Instance
                  kukeltje

                  Ok, now I understand what you mean. I thought you did not need any persistance at all.

                  jBPM can already be used with persistence or not. That will certainly stay with jBPM 4. So if you do not want to persist anything yourself, you can user processinstances for that. Keep in mind though that it is not good practice to store a full domain model in jBPM via variables. Those should be separated.

                  • 6. Re: jBPM 4 Design Question: Stateful Process Instance
                    benhu

                     

                    "kukeltje" wrote:
                    how do you mean stateless? Is that the same as no persistence to you? 95% of current jBPM usage is with persistance, Can you point me to the wiki page and tell me what you think this statefull means?


                    What are the other 5% of usage which is without persistance? How about the situation in coming jBPM 4?

                    • 7. Re: jBPM 4 Design Question: Stateful Process Instance
                      kukeltje

                      - Pageflow in Seam
                      - SOA

                      So 95% is probably decreasing and the other perccentage increasing. Has nothing to do with jBPM 3 or 4....