1 Reply Latest reply on Aug 20, 2006 5:03 AM by Ronald van Kuijk

    Asynchronous continuations and Fork

    peter Apprentice


      I went through this forums about jbpm Asynchronous continuations and fork.
      i think i already understand the definition of the "Asynchronous and Fork" in jbpm.

      Now, the problem i want to ask is the same as most of the users want to know:

      start state -->fork -->A and B task node-->join --> end.

      Now, i need to make the actions within A and B task to be executed parally(from computing point of view).

      For jbpm3.1
      , what is the best way to implement this requirement?
      (My enviroment is JBossAS. So, threads must be managed by JbossAs itself.)

      I have a rough idea in my mind, please comment:

      (1)define both A and B as async="true". I think this is most for transaction management purpose. (not for parallel computing)

      Because jbpm build-in asynchronous messaging stores the command messages in JBPM_MESSAGE table, and CommandExecutor is designed to read the messages from the JBPM_MESSAGE table using seperate thread, THIS is not acceptable in jbossAS enviroment unless i implement JMX bean to adapter the CommandExecutor.

      (2)Based on above analysis, it seems that it is easier for me to implement the async myself in the task-node action by sending JMS message to JMS Queue and then i have messag driven bean (MDB) which is listening on the queue. Once one MDB instance read a message, it start corresponding tasks. At this point, i feel a bit blur because i am not sure what kind of info needed to passed to the MDB. (maybe i can refer to the JBPM_MESSAGE table).

      (3)what functions i needed to implement/code in the message driven bean? Especially, what functions i must to code to maintain the jbpm context(jbpm related information)?

      please help & comment