2 Replies Latest reply on Jan 29, 2011 11:20 AM by vsp

    jbpm5 setWaitForCompletion (async execution)

    vsp Newbie

      Hi,

       

      Can you give, or point me to, an example of how to execute tasks asynchronously by setting the "wait for completion" flag to false?   My model is constructed in Oryx, which doesn't support this flag for task elements (is this flag a BPMN property?), therefore, I need to set it programatically every time before starting or resuming execution of a process instance.    I assume it can't be done in the work item handler.

       

      I appreciate your help,

      Vlad

        • 1. jbpm5 setWaitForCompletion (async execution)
          Mauricio Salatino Master

          Hi there, as far as I know inside the process you should not declare if the behavior of an activity is async or sync. You can directly implement that logic inside your work item handler. Then depending on your scenario you can have async and sync implementations for the same activity and in runtime you can choose to bind only the one that you want to use.

          Greetings!

          • 2. jbpm5 setWaitForCompletion (async execution)
            vsp Newbie

            Mauricio, thanks for your reply.   That clarifies one thing (although I thought I saw something related to "wait for completion" functionality in the Eclipse modeler plugin).

             

            So, inside the work item handler, this method is implemented:

            executeWorkItem(WorkItem workItem, WorkItemManager manager)

             

            So, how do I start from a WorkItem object and set the wait for complete flag.   Can you please show a simple example.  I only seem to find examples of how to do it when constructing the model programatically node by node.

             

            Thanks