Once the workflow is finalized at BPEL end the call back url (originally configured in the api-manager.xml and sent to BPEL Engine in the outflow) of API Manager will be called to progress the workflow. In AM, endpoint has been made available in both SOAP and REST variants. They are respectively;
WSDLLocation : http://localhost:8280/services/WorkflowCallbackService?wsdl
Both the endpoints have been secured via Basic Authentication. Hence when invoking either, an Authorization header including a base64 encoded value of the User's username and password needs to be included, along with the request. (E.g :
Authorization: Basic <base64 encoded username:password>)
The endpoint expects the following list of parameters.
|The unique identifier sent to the BPEL against which the workflow is tracked in API Manager||YES|
|The next status to which the workflow needs to be promoted to.||YES|
|Notes, that may need to be persisted against a particular workflow.||NO|
A sample curl request for invoking the REST endpoint would be as follows.
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -X POST http://localhost:9763/store/site/blocks/workflow/workflow-listener/ajax/workflow-listener.jag -d 'workflowReference=b530be39-9174-43b3-acb3-2603a223b094&status=APPROVED&description=DESCRIPTION'
A sample SOAP request would be as below.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://callback.workflow.apimgt.carbon.wso2.org"> <soapenv:Header/> <soapenv:Body> <cal:resumeEvent> <cal:workflowReference>b530be39-9174-43b3-acb3-2603a223b094</cal:workflowReference> <cal:status>APPROVED</cal:status> <cal:description>DESCRIPTION</cal:description> </cal:resumeEvent> </soapenv:Body> </soapenv:Envelope>