Genpact Cora Knowledge Center

Support

Saga Configuration

Overview

The saga controls the process, it handles the steps in the queue and instructs the system to perform the next step. The saga runs the steps in the process through predefined business logic configured in the saga.yaml file. You can define a saga each for a different workspace. You can change the steps in the saga, but not the entire saga.

Saga steps

  1. Validation: The system validates that a request is not a repeating request.
  2. Business process: The system runs the steps in the process in an order, and after each process ends it moves to the next step to be performed.
  3. Audit log: The system adds the results of each step to the Audit log.
  4. Move to next queue: The system continues to the next queue after getting a message from the saga.

Configuration

You can define the process steps in saga with the following saga.yaml config file.

Template

kind: document 
metadata: 
  name: extraction/v1/documents/saga 
spec: 
  steps: 
  - name: IDE Extraction 
    version: 400 
    queueName: ide-extraction 
    queueDelaySeconds: 0 
    onSuccess: IDE Publisher 
    onFailure: IDE Extraction Completed 

  - name: IDE Publisher 
    version: 500 
    queueName: ide-publisher 
    queueDelaySeconds: 0 
    onSuccess: null 
    onFailure: null 

  - name: IDE Extraction Completed 
    version: 600 
    queueName: ide-extractioncompleted 
    queueDelaySeconds: 0
    onSuccess: null 
    onFailure: null 
Parameter Description
Name The step name.
Version The step order number.
queueName The message bus queue from which the steps are performed.
queueDelaySeconds The delay on which each step is performed in the process.
onSucess
onFailure
The step to be performed after the current step success and failure.
If the next step is null then it is the last step of the saga, or the system is instructed to skip the next steps.

For example, in the above template: 

- name: IDE Extraction 
    version: 400 
    queueName: ide-extraction 
    queueDelaySeconds: 0 
    onSuccess: IDE Publisher 
    onFailure: IDE Extraction Completed 

If the IDE Extraction is successful, then the IDE Publisher is performed, and on failure the IDE Extraction Completed is performed.