Search code examples
wso2bpelapache-odewso2-business-process

WSO2 BPS BPEL reusing the async processes


Having WSO2 BPS 3.6.0 we have several long running asynchronous processes. I'd like to reuse a process in multiple other processes (e.g. error handling, common procedures, ..).

The problem is, that in that case multiple processes will expose the same callback service:

ERROR {org.wso2.carbon.bpel.core.ode.integration.store.TenantProcessStoreImpl} -  Service: {http://xxx/bps/xxx}XXCallback already used by another process. Try again with a different service name

How do I listen to the callback response from multiple processes? (assume I could provide correlation so the right instance is invoked)

I am considering to provider a little bit different service name (url fragment?) for each parent process (even exposing the same port) and use the ReplyTo header to force the correct callback url. I am still not sure if it's a correct approach.


Solution

  • Process1 & Process2 invoke the CommonProcess asynchrnously.

    Process1 & Process2 should implement the operation defined in Callback.wsdl

    CommonProcess will invoke the operation defined in Callback.wsdl to intimate Process1/Process2.

    ProcessPackage1

    • Process1.bpel
    • Process1.wsdl
    • CommonProcess.wsdl
    • Callback.wsdl

    ProcessPackage2

    • Process2.bpel
    • Process2.wsdl
    • CommonProcess.wsdl
    • Callback.wsdl

    CommonProcessPackage

    • CommonProcess.bpel
    • CommonProcess.wsdl
    • Callback.wsdl

    How to pass the EPR of Process1 & Process2 to CommonProcess for the callback?

    This can be done with DynamicEndpoints. The process EPR can be passed in the payload message during the invoke from Process1 or Process2 to CommonProcess. The CommonProcess will override the partnelink EPR that corresponds to Callback.wsdl with the EPR that has been passed with the incoming message.

    Here is a sample that demonstrates playing around Partnerlink EPR.

    https://github.com/apache/ode/tree/ode-1.3.x/distro/src/examples-war/DynPartner

    This documents some more on that option: http://ode.apache.org/endpoint-references.html

    Note: This is provided in Apache ODE, and might be available on WSO2.