6 Replies Latest reply on Dec 18, 2007 4:02 AM by mandrita.ca

    Asynchronous Continuation with JBPM 3.2.2

    mandrita.ca Newbie

      Hi,

      Can anybody give a write up as to how to implement asynchronous continuation?Since there is one example with the graph oriented programing but nothing as such with the jpdl.
      In some forums I found out that when a node is set asynch="true" the messages are inserted into JBPM_MESSAGE table and an executor pojo reads from the table and executes the asynch node.
      However in this version i didn't find any table called JBPM_MESSAGE and moreover how can i implement this execution pojo to read from the table and execute the node?
      Any help will be appreciated.

        • 1. Re: Asynchronous Continuation with JBPM 3.2.2
          Tom Baeyens Master

          it s the JBPM_JOB table. it contains timers and messages combined.

          • 2. Re: Asynchronous Continuation with JBPM 3.2.2
            mandrita.ca Newbie

            Thanks Tom I found some entry related to the timer implementation of websale order application.

            But could you please give me some details as to how to go about implementing this asynchronous continuation after setting asych="true"?

            Actually I have to carry out some Point of View on this product so it will be great help if you could detail me the steps for asynchronous implementation with jbpm 3.2.2.

            Thanks.
            Mandrita.

            • 3. Re: Asynchronous Continuation with JBPM 3.2.2
              Tom Baeyens Master

              async="true" is all there is to it.

              make sure the job executor is running. see suite package for configuration details. the suite includes preconfigured web app that has the job executor configured.

              • 4. Re: Asynchronous Continuation with JBPM 3.2.2
                mandrita.ca Newbie

                Hi tom,
                I checked out the web.xml file of the deployed web-app and found the following entry:

                <servlet-name>JobExecutorServlet</servlet-name>
                <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
                <load-on-startup>1</load-on-startup>

                <servlet-mapping>
                <servlet-name>JobExecutorServlet</servlet-name>
                <url-pattern>/jobs</url-pattern>
                </servlet-mapping>
                So the job executor loads up on startup.But is there some other way I can verify the same?
                One more thing I am trying the fork-join concept.As the fork node states that it splits an execution path into branches.However when i associate two tasks with the fork handler and attach two action handler for the same to print the Thread IDs i find that the Thread IDs are same and also i verified that these classes are executed on the same thread as when one branch throws an error the entire execution stops.Also as you mentioned that pending messages get inserted into the JBPM_JOB table i didn't find any entry for the two asynch nodes.
                Where am i going wrong?Totally clueless...
                Please help.

                Thanks,
                Mandrita

                • 5. Re: Asynchronous Continuation with JBPM 3.2.2
                  Tom Baeyens Master

                  concurrent paths of execution don't have to run in separate threads if you're using persistence.

                  in persistent mode, you go from one state to another. in case of a fork, this is one token before the fork when the tx starts to multiple tokens after the fork when the tx ends.

                  in persistent mode, the number of threads that you use to calculate that tx is irrelevant. the important thing is that different transactions are isolated from each other.

                  single threaded fork calculation is easier for persistence.

                  • 6. Re: Asynchronous Continuation with JBPM 3.2.2
                    mandrita.ca Newbie

                    Hi Tom,

                    Thanks again but how can use this persistence concept to make two activities to go in parallel?Moreover how do i synchronise the activities in the join?
                    One more thing in the forums as well as in the userguide there was a mention that if a node is declared as asynch some message is dumped into a queue,to which there is a MDB configured-however there is no document or any sample code which can put all these informations into one place.

                    Could you please post some sample code so that the concept of handling asynchronous processes with jbpm 3.2.2 becomes more clear.

                    Please give more details since I have to implement a use case with jbpm.

                    Thanks,
                    Mandrita.