1 Reply Latest reply on Oct 4, 2012 8:32 AM by David Ward

    SwitchYard, JBPM and Webservice call with callback - please advise

    mvermand Newbie

      Hi,

       

      I'm quite new to SwitchYard and JBPM5, though have worked quite a lot with JBPM4.4.

       

      We are investigating if we can switch to JBPM5 (SwitchYard+bpm component).

      I need to create a (SwitchYard Service)Task in a bpmn flow that sends a message to an external webservice.

      Lets call this Task-A.

      Moreover, the external party must respond (async) within a definable time (for example 1 hour or 1 day...)

      Only if the external party responds within this time period,Task-A can be completed and the next task can be started.

      Else a different (error-reporting/fallback) task should be started.

      Task-A should be marked as (?) completed so in case a response of the external party arrives afterwards, this has no effect anymore.

       

      Can you give me any ideas in how to accomplish this?

       

      Challenge 1: Creating a callback to complete the Task-A:

       

      I found something similar (I think) in an example called "PersistentEmergencyServiceProcess", though

      I'm not sure it is a good staring point since:

      1) this handles about human tasks

      2) it has an ActiveWorkItemService.java class which states:

      * This class doesn't support ksession crashes. The ksession passed to its

      * constructor must leave through all the process execution.

       

      ==> what if the server get's restarted within the life-span of 1 hour or 1 day?

       

      Challenge 2: Creating a duedate/timeout on the Task-A:

       

      In JBPM4.4 it is quite easy to set a timer (duedate) on a task.

      How can this be done in JBPM5?

      I do not see such property on a Task in the JBPM Editor.

       

      Challenge 3: How to call an external webservice:

       

      Are there any available helper-classes to easely achieve this?

      Or should I just generate POJO from a WSDL and call this code from a bean?

       

       

      Any advice will be greatly appreciated!

       

      Michiel

        • 1. Re: SwitchYard, JBPM and Webservice call with callback - please advise
          David Ward Master

          Hi; thanks for your interest in SwitchYard!

           

          Reading through what you're looking for help on, most all of it is specific to jBPM, not SwitchYard.  I think that you will get more complete answers/options if you post in their discussion forum area, here: https://community.jboss.org/en/jbpm?view=discussions

           

          That said, let's talk about your "Challenge 3" a bit.  Using the POJO approach to call out to that external webservice is an option, for sure.  However - and I'm not sure which is better for your particular use case - you can also use SwitchYard to do that.  SwitchYard supports soap bindings inside "composite references", so it can call out to an external webservice in an outbound fashion.  Documentation for this is available in the Binding References with SOAP section of the documentation.  You can also see it in practice in the camel-soap-proxy quickstart in the SwitchYard distribution.

           

          Best regards,

          David