Setting Up SAP Cell and Gene Therapy Orchestration Event Mesh

Objectives

After completing this lesson, you will be able to:
  • Add a service plan for SAP Event Mesh
  • Create an instance
  • Create a subscription
  • Grasp SAP Business Technology Platform service default plan Concept in SAP Event Mesh
  • Configure inbound and outbound communication scenarios using SAP Event Mesh

Architecture of SAP Event Mesh

This is a high-level architecture diagram of SAP Cell and Gene Therapy Orchestration consuming the event mesh services to publish and consume the inbound/outbound events.

Diagram displaying SAP BTP integration architecture. Two sections labeled Provider Subaccount and Subscriber Subaccount. The Provider Subaccount contains Event Mesh (Default) CGT Namespace and CGT Event Service with arrows indicating Event Inbound and Outbound. The Subscriber Subaccount shows CGT Services (subscribed), Event Mesh (Default) CGT Namespace connecting to Queue, and Event Mesh (Default) Customer Namespace. Arrows demonstrate Event Delegate and interaction with a computer icon for Event Trigger and Event Consumption.

The customer needs to subscribe to the Event Mesh Standard plan to access the dashboard. EM Dashboard will allow customers to maintain the Queue, Webhook, and so on. Customers also have to subscribe the Event Mesh Default plan (in customer namespace). The descriptor of this instance should have the delegation established with the Event Mesh (subscribed) instance (CGT Namespace). Additionally, a service key needs to be generated.

The credentials of service key will be required to pass by external system to generate OAuth token for publishing/subscribe the event.

Add Service Plan

Customers who subscribe to SAP Cell and Gene Therapy Orchestration must also create a subscription to the SAP Event Mesh default plan in order to integrate with other applications.

Note

You need to buy this service plan additionally, this is not included as part of SAP Cell and Gene Therapy Orchestration subscription.

To configure the default plan, you need to add service plan under the entitlement section.

Steps

  1. In the same subaccount, go to entitlement section.

  2. Configure Entitlements Add Service Plans.

  3. In the Subaccount Entitlements dialog box, choose the Event Mesh service.

  4. In the Service Details: Event Mesh window, choose both the service plans.

  5. Choose Add 2 Service Plans to add this entitlement for the Event Mesh service in your subaccount.

  6. Choose Save.

    Note

    If the entitlement isn't available then go to global account level and add the entitlement on global account level. If no entitlement is available at global account level, then reach to the SAP Business Technology Platform support.

Result

A service plan is added into the subaccount and can be seen by typing event into the search box.

Screenshot of a service entitlement interface showing a table with columns: Service, Technical Name, Plan, Assign Quota, Subaccount Assignment, Remaining Global Quota, and Actions. Two entries are visible for Event Mesh, with technical names enterprise-messaging and enterprise-messaging-hub, having plans default and standard (Application) respectively. The interface features a search bar with eve entered and a Configure Entitlements button.

Create Instance

In this step, you will create the instance for SAP Event Mesh service. The service plan added in the previous step will be visible and used to create the instance. Follow these steps:

Steps

  1. On subaccount level, navigate to Instance and Subscription menu. Go to Instance tab, choose Create.

    Screenshot of the SAP BTP Cockpit interface in the Instances and Subscriptions section. The sidebar displays options like Services, Cloud Foundry, and Connectivity. The 'Instances' tab is selected, showing Instances (0) indicating no instances are currently listed. A search bar with filters for All Services, All Plans, and All Statuses is present. A Create button is highlighted in the top right corner.
  2. In the dialog box, search the service plan using "Event Mesh" as a search term. The SAP Event Mesh service plan added by the entitlements step would be visible in the list.

  3. Choose the service plan "Event Mesh".

  4. Select the default - Instance plan. There are two types of plans available in the dropdown menu named standard and default. Choose the default plan.

    Screenshot of the SAP BTP Cockpit interface for creating a new instance or subscription. On the left, dropdowns show selections for Service as Event Mesh and Plan as default. On the right, the Basic Info step is filled out with Service as Event Mesh, Plan as default, Runtime Environment as Cloud Foundry, Space as sub, and Instance Name as cgto-dev-em. Options for Next, Create, or Cancel are available. Steps 2 and 3 (Parameters, Review) are indicated but not detailed.
  5. Choose runtime as Cloud Foundry.

  6. Choose Space.

    Note

    The space was created in previous lesson.
  7. Enter Instance Name (for example, cgto-dev-em).

    Note

    You can use your own instance name, follow the naming guidelines provided under the information icon.

  8. Choose Next.

  9. The following service descriptor should be provided during an instance creation of the SAP Event Mesh.

    Code Snippet
    123456789101112131415161718192021222324252627282930313233
    { "version": "1.1.0", "emname": "<em-instance-name>", "namespace": "<namespace>", "options": { "management": true, "messagingrest": true, "messaging": true }, "rules": { "topicRules": { "publishFilter": [ "${namespace}/*", "*" ], "subscribeFilter": [ "${namespace}/*", "*" ] }, "queueRules": { "publishFilter": [ "${namespace}/*" ], "subscribeFilter": [ "${namespace}/*" ] } } }
  10. Update emname and namespace during instance creation.

    Screenshot of the SAP BTP Cockpit interface in the New Instance or Subscription process. On the left, step 2 Parameters shows JSON input with parameters like version, name, and namespace. The Next button is highlighted. On the right, step 3 Review displays instance details such as Service: Event Mesh, Plan: default, Runtime Environment: Cloud Foundry, Space: sub, and Instance Name: cgto-dev-em. A note states Creating an instance might take a while. The Create button is highlighted.

    Note

    To update emname and namespace during instance creation refer to more information Syntax for Service Descriptor.

  11. Choose Next and Create.

Result

The Event Mesh instance is created.

Screenshot of the SAP BTP Cockpit in the Instances and Subscriptions section. The left pane shows the navigation menu with sections like Services and Cloud Foundry. The center pane lists one instance cgto-dev-em with status Created. On the right, the instance details are shown: Instance ID, Service as Event Mesh (enterprise-messaging), Plan as default, Runtime Environment as Cloud Foundry, Space as sub, and Status as Created. Options for Bound Applications, Service Keys, and Labels are present, with no bound applications shown.

As next steps: Optionally, you can subscribe to the SAP Event Mesh standard plan that creates a Dashboard for SAP Event Mesh. However, SAP recommends that you subscribe to this plan as it would be easier for you to maintain the SAP Event Mesh setup. Otherwise, you need to work with the API plan and setup the event mesh objects through APIs, which is quite technical in nature and you need developer skills for this same purpose.

Create Subscription

In this step, you can create the subscription for SAP Event Mesh to access the application. Complete the following steps:

Steps

  1. On subaccount level, navigate to Instance and Subscription menu. Go to Subscription tab, choose Create.

  2. In the dialog box, search the service plan using "Event Mesh" as search term. The SAP Event Mesh service plan added through the entitlements step will be visible in the list.

  3. Choose the service plan "Event Mesh".

  4. Select the correct subscription plan. There are two types of plans available in dropdown menu named Subscription and Instance. Choose the Subscription plan.

    Screenshot of the SAP BTP Cockpit in the Instances and Subscriptions view. The Subscriptions tab is selected, showing 2 subscriptions, including an SAP Cell and Gene Therapy Orchestration labeled as Subscribed. The sidebar menu includes options like Cloud Foundry and Connectivity. A Create button is at the top. Below, the New Instance or Subscription form is partially filled with Service set to Event Mesh and Plan to standard. Options to Create or Cancel are available.
  5. Choose Create.

Result

You have subscribed to the SAP Event Mesh application.

Screenshot of the SAP BTP Cockpit showing the Subscriptions tab. Two applications are listed: SAP Cell and Gene Therapy Orchestration - Preprod with the plan prerel and Event Mesh with the plan standard. Both have the status Subscribed. Options for further actions are available via ellipsis menus on the right. The interface indicates there are no instances and one environment.

Open Application

Open the created subscription and choose Go to Application.

Screenshot of the SAP BTP Cockpit in the Instances and Subscriptions section. The sidebar menu includes options like Cloud Foundry and HTML5 Applications. The Subscriptions tab lists two applications: SAP Cell and Gene Therapy Orchestration and Event Mesh, both labeled as Subscribed. The right pane shows details for Event Mesh with plan standard, status Subscribed, and creation date 17 Jul 2023. A description of SAP Event Mesh service is shown. The Go to Application button is available at the top right.

You will get the Unauthorized error.

Screenshot of a web browser displaying an SAP Event Mesh authorization error. The page states You are not authorized to access the SAP Event Mesh Cockpit. Get your user assigned to a role to gain access. A link is provided for Create User Groups, Role Collection and Assign Role Collection. The browser's URL bar shows part of the SAP Cloud Platform domain.

Add Event Mesh Roles

In order to solve the authorization issue, go to the security menu at the subaccount level and assign the role collections to the user. For more information, refer to User Roles for Event Mesh.

Screenshot of the Assign Role Collection interface. The search bar contains the term enterp, filtering the list to show four roles: Enterprise Messaging Administrator, Enterprise Messaging Developer, Enterprise Messaging Display, and Enterprise Messaging Subscription Administrator, all checked. Each role has a description for its purpose. Selected roles are listed below with options to remove them. Assign Role Collection and Cancel buttons are at the bottom.

Note

In this reference image, all the role collections has been shown and selected for a user. However, you can choose the required role collection and assign it to the user accordingly.

The user is assigned to the selected role collection.

Screenshot of the SAP BTP Cockpit in the Users section under Security. The sidebar menu shows options like Services, Cloud Foundry, and Connectivity. The right pane displays the Role Collections tab with a search bar. Listed roles include Enterprise Messaging Administrator, Enterprise Messaging Developer, Enterprise Messaging Display, and Enterprise Messaging Subscription Administrator, each with a description. The Assign Role Collection option is available. A Delete button is in the top right corner.

Application View

Screenshot of the SAP Event Mesh interface in the Message Clients section. Three message clients are displayed: dpiv2-em and cgt-em, both listed as Type: Subscription, and cgt-test-sub2-em as Type: Instance. Each client has its own endpoint information displayed. The left sidebar includes options like Default Plan, Queues, and Resource Allocation. A Refresh button is located in the top-right corner.

Try to launch the event mesh application again from the Subscription tab. You can see the application view of the SAP Event Mesh. You have noticed that there are three message clients created.

  1. dpiv2-em type subscription
  2. cgt-em type subscription
  3. cgt-test-sub2-em type instance → This is the instance created by you in a previous step

In next chapter, you will learn how to integrate the SAP Cell and Gene Therapy Orchestration application to other SAP/Non SAP application through the SAP Event Mesh.

Concepts

The SAP Cell and Gene Therapy Orchestration solution is build on the concept of event-driven architecture. SAP Cell and Gene Therapy Orchestration leverages the SAP Business Technology Platform event mesh service as the backbone to integrate with other applications.

Screenshot of the SAP Event Mesh interface in the Message Clients section. Three message clients are displayed: dpiv2-em and cgt-em, both listed as Type: Subscription, and cgt-test-sub2-em as Type: Instance. Each client has its own endpoint information displayed. The left sidebar includes options like Default Plan, Queues, and Resource Allocation. A Refresh button is located in the top-right corner.

Before you configure the SAP Event Mesh service, it's important to understand the terminology used.

Queues

Queues are message queues that retain messages and allow applications to communicate with each other. When a receiver application connects to a queue using a messaging protocol, the messages from the queue are transferred to the application.

Topics

A topic is a container that holds and distributes messages to numerous queues or applications. Topics do not retain messages and must be kept updated with the Queue Subscriptions.

Queue Subscription

Queue Subscriptions allow a publisher to publish messages to a topic, which is then distributed to the queues that have subscribed to the subject.

Message Client

A message client allows you to connect to the service through its unique credentials to send and receive messages. The message client can run within SAP BTP or outside it. You can create multiple message clients that can be distinguished with a set of credentials that consist of a namespace and connection rules. Furthermore, the credentials must define the list of queues or topics to which the message client can send or receive messages. The credentials are stored in the service descriptor that you define while creating a service instance.

Name Space

A distinct prefix that identifies all queues and topics generated in the context of a specific message client. Message clients can use this to identify queues or topics.

Note

The Event Mesh has specific syntax rules for naming Queues, Topics, and Subscriptions. For more information, see the following: Syntax for Naming Queues, Topics, and Topic Patterns.

SAP Cell and Gene Therapy Orchestration Inbound Scenario

For SAP Cell and Gene Therapy Orchestration subscribers, there are two main topics provided by SAP Cell and Gene Therapy Orchestration for inbound and outbound integration scenarios through events.

Inbound Communication → Publishing events to SAP CGTO Topics:

Any third-party application or any solution, which are required to send the inbound message to SAP Cell and Gene Therapy Orchestration, has to publish the event to Inbound topic named ﹤namespace-cgt>/inbound/events/receiver. SAP Cell and Gene Therapy Orchestration applications establish a messaging protocol with the queue using AMQP/HTTP and consume these messages from the queue.

In the case of the request scenario, the following are the predefined topic and queue name.

  • Topic - ﹤namespace-cgt>/inbound/events/receiver

  • Queue - ﹤namespace-cgt>/inbound/events/receiver

These are predefined by SAP Cell and Gene Therapy Orchestration and can be found in the Queues tab under the message client "cgt-em" in the SAP Event Mesh application portal page.

Composite screenshot depicting two SAP Event Mesh scenarios. The top section, labeled Inbound - Request Scenario, features a message client setup with subscription details, including a Queue Name default/sap-cgt-inboundeventsreceiver and a subscribed topic. The bottom section, labeled Inbound - Response Scenario, displays another message client with a different Queue Name default/sap-cgtinb05/response and subscribed topic details. Each scenario shows part of the interface for creating and managing queue subscriptions.

Note

Since the message client "cgt-em" is maintained by SAP, customers need to get in contact with SAP Team or Partner implementation team to get the required API URL and keys to publish the event into these queues. For more information on publishing refer to Use REST APIs to Send and Receive Messages.

On consumption of a request event published by the subscriber, SAP Cell and Gene Therapy Orchestration applications send a response based on its business logic. This response is published by SAP Cell and Gene Therapy Orchestration in the SAP Event Mesh Instance of the subscriber in a predefined topic named <namespace-cgt>/inbound/responses.

Note

For response queue, you need to create the response queue and queue subscription using predefined topic name "﹤namespace-cgt>/inbound/responses" in customer-specific message client that is, cgt-test-sub2-em used in this lesson.

In the reference image above, Event Mesh - CGTO Inbound Scenario, a customer-specific message client is used named "cgt-test-sub2-em". While creating the queue, the namespace "default/sap.cgt/-" is copied and added before "/inbound/responses" to provide the topic name.

Create Order

Let's take an example of creation of Treatment Order.

Flowchart illustrating the interaction between a Patient Information System, SAP Event Mesh, and SAP CGTO. The Patient Information System creates a treatment order and subscribes to a topic to get the order ID. Within SAP Event Mesh, a pre-defined topic name default/sap.cgt/-/inbound/events/receiver and queue name default/sap.cgt/-/inbound/events/receiver are used. It connects to SAP CGTO via AMQP/HTTP to create an order, receiving a response with order ID payloads. The response uses a customer queue name default/sap.cgt/int001/response and a pre-defined topic default/sap.cgt/-/inbound/responses.

Steps

  1. A request (in form of event) from patient information system is sent to the SAP Event Mesh Service topic name "default/sap.cgt/-/inbound/events/receiver".

    Note

    You need to ask for the API details to publish the data into this queue. For more information on how to publish the event using Rest API, refer the documentation link, Use REST APIs to Send and Receive Messages.

  2. In the SAP Event Mesh, topic send this event to an inbound queue named "default/sap.cgt/-/inbound/events/receiver" (pre-delivered by SAP already).

  3. SAP Cell and Gene Therapy Orchestration applications establish a messaging protocol with the Queue using AMQP/HTTP and consume these messages from the queue.

  4. In SAP Cell and Gene Therapy Orchestration, information provided in the request payload is verified and the application creates the treatment order number.

  5. The SAP Cell and Gene Therapy Orchestration application tries to look up the customer namespace's queue created with pre-defined Topic - "<default/sap.cgt/-/inbound/responses" - if it is found, the response message is pushed to the customer namespace queue 'default/sap.cgt/int001/response'.

  6. The Patient information system needs to keep listening to this response queue and consume the response messages from this queue. The technical implementation can be done either by configuring the webhook option or using any other middleware to directly consume the queues using REST API.

SAP Cell and Gene Therapy Orchestration Outbound Scenario

In the case of an outbound scenario, SAP Cell and Gene Therapy Orchestration publishes an Outbound event based on actions or changes made by you or certain Inbound events. The event is published by SAP Cell and Gene Therapy Orchestration in your SAP Event Mesh instance in the pre-defined topic named <namespace-cgt>/outbound/events.

Screenshot of the SAP Event Mesh interface showing the Queue Subscriptions dialog for the cgt-test-sub2-em subdomain. The dialog displays a queue that can subscribe to specific topics as per the service descriptor. The Queue Name is default/sap.cgt/int001/cgtinbound, with a subscribed topic name default/sap.cgt/-/outbound/events. There is an option to add more topics and a delete action available for the current subscription. The background lists existing queues under the Queues tab.

Note

For any third-party application or any solution that is required to consume the outbound message from this pre-defined topic, you need to create the create a Queue and a Queue subscription.

In reference image above, Outbound Scenario, the customer-specific message client used is named "cgt-test-sub2-em". To add the topic name while creating queue, the namespace "default/sap.cgt/-" is copied from the "cgt-em" message client and added before the "/outbound/events".

The SAP Cell and Gene Therapy Orchestration application looks up the queue created with this pre-defined topic and publishes the outbound event to this queue. Customers can consume this queue either by configuring the webhook or directly consuming the queues using any other SAP/Non SAP middleware solution.

Example: Outbound Scenario

The SAP Cell and Gene Therapy Orchestration application has many outbound events available like Approve Details Update in treatment order, Processing Node planned date update, and Update Logistic Details for bio specimen shipment scenario and many more.

Flowchart showing the interaction between SAP CGTO, SAP Event Mesh, and a Patient Information System. In SAP CGTO, an order is approved, triggering an outbound event. This event is sent to a pre-defined topic default/sap.cgt/-/outbound/events in SAP Event Mesh. From there, it proceeds to a customer queue named default/sap.cgt/int001/cgto/outbound. The Patient Information System subscribes to this queue to receive the event, with or without middleware.

Let's take an example of an approval details update of Treatment Order. When the treatment order is approved for processing in the SAP Cell and Gene Therapy Orchestration application, it is important for a Patient information System to keep the status updated for the treatment order. The Patient Information System needs to consume this outbound event by connecting to SAP Event Mesh.

Here are the high-level steps:

Steps

  1. Order is approved in SAP Cell and Gene Therapy Orchestration, an outbound event is triggered.

  2. SAP Cell and Gene Therapy Orchestration will look up the pre-defined topic 'default/sap.cgt/-/outbound/events' configured in customer namespace event mesh instance and if found, event is pushed into the queue named "default/sap.cgt/int001/cgto/outbound".

  3. The Patient information system need to keep listening to this outbound queue and consume the outbound messages from this queue. The technical implementation can be done either by configuring the webhook option or use any other middleware to directly consume the queues using REST API approach.

Log in to track your progress & complete quizzes