Services

Services are used to perform actions that require and/or manipulate entities from a variety of different namespaces.

Create services

A service can be created by using the Create service capability on the Services tab of the domain namespace's Overview page.

Services are defined using the following master data:

  • Type: There is one option available and this is the Domain Service (required)

  • Local Identifier: Identifier of the service. this value must be unique within the namespace and cannot be changed afterwards. Please note that only the characters A-z (without special characters), digits and the special character "_" are permitted for naming fields! Furthermore, identifiers may not begin with a digit (required)

  • Label: Label of the service (optional)

  • Short Label: Short label of the service (optional)

  • Notes: Useful information regarding the service definition (optional)

Attention: Services cannot have the same Local Identifier as a service or an agent in the same namespace.

Saga Pattern Role

For Domain Service Projects of type Java Spring Boot where the extension Saga Pattern Support is enabled, each Domain Service can be either be marked as a Saga Orchestrator or as Saga Participant.

Saga Orchestrator services are representing the starting point of a Saga. They are responsible to trigger the execution of the participants in the correct saga context.

Tip: If your Saga is spread across multiple microservices, every microservice needs to have at least one Orchestrator service in it.

For a service marked as a Saga Orchestrator the following input fields are needed:

  • On Compensate Method: If set to true automatically an onCompensate method will be generated.

  • On Complete Method: If set to true automatically an onComplete method will be generated.

  • Propagation Level: required, requires_new, mandatory, supports, not_supported, never

  • Completion mode: auto or manual

  • Participants: You can associate participants by using the Add action. All services of the project that are marked as Saga Participant are shown and can be associated. To remove the association you can either deselect or use the row action Remove.

Attention: Please note that changing the "Saga Pattern Role" field can break already implemented code!

Saga Participant services contain the actual execution logic of the steps within a Saga and are associated to an Orchestrator.

For a service marked as a Saga Participant the following input fields are needed:

  • On Compensate Method: If set to true automatically an onCompensate method will be generated.

  • On Complete Method: If set to true automatically an onComplete method will be generated.

  • Propagation Level: required, requires_new, mandatory, supports, not_supported, never

  • Completion mode: auto or manual

  • Options Expressions: Key-value pair used to define additional context for the Saga. They are sent by the coordinator, when compensating or completing. The value can be expressed in the camel expression language. For more information see also Apache Camel Saga EIP Options

Attention: Please note that changing the "Saga Pattern Role" field can break already implemented code! A Saga participant has no output. If an output is already set for the service, it will be deleted.

Edit services

Edit master data

You can edit the master data of a service by clicking the Edit service details button in the Service Details section on the service's instance page. Alternatively, you can use the Edit capability of each table row on the Services tab of a domain namespace's Overview page. The fields that can be edited are Label, Short Label and Notes.

Note: It's not possible to edit the Type and the Local Identifier of a service.

Edit Saga Details

For Domain Service Projects of type Java Spring Boot where the extension Saga Pattern Support is enabled, Saga Details can be changed via the *Edit master

For a service marked as a Saga Participant the following fields can be altered:

  • Propagation Level: required, requires_new, mandatory, supports, not_supported, never

  • Completion mode: auto or manual

  • On Compensate Method: If set to true automatically an onCompensate method will be generated.

  • On Complete Method: If set to true automatically an onComplete method will be generated.

  • Options Expressions: Allows to add Key Value pairs.

Attention: Please note that changing the "Saga Pattern Role" field can destroy already implemented code! A Saga participant has no output. If an output is already set for the service, it will be deleted.

For a service marked as a Saga Orchestrator the following fields can be altered:

  • Propagation Level: required, requires_new, mandatory, supports, not_supported, never

  • Completion mode: auto or manual

  • On Compensate Method: If set to true automatically an onCompensate method will be generated.

  • On Complete Method: If set to true automatically an onComplete method will be generated.

  • Associated Participants: You can associate participants by using the Add action. All services of the project that are marked as Saga Participant are shown and can be associated. To remove the association you can either deselect or use the row action Remove.

Attention: Please note that changing the "Saga Pattern Role" field can destroy already implemented code!

Add input entity

It is possible to assign an Input entity to a service by either clicking on Create new private entity or Select existing entity in the Input section of the service's instance page. To add properties to the input entity click on the Add capability and choose

  • Create new property

  • Associate existing property

See Domain Properties for further details on creating properties.

Note: Please consider, that Saga Participants need to have the same input entity modeled as the Saga Orchestrators to which they are associated. The input will automatically be passed from the orchestrator to its participants.

Add output entity

It is possible to assign an Output entity to a service by either clicking on Create new private entity or Select existing entity in the Output section of the service's instance page. To add properties to the input entity click on the Add capability and choose

  • Create new property

  • Associate existing property

See Domain Properties for further details on creating properties.

Add business events

To add a Business Event to a service that will get published each time the service is executed, click on Add event in the Business Events section of the service's instance page. There are two options when adding an Event to a service:

  • Add new event

  • Add existing event

Regarding already existing events, a list of all the events that have been created in a project is shown. It is also possible to search for a specific event using the Search capability. One or more events can be selected in order to be added to the service.

Add business errors

To add a Business Error to a service that will get returned each time the service cannot be executed, click on Add error in the Business Errors section of the service's instance page. There are two options when adding an Error to a service:

  • Add new error

  • Add existing error

Regarding already existing errors, a list of all the errors that have been created in a project is shown. It is also possible to search for a specific error using the Search capability. One or more errors can be selected in order to be added to the service.

Delete services

You can delete a service by clicking the Delete service button in the upper right corner of the service instance page. Alternatively, you can use the Delete capability of each table row on the Services tab of a domain namespace's Overview page.

Attention: You will need to confirm the action before the selected service gets permanently deleted.