Difficulty: beginner
Estimated Time: 10 minutes

In this scenario, you will get an introduction to Kogito.

What is Kogito?

Logo

Cloud Native Business Automation

Business Automation covers the application area of business processes, workflows, decisions, rules and optimization. Kogito brings these capabilities to the Cloud Native world by utilizing the latest innovations in the Java landscape, like Quarkus and GraalVM, while building on battle-tested components.

The introduction of the microservices architectural style, and the rapid move to containers and cloud, has introduced new requirements for business applications. Decision and process logic form a large part of an enterprises IT landscape. The move to these new, highly distributed, application environments requires a new form of process automation and decision management. A form of business automation that utilizes concepts like microservices, reactive and event-driven applications, and serverless deployments and execution.

Kogito has been designed with this new world in mind, and provides first-class support for these different paradigms. The Kogito development model morphs to adapt itself to the type of application you are developing.

Kogito is a a Cloud Native Business Automation stack targetted at modern runtimes like Quarkus and Spring Boot. It's built on battle-tested capabilities like Drools, jBPM and OptaPlanner. Amazingly fast boot time, incredibly low RSS memory (not just heap size!) offering near instant scale up and high density memory utilization in container orchestration platforms like Kubernetes.

Kogito ergo Cloud

Kogito is designed from ground up to run at scale on cloud infrastructure. If you think about business automation think about the cloud, as this is where your business logic lives these days. By taking advantage of the latest technologies (Quarkus, knative, etc.), you get amazingly fast boot times and instant scaling on orchestration platforms like Kubernetes.

Kogito ergo Domain

Kogito adapts to your business domain rather than the other way around. No more leaking abstraction of the tool into your client applications. Stay focused on what the business is about, instead of being concerned with technology behind it.

Kogito ergo Power

Kogito offers a powerful developer experience based on battle-tested components. Achieve instant developer efficiency by having:

  • Tooling embeddable wherever you need it
  • Code generation taking care of 80% of the work
  • Flexibility to customize, only use what you need
  • Simplified local development with live reload

Other possibilities

Learn more at kogito.kie.org, or just drive on and get hands-on!

In this scenario, you learned about Kogito, and how it can be used to create cloud-native business automation applications. Kogito provides an effective solution for running business automation workloads, like processes, workflows, decisions and rules, in this new world of serverless, microservices, containers, Kubernetes, FaaS, and the cloud, because it has been designed with these use-cases in mind.

Its domain-driven and developer-focussed approach for cloud-native business applications is achieved through the extensive use of code generation based on your business assets (e.g. process definitions, decision models). This allows you to focus on the actual business problem you're trying to solve, rather than the technical details of the platform and runtimes.

Additional Resources

If you’re interested in helping continue to improve Kogito, using Kogito to develop applications, or if you’re just curious about it, please check out these links:

Introduction to Kogito

Step 1 of 6

Step 1

In this step, you will create a Kogito application skeleton.

Create a basic project

The easiest way to create a new Kogito project is to execute the Maven command below by clicking on it:

mvn archetype:generate \ -DinteractiveMode=false \ -DarchetypeGroupId=org.kie.kogito \ -DarchetypeArtifactId=kogito-quarkus-archetype \ -DarchetypeVersion=0.9.0 \ -DgroupId=org.acme \ -DartifactId=getting-started \ -Dversion=1.0-SNAPSHOT

This will use the Kogito Quarkus Archetype and generate a basic Maven project for you in the getting-started subdirectory, generating:

  • The Maven structure.
  • Example test-process.bpmn2 BPMN2 process definition.
  • An OpenAPI Swagger-UI at http://localhost:8080/swagger-ui.

Once generated, look at the getting-started/pom.xml. You will find the import of the Kogito BOM, allowing to omit the version on the different Kogito and Quarkus dependencies. In addition, you can see the quarkus-maven-plugin, which is responsible for packaging of the application as well as allowing to start the application in development mode.

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

<build>
    <plugins>
        <plugin>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-maven-plugin</artifactId>
            <version>1.3.0.Final</version>
            <executions>
                <execution>
                    <goals>
                        <goal>build</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

If we focus on the dependencies section, you can see we are using the Kogito Quarkus extension, which enables the development of Kogito applications on Quarkus:

<dependency>
  <groupId>org.kie.kogito</groupId>
  <artifactId>kogito-quarkus</artifactId>
</dependency>

Running the Application

First, change to the directory in which the project was created:

cd /root/projects/kogito/getting-started

Now we are ready to run our application. Click on the following command to start the application in dev-mode:

mvn clean compile quarkus:dev

You should see:

2020-02-07 09:09:12,440 INFO  [io.quarkus] (main) getting-started 1.0-SNAPSHOT (running on Quarkus 1.2.0.Final) started in 5.850s. Listening on: http://0.0.0.0:8080
2020-02-07 09:09:12,447 INFO  [io.quarkus] (main) Profile dev activated. Live Coding activated.
2020-02-07 09:09:12,449 INFO  [io.quarkus] (main) Installed features: [cdi, kogito, resteasy, resteasy-jackson, smallrye-openapi, swagger-ui]

Because this is the first Maven Kogito/Quarkus build on this environment, the system first needs to download a number of dependencies, which can take some time.

After the dependencies have been downloaded, and the application has been compiled, note the amazingly fast startup time! Once started, you can request the provided Swagger UI in the browser using this link.

You should see the following page, which shows the API of the sample Kogito Greetings service provided by the archetype:

New Kogito Quarkus Web Page

It's working!

Congratulations!

You've seen how to create the skeleton of basic Kogito app, package it and start it up very quickly in quarkus:dev mode. We'll leave the app running and rely on hot reload for the next steps.

In the next step we'll create a BPMN2 process definition to demonstrate Kogito's code generation, hot-reload and workflow capabilities.