Last updated Apr 17, 2025
Internal use only

Orchestration

Currently orchestration layer is being used to:

  1. Enrich information such as invoice group, billing admins, site ids, shipTo address, etc.
  2. Retrieve documents.
  3. Send email to CTS which are not yet migrated to Post Office. We use isDispatchEmail property for this

Components and code flow

Code flow

Below is a sample requestDTO received by EnrichmentResource controller

1
2
{
    "messageTemplateId": "commerce-subscription-transferred-ccp",
    "triggerId": null,
    "eventMetaData": {
        "transactionAccountId": null,
        "timestamp": 1742798005074,
        "dispatchEmail": false
    },
    "notificationData": {
        "entitlementIds": [
            "d974cc11-579f-3621-8f17-2e7b2a9f1e18"
        ],
        "entitlementNumber": "E-439-NCU-C5S-HT4",
        "invoiceGroupId": "90eb8393-d02b-4be5-9843-da07643c45cc",
        "isPartner": false,
        "productName": "Confluence",
        "transactionAccountId": "159999bf-c3cf-4bc8-b257-13631920d95e",
        "oldTransactionAccountId": "159999bf-c3cf-4bc8-b257-13631920d95e",
        "offering": "Standard",
        "isTransferredFromBillingAccount": true
    }
}

Enrichment Service

  1. Enrichment Service is the main service inside orchestration layer. It creates a enrichment DTO(Data Trasfer Object) which is populated by all the data expected by the template
  2. The methods which populate this requested data in mapped in an Enrichment Config

Enrichement Processor

Enrichement Processor creates a list of the enrichment tasks and processes them while the task list is not empty. A task can be an independent task or can be dependent on other tasks. The processor handles this use case and executes tasks in sequentially as required. The information on which task rely on which other task in stored inside EnrichmentConfig.

Enrichement Condition

The conditions on whether data should be populated or not is maintained by Enrichment Conditions

Encrichment Context Model

Each request has a DTO and related DTO context. This DTO has the enrichmentContextModel object which contains properties used for enriching data.

Response Mapper

After the requested data is populated, it is mapped using dedicated response mappers to hydrate the final context to be sent back to data-ingestion service.

Below is the response from orchestration for the above mentioned requestDTO based on the data requested

1
2
{
    "template": "commerce-subscription-transferred-ccp",
    "recipientList": null,
    "templateAttributes": {
        "transactionAccountId": null
    },
    "messageTemplateData": {
        "context": {
            "entities": {
                "transactionAccountId": "159999bf-c3cf-4bc8-b257-13631920d95e",
                "transferredFromBillingAccountName": "Lemon Goat Consulting",
                "transferredToBillingAccountName": "Lemon Goat Consulting",
                "entitlements": [
                    {
                        "entitlementId": "d974cc11-579f-3621-8f17-2e7b2a9f1e18",
                        "entitlementNumber": "E-439-NCU-C5S-HT4",
                        "productName": "Confluence",
                        "offeringName": "Standard"
                    }
                ]
            },
            "facts": {
                "isPartner": false,
                "isTransferredFromBillingAccount": true
            }
        },
        "id": "commerce-subscription-transferred-ccp"
    },
    "cc": null,
    "bcc": [
        "sales-archive-stg@atlassian.com"
    ]
}

You can follow this sample PR for more understanding - orchestration sample PR

Rate this page: