3 Replies Latest reply on Jul 25, 2006 2:07 PM by Ronald van Kuijk

    How to dispatch workflows/create an event handler loop?

    Ryan Hadley Newbie

      When I think of what a workflow engine does, it is essentially an event handler loop that is configured to appropriately dispatch the incoming messages:

      event loop
       get message from queue
       handle message by one of:
       - start new workflow, or
       - start next activity in a (suspended) workflow

      Based on the user guide http://docs.jboss.org/jbpm/v3/userguide/index.html, I can see how to define a workflow (as XML) and give the code behind the activities in the workflow (implement ActionHandler interface), but I don't understand how jBPM takes incoming "messages" and dispatches to the appropriate ActionHandlers. i.e. The user guide only has code snippets that are JUnit tests which create a workflow from an XML definition (ProcessDefinition.parseXmlString()) and then execute the workflow by pushing the token through it with token.signal() (i.e. 3.2. Database example in User Guide); there is no practical code example for a workflow application.

      Does jBPM provide such an event loop/dispatch capability? Or do I need to figure out how to implement this myself (using something like the code in ProcessInstanceBean.java, from the webapp example, and tie it into the Scheduler from chapter 12 in the User Guide)? If so, is there a simple example available?