LogoLogo
Home
Core Platform
Core Platform
  • Introduction
    • Overview
    • Use Cases
    • Architecture
    • Built with ML & AI
    • Quick Start
  • Examples
    • Training Examples
      • API Flow Examples
      • Microservice Examples
      • UI Example
      • Exercise: Hello World API
      • Exercise: Test State
      • Exercise: Test UI
    • Exercise: To-do List
      • To-do List Runner
      • To-do List Gateway
      • To-do List UI
      • To-do List Query
  • Troubleshooting
    • Rierino Packages
    • Release Notes
    • Useful Checks
    • Error Codes
  • Devops
    • Overview
    • API Flows
      • Using the Saga Screen
      • Defining a Saga
      • Configuring Saga Steps
        • Event Step
        • Transform Step
          • Transform Classes
        • Condition Step
          • Condition Classes
        • Step Link
      • Injecting Variables
    • Microservices
      • Runners
        • Using the Runner Screen
        • Defining a Runner
        • Managing Runner Settings
        • Adding Runner Elements
        • Deploying Runners
          • Spring Runners
          • Samza Runners
          • Camel Runners
      • Elements
        • Systems
        • State Managers
          • Typical Use Cases
          • State Data Structure
          • Local States
            • In-Memory Map
            • Caffeine Cache
            • Samza Based
            • Lucene Based
            • Single File
            • Multiple Files
            • Selected IDs Map
            • Indexed Map
          • Shared States
            • MongoDB Collection
            • Jooq (SQL) Table
            • Redis Map
            • Couchbase Collection
            • Elasticsearch Index
            • Elasticsearch Joined
            • Etcd Namespace
          • Specialized States
            • CRUD Service
            • Odata Service
          • State Coordinators
            • Lazy Cache Coordinator
            • Event Store Coordinator
            • Write thru Coordinator
          • Loading Strategies
          • ID Generators
        • Listeners
        • Query Managers
          • MongoDB
          • Elasticsearch
          • Lucene
          • SQL Based
          • Odata Service
        • Handlers
          • Core Handlers
            • Write Data
            • Read Data
            • Query Data
            • Apply Rules
            • Call Rest API
            • Generate Text/Html
            • Parse Html
            • Generate Secrets
            • Orchestrate User Task
            • Perform File Operation
            • Run Shell Command
            • Send/Receive Emails
          • Custom Code Handlers
            • Run Scripts
            • Run Java Code
            • Run Java Package
          • Flow Handlers
            • Orchestrate Saga
            • Loop Each Entry
            • Run Multiple Steps
            • Buffer Payloads
            • Merge Parallel Steps
            • Log Event
            • Send Event
            • Validate Event
            • Transform Event
            • Perform DB Transaction
            • Trigger Runner Command
            • Do Nothing
            • Modify Role Data
            • Enrich Role Data
            • Convert Pulse to Journal
          • Gateway Handlers
            • Authenticate
              • No Authentication
              • State Based
              • Keycloak Based
            • Sessionize
          • Specialized Handlers
            • Apply Advanced Rules
            • Calculate Real-time Metrics
            • Score ML Models
            • Score LangChain Models
            • Service MCP Requests
            • Service A2A Requests
            • Consume Web of Things
            • Perform Text Embedding
            • Run Python Procedure
            • Generate Excel
            • Generate PDF
            • Call SOAP API
            • Integrate with Camel
        • Actions
        • Streams
          • Kafka Topic
          • CDC Feed
          • Camel Component
        • Roles
        • Generic Settings
        • Global Settings
      • Deployments
        • Defining a Deployment
        • Alternative Loaders
    • Gateway & Security
      • Gateway Servers
        • Gateway Systems
        • Gateway Channels
        • Gateway Services
        • Gateway Tokens
      • APIs
        • OpenAPI Specification
        • Response Formats
    • Administration
      • Managing Deployments
      • Sending Commands
      • Streaming Messages
      • Migrating Assets
    • Batch Tasks
      • Python Processes
      • Python Iterators
      • Python Processors
    • Pro-Code
      • Custom Handlers
      • Custom State Managers
      • Custom Query Managers
      • Custom CDC Managers
  • Design
    • Overview
    • User Interface
      • Apps
      • UIs
        • Listers
        • Widgets
          • Value Widgets
          • Array Widgets
          • Object Widgets
          • Indirect Widgets
          • Atom Widgets
        • Menus
          • Lister Menu Actions
          • Selection Menu Actions
          • Editor Menu Actions
          • Widget Menu Actions
          • Custom Menu Actions
          • RAI Menu Actions
        • Extended Scope
          • Conditional Display
          • Data Context
          • Extra Data
          • Default Item
          • Extra Events
      • Options
      • Translations
      • Icons
      • Styles
      • Components
    • API Mapping
    • Data Schema
      • Common Data
  • Configuration
    • Overview
    • Queries
      • Query Types
      • Query Platforms
        • MongoDB Queries
        • Odata Queries
        • SQL Queries
        • Elasticsearch Queries
        • Lucene Queries
        • Siddhi Queries
    • Business Rules
      • Drools Rules
    • Dynamic Handlers
  • Data Science
    • Overview
    • ML Models
      • Scheduler Platforms
        • Airflow Scheduler
    • GenAI Models
    • MCP Servers
    • Complex Event Processing
      • Siddhi Data Flows
    • Data Visualizations
    • Customizations
  • EXTENSIONS
    • JMESPath
    • Handlebars
Powered by GitBook

© Rierino Software Inc. 2025. All rights reserved.

On this page
  • Open the Saga Screen
  • Create a new Saga
  • Assign an ID
  • Define the Saga
  • Add Saga Steps
  • Define the Transform Step
  • Save the Saga
  • Test Your Saga
  1. Examples
  2. Training Examples

Exercise: Hello World API

This example describes development of a simple locally executed saga flow for train_rpc runner, which returns "Hello World" message in a detailed, step-by-step manner.

PreviousUI ExampleNextExercise: Test State

Last updated 3 months ago

Open the Saga Screen

Open the screen from your app. Unless you've modified your implementation, this screen is located at https://[YOUR_ADMIN_UI_DOMAIN]/app/devops/common/saga.

Create a new Saga

Click on "CREATE NEW" button on top of the menu lister of Saga screen. This will clear the contents of Saga design page, and allow you to create a new Saga from scratch.

Assign an ID

Provide a unique identifier to your new saga flow from top left corner marked with "ID: " tag and a pencil icon. For this example, we are using "hello_world-0001" as the id.

It is optional to enter an ID for assets created. If no ID is given, backend services can automatically assign an ID if an ID generator is configured for the related state manager. However, giving a recognizable ID for core assets such as sagas, queries, models simply facilitates easier communication and auditing.

If you will be giving your own IDs, it is recommended to use alphanumerical characters, hyphen and underscore followed by a 4 digit partition identifier (i.e. 0001 for assigning assets to partition 1). For assets which do not require partitioning (i.e. will not be created in very high volumes), the partition identifier can be ignored.

Define the Saga

Click on the circled edit icon for displaying Saga definition screen.

Enter the following details on displayed screen for describing your new Saga flow:

  • Saga Name: Hello World

  • Saga Domain (optional): util

  • Status: ACTIVE

  • Saga Description (optional): Returns "Hello World"

  • Saga Path: /HelloWorld

  • Version: 0

  • Allowed For: Train RPC

  • Auto Fail: true

These settings will mean that requests received on /HelloWorld URL path for train_rpc runner will trigger execution of this Saga flow as the first version of its kind.

"Allowed For" setting enables this Saga flow on a specific runner only, making sure unintended runners do not respond to this request. When left empty, all runners are allowed to execute the saga.

For this example, you do not need to set Resilience parameters. Click on the close icon on top right corner to apply changes.

Add Saga Steps

From the stencil, drag and drop a Start step to saga flow.

Similarly, drag and drop a Transform and Success step from the stencil. Your graph should look like the following after these actions:

Click on the Start step and you will see a link icon displayed on its right bottom corner, click on the link icon and then the Transform step to connect these two steps together.

Similarly, link Transform step to the Success step. Your graph should look like the following after these connections:

Define the Transform Step

Enter the following details on displayed screen for configuring your data transformation:

  • Step Name: Say Hello World

  • Step Description(optional): This step adds a static "Hello World" message.

  • Transform Class: Add Value to Payload

  • Transform Parameters:

    • Key: value, Value: {message: "Hello World"}

Click on "Apply" button on top right corner to apply changes close this dialog.

Why is there a Transform "Class"?

As a design principle, instead of crowding the stencil for possible activities (such as different transformation types), we chose to provide different options using "Class" or "Action" selection in our Saga steps.

This allows users to change process type for any given step simply selecting/entering a new value, instead of replacing it with a different one which could break ongoing runs and create discontinuity in tracing performance of steps.

Your Transform step should now have the name you entered as follows:

Save the Saga

Click on the "SAVE" button displayed on top right corner of the Saga screen.

You should receive a notification saying Saga was successfully saved.

Test Your Saga

Use your favorite API client or an internet browser to test your new API endpoint. Unless you've modified your implementation, this endpoint is available at https://[YOUR_ADMIN_API_DOMAIN]/api/request/train_rpc/HelloWorld.

You should receive a response with "200 OK" status and {message: "Hello World"} in its body for your GET requests.

Now that our steps are connected, it is possible to receive events, execute an action on them and return them with success code. However, we still need to change the event payload for returning "Hello World" message. To do this, click on the step and open its editor by clicking on the edit icon displayed on its top left corner.

Transform
Saga
Devops
Saga Screen
Create New Button
Saga ID Assignment
Definition Button
Hello World Saga
Saga Stencil
Saga Steps
Saga Link
Saga Links
Transform Step Icons
Transform Definition Screen
Defined Transform Step
Save Button