Recursive Service Orchestration - Composed Service

SO-3811: Recursive Service Orchestration POCClosed

New building blocks for creating and deleting child services

  • CreateChildServiceBB

  • DeleteChildServiceBB


The 2 new BPMN's will be very similar and perform the same steps as illustrated above.

Each child service defined in the request will map to a building block, i.e. a request with 3 child services will run CreateChildServiceBB 3 times.

Child requests are processed sequentially.

Build Create-Request

Parse request payload and build ServiceInstancesRequest object for child service. Use Service Instance name to differentiate which child to parse.

Service Instance Id for the child service should be generated in WorkflowAction, and passed in the new request object.

A correlation id should be generated and passed in requestDetails.requestInfo.correlator, this will be used to correlate message from child process to parent.

Parent request id should be passed in requestDetails.requestInfo.requestorId

Parent instance and model details should be passed in the relatedInstanceList with instanceDirection=source. This will indicate a child request.

"relatedInstanceList": [ { "relatedInstance": { "instanceId": "351262fb-4a32-4c43-b600-c6514f6ff808", "modelInfo": { "modelVersion": "{{svc_modelVersion}}", "modelVersionId": "{{svc_modelVersionId}}", "modelInvariantId": "{{svc_modelInvariantId}}", "modelName": "{{svc_modelName}}", "modelType": "service" }, "instanceDirection": "source" } } ],

Count levels of recursion and number of children to calculate appropriate TimeOut

Set Execution Variables:

CHILD_SVC_REQ_PAYLOAD
CHILD_SVC_REQ_CORRELATION_ID
CHILD_SVC_REQ_TIMEOUT

Send Request

Send via REST to apihandler. If request fails throw WorkflowException

Set Execution Variables:
CHILD_SVC_REQ_ID

Wait for completion

When child create process finishes, it should create a message which will be correlated using messageName and correlation id in requestInfo. Variables will to be passed in message:

CHILD_SVC_REQ_STATUS = FAILED | COMPLETED
CHILD_SVC_REQ_ERROR = workflow error message

Handle Failure

Build a workflow exception using error message from child request (CHILD_SVC_REQ_ERROR)

Update AAI

Set relationship between parent and child service.

Create Child Service workflow

  1. Request to API-handler for parent service

  2. Validating request for parent service in API-handler

  3. Call WorkflowActionBB for parent service

  4. Call AssignServiceInstanceBB for parent service

  5. Call CreateChildServiceBB for child service

  6. Building create request for child service

  7. Request CREATE for child to ServiceInstances API for child service

  8. Validating request for child service in API-handler

  9. Call WorkflowActionBB for child service

  10. Execute all relevant building blocks for child service

  11. Create AAI relationship between parent service and child service

  12. ActivateServiceInstanceBB for parent service

*bold actions repeats recursively for every child service

Delete Child Service workflow

  1. Request to API-handler for parent service

  2. Call WorkflowActionBB for parent service

  3. Check service instance resources (child services) in AAI for parent service

  4. Call DeleteChildServiceBB for child service

  5. Building delete request for child service

  6. Request DELETE to ServiceInstances API for child service

  7. Call WorkflowActionBB for child service

  8. Execute all relevant building blocks for child service

  9. Call DeactivateServiceInstanceBB for parent service

  10. Call UnassignServiceInstanceBB for parent service

*bold actions repeats recursively for every child service



List of Macro flow "Service-Macro-Create" Building blocks (composed service): 

AssignServiceInstanceBB
CreateChildServiceBB
ActivateServiceInstanceBB

List of Macro flow "Service-Macro-Delete" Building blocks (composed service): 

DeleteChildServiceBB
DeactivateServiceInstanceBB
UnassignServiceInstanceBB

Message Correlation (from child process)

The process creating the child service, must be able to identify that it is a child process. An Execution variable IS_CHILD_PROCESS should be set early in WorkflowActionBB.

In each update method which runs before the process ends, we need to add logic to check the 
IS_CHILD_PROCESS variable. If true, then a message should be created and correlated to its parent process using the provided correlation id in the request and the predefined message name constant (CHILD_SVC_REQ_MESSAGE_NAME). The message should set variables:


CHILD_SVC_REQ_STATUS = FAILED | COMPLETED
CHILD_SVC_REQ_ERROR = error message or blank



Recursive Orchestration in SO Macro flow details