Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

Partner – Microsoft – NPI EA (cat = Baeldung)
announcement - icon

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, visit the documentation page.

You can also ask questions and leave feedback on the Azure Container Apps GitHub page.

Partner – Microsoft – NPI EA (cat= Spring Boot)
announcement - icon

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, you can get started over on the documentation page.

And, you can also ask questions and leave feedback on the Azure Container Apps GitHub page.

Partner – Orkes – NPI EA (cat=Spring)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag=Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Reactive – NPI EA (cat=Reactive)
announcement - icon

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – LS – NPI EA (cat=Jackson)
announcement - icon

Get started with Spring and Spring Boot, through the Learn Spring course:

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

>> The New “REST With Spring Boot”

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth, to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project.

You can explore the course here:

>> Learn Spring Security

Course – All Access – NPI EA (cat= Spring)
announcement - icon

All Access is finally out, with all of my Spring courses. Learn JUnit is out as well, and Learn Maven is coming fast. And, of course, quite a bit more affordable. Finally.

>> GET THE COURSE
Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot.

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Partner – LambdaTest – NPI EA (cat=Testing)
announcement - icon

End-to-end testing is a very useful method to make sure that your application works as intended. This highlights issues in the overall functionality of the software, that the unit and integration test stages may miss.

Playwright is an easy-to-use, but powerful tool that automates end-to-end testing, and supports all modern browsers and platforms.

When coupled with LambdaTest (an AI-powered cloud-based test execution platform) it can be further scaled to run the Playwright scripts in parallel across 3000+ browser and device combinations:

>> Automated End-to-End Testing With Playwright

Course – Spring Sale 2025 – NPI EA (cat= Baeldung)
announcement - icon

Yes, we're now running our Spring Sale. All Courses are 25% off until 26th May, 2025:

>> EXPLORE ACCESS NOW

Course – Spring Sale 2025 – NPI (cat=Baeldung)
announcement - icon

Yes, we're now running our Spring Sale. All Courses are 25% off until 26th May, 2025:

>> EXPLORE ACCESS NOW

1. Overview

Apache Kogito is an open-source platform for building cloud-native business applications. In this tutorial, we’ll learn what we can do with it and how to build applications with Kogito integration.

2. What Is Kogito?

Unlike traditional business process management (BPM) tools that were created with monolithic architectures in mind, Kogito embraces a microservices-first and Kubernetes-native approach. It allows developers to model, execute, and monitor business processes and rules as standalone services that can scale independently.

Kogito’s architecture is heavily influenced by domain-specific languages (DSLs) and industry standards like BPMN 2.0 (Business Process Model and Notation) and DMN (Decision Model and Notation). These are not just visual representations — they become executable models, integrated directly into applications.

The name “Kogito” is derived from Latin “Cogito” (“I think”), whereas the “K” refers to Kubernetes and to the Knowledge Is Everything (KIE) open source business automation project from which Kogito originates.

3. Core Technologies Behind Kogito

Kogito is the modern evolution of two well-established projects that are also part of KIE:

  • jBPM – for modeling and executing business processes (using Business Process Model and Notation / BPMN)
  • Drools – a powerful rules engine (for decision logic using Drules Rule Language / DRL or  Decision Model and Notation / DMN)

Kogito extends and modernizes these technologies by providing cloud-native packaging, Quarkus and Spring Boot support, DevOps readiness, and seamless integration with tools like Prometheus, Grafana, and OpenAPI.

4. Key Features

4.1. Cloud-Native and Kubernetes-First

Kogito applications are designed to run natively on Kubernetes. This means automatic scalability, containerization, and resilience are built-in. Developers can deploy services independently and scale decision-making or workflow logic as demand changes.

4.2. Event-Driven Architecture

Kogito supports event-driven design through integrations with Apache Kafka, enabling asynchronous communication between services. This is essential for reactive, decoupled systems that can respond in near real-time to business events.

4.3. Model-Driven Development

Kogito emphasizes model-driven development with visual tools and editors for BPMN and DMN. These models are not just documentation — they’re compiled into executable services.

4.4. Developer-Centric Tooling

Kogito offers plugins for VS Code, online editors like Kogito Tooling, and native support for frameworks like Quarkus and Spring Boot, helping Java developers build automation services with minimal friction.

4.5. DevOps-Ready

Thanks to features like automated code generation, containerized deployment, and GitOps compatibility, Kogito fits neatly into CI/CD pipelines. It supports tracing with OpenTelemetry, monitoring with Prometheus and Grafana, and health checks compatible with Kubernetes’ liveness and readiness probes.

5. Use Cases

Kogito shines in domains where rules-based decision making and workflow orchestration are essential. Some typical use cases include:

  • Loan and insurance claim processing – automating complex rules for eligibility, approval, and routing
  • Customer onboarding – managing multi-step workflows with compliance checks and approvals
  • Supply chain management – triggering actions based on rules tied to inventory, logistics, and vendor behavior
  • Healthcare workflows – handling patient journeys, documentation, and rule-driven treatment protocols

6. Sample

Let’s create a small sample that demonstrates how Kogito works. We want a rule-based credit decision service with the following rules:

  • Loan applications need to contain the name and the age of the applicant as well as their income and existing debts.
  • If the applicant is younger than 18, we reject the application due the applicant’s minor status.
  • If the credit score is lower than 700, we reject the application as not being creditworthy.
  • If the applicant’s existing debts are higher than 50% of the income, we reject the application as not being creditworthy.
  • Otherwise, the application is approved.

For example, let’s send a list of applications to the service:

{
    "applications": [
        {
            "id": "1fe1aED7-ca61-Eeb4-78fA-55f5E568Aa8b",
            "person": {
                "name": "Mr Smith",
                "age": 25
            },
            "conditions": {
                "creditScore": 400,
                "income": 30000,
                "debt": 0
            }
        },
        {
            "id": "b2c0a268-aa6f-44b8-b644-f466cb35504c",
            "person": {
                "name": "Mrs Doe",
                "age": 35
            },
            "conditions": {
                "creditScore": 700,
                "income": 70000,
                "debt": 3000
            }
        }
    ]
}

And let’s check the result:

[
    {
        "id": "1fe1aed7-ca61-eeb4-78fa-55f5e568aa8b",
        "decision": "rejected-not-creditworthy"
    },
    {
        "id": "b2c0a268-aa6f-44b8-b644-f466cb35504c",
        "decision": "approved"
    }
]

6.1. Drools Rules

We can use Drools with its Rule Language (DSL) to implement the sample. The rule file could look like:

package com.baeldung.kogito.rules

unit LoanApplicationUnit

import com.baeldung.kogito.rules.model.LoanApplication
import com.baeldung.kogito.rules.model.Person
import com.baeldung.kogito.rules.model.Conditions
import com.baeldung.kogito.rules.model.Decision

rule "only-adults"
    salience 10
    when
        $application: /applications[
            person.age < 18
        ]
    then
        modify($application){
            setDecision(Decision.REJECTED_UNDERAGE)
        }
end

rule "Good Credit Score And High Income"
    when
        $application: /applications[
            person.age >= 18,
            conditions.creditScore >= 700,
            conditions.income > 2*conditions.debt
        ]
    then
        modify($application){
            setDecision(Decision.APPROVED)
        }
end

rule "Low Credit Score Or High Debt"
    when
        $application: /applications[
            person.age >= 18,
            (
                conditions.creditScore < 700 ||
                conditions.income <= 2*conditions.debt
            )
        ]
    then
        modify($application){
            setDecision(Decision.REJECTED_NOT_CREDITWORTHY)
        }
end

query applications
      $result: /applications
end

6.2. Kogito

If we want this to run as a microservice with an HTTP/REST endpoint, we simply create a Quarkus project and add this to the pom.xml:

<project>
    <dependencyManagement>
        <dependencies>
            <!-- ... -->
            <dependency>
                <groupId>org.kie.kogito</groupId>
                <artifactId>kogito-bom</artifactId>
                <version>${kogito.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- ... -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.kie.kogito</groupId>
            <artifactId>kogito-quarkus-rules</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <kogito.version>2.44.0.Alpha</kogito.version>
    </properties>

</project>

We need to be aware that:

  • the given Kogito version must support Quarkus 3
  • Kogito only supports the Quarkus RESTEasy extension, but not the Quarkus REST extension

Then, put the Drools rules file under src/main/resources. Kogito detects it automatically, so we can run the Quarkus application and send the request — via curl, for example:

curl -X 'POST' \
  'http://localhost:8080/applications' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
        "applications": [ 
            { 
                "id": "1fe1aED7-ca61-Eeb4-78fA-55f5E568Aa8b",
                "person": { 
                    "name": "Mr Smith", 
                    "age": 25 
                }, 
                "conditions": { 
                    "creditScore": 400, 
                    "income": 30000, 
                    "debt": 0 
                } 
            }, 
            { 
                "id": "b2c0a268-aa6f-44b8-b644-f466cb35504c", 
                "person": { 
                    "name": "Mrs Doe", 
                    "age": 35 
                }, 
                "conditions": { 
                    "creditScore": 700, 
                    "income": 70000, 
                    "debt": 3000 
                } 
            } 
        ] 
    }'

As we can see, it works without any Quarkus code. We could use the existing ecosystem to build and deploy the Quarkus microservice into any cloud environment.

6.3. Custom API

Kogito is a fast way to create the REST resource without the need to write any code. However, it may make sense for us to write the code for the API ourselves. This way, we can define the custom endpoint’s URL and the JSON schema for data exchange.

When sending the request, we can see that the response body contains the whole data from the request body, supplemented by the credit decision. We might have the idea to add the Jackson or JSON-B annotations to define read-only and write-only properties, but this would not be a good idea for the Drools rule model classes because the Drools engine internally JSON-serializes and -deserializes them, so this would not work.

So, we could create our custom REST resource and DTOs, use a mapper (for example, with MapStruct) to map the DTOs to the Drools rule models, and invoke a domain service that uses the Drools rules engine. Such a domain service could look like:

import org.kie.kogito.incubation.application.AppRoot;
import org.kie.kogito.incubation.common.MapDataContext;
import org.kie.kogito.incubation.rules.RuleUnitIds;
import org.kie.kogito.incubation.rules.services.RuleUnitService;
// ...

@ApplicationScoped
public class LoanApplicationService {
    @Inject
    AppRoot appRoot;
    @Inject
    RuleUnitService ruleUnitService;

    public Stream<LoanApplication> evaluate(LoanApplication... applications) {
        var queryId = appRoot
          .get(RuleUnitIds.class)
          .get(LoanApplicationUnit.class)
          .queries()
          .get("applications");
        var ctx = MapDataContext
          .of(
            Map.of("applications", applications)
          );
        return ruleUnitService
          .evaluate(queryId, ctx)
          .map(
            result -> result
              .as(MapDataContext.class)
              .get("$result", LoanApplication.class)
            );
    }

}

As we can see, we use a Kogito API that is still in an incubation state. But this API allows us to integrate the Drools rules engine into any Quarkus application.

7. Conclusion

In this article, we’ve learned about Kogito as an automation tool for creating cloud-native business applications. The project is currently still undergoing a lot of development, so interfaces are constantly changing. We can use the examples available on the Kogito Examples Repository as a guide.

As always, the code presented in this article is available over on GitHub.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

Partner – Microsoft – NPI EA (cat = Spring Boot)
announcement - icon

Azure Container Apps is a fully managed serverless container service that enables you to build and deploy modern, cloud-native Java applications and microservices at scale. It offers a simplified developer experience while providing the flexibility and portability of containers.

Of course, Azure Container Apps has really solid support for our ecosystem, from a number of build options, managed Java components, native metrics, dynamic logger, and quite a bit more.

To learn more about Java features on Azure Container Apps, visit the documentation page.

You can also ask questions and leave feedback on the Azure Container Apps GitHub page.

Partner – Orkes – NPI EA (cat = Spring)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

Partner – Orkes – NPI EA (tag = Microservices)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

eBook – HTTP Client – NPI EA (cat=HTTP Client-Side)
announcement - icon

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

Course – Spring Sale 2025 – NPI EA (cat= Baeldung)
announcement - icon

Yes, we're now running our Spring Sale. All Courses are 25% off until 26th May, 2025:

>> EXPLORE ACCESS NOW

Course – Spring Sale 2025 – NPI (All)
announcement - icon

Yes, we're now running our Spring Sale. All Courses are 25% off until 26th May, 2025:

>> EXPLORE ACCESS NOW

Course – LS – NPI (cat=Java)
announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

eBook Jackson – NPI EA – 3 (cat = Jackson)
Subscribe
Notify of
guest
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments