/kogito-examples

Kogito examples - Kogito is a cloud-native business automation technology for building cloud-ready business applications.

Primary LanguageJava

Kogito Examples

This module contains a number of examples that you can take a look at and try out yourself. Please take a look at the readme of each individual example for more details on how the example works and how to run it yourself (either locally or on Kubernetes).

Since Kogito aims at supporting both Quarkus and Spring Boot each example usually provides both type of projects.

Use alternative Quarkus platforms

The Quarkus quickstarts by default currently use the Quarkus core BOM.

If you want to use an alternative BOM when building the Quarkus quickstarts you can override the quarkus.platform.* properties. The following example shows how to set quarkus.platform.artifact-id to use the quarkus-universe-bom.

mvn -Dquarkus.platform.artifact-id=quarkus-universe-bom clean install

Because Kogito and OptaPlanner projects are part of the Quarkus Platform, the same applies also to Kogito BOM and OptaPlanner BOM being used.

By default org.kie.kogito:kogito-bom and org.optaplanner:optaplanner-bom are used, but, when needed, these can be overridden using Maven properties:

  • kogito.bom.* for Kogito BOM overrides
  • optaplanner.bom.* for OptaPlanner BOM overrides

The properties defined in each of the modules and can be overridden as follows:

  • Kogito BOM
    mvn -Dkogito.bom.group-id=io.quarkus.platform -Dkogito.bom.artifact-id=quarkus-kogito-bom -Dkogito.bom.version=2.2.3.Final
    
  • OptaPlanner BOM
    mvn -Doptaplanner.bom.group-id=io.quarkus.platform -Doptaplanner.bom.artifact-id=quarkus-optaplanner-bom -Doptaplanner.bom.version=2.2.3.Final
    

Note: It's important to keep BOM versions aligned when overriding. In case of Quarkus Platform this means using a single version value for all three (quarkus.platform.version, kogito.bom.version, optaplanner.bom.version) properties.

Contribution

Everyone is encouraged to contribute to these examples by

  • trying it out and providing feedback and ideas for improvement
  • create new examples -- in this case, make sure your PR is against the main branch!
  • blogging about it
  • using it on conferences and workshops

Process hello world with scripts

shows most basic use of processes to build up a hello world example

Process with business rules

shows integration between processes and rules.

Process with Kafka

shows how message start and end events can be easily used to integrate with Apache Kafka to consume where message name is the Kafka topic and the payload is mapped to process variable. Uses custom types that are serialized into JSON.

Process with Infinispan persistence

shows long running processes with Infinispan persistence so the state of process instances can be preserved across service restarts.

Process with service invocation

shows how easy it is to use local services to be invoked from within process. Allows easy and readable service invocation use cases to be covered.

Process with REST call

shows REST service invocation and parsing data back to an object instance used as process variable.

Process with user tasks

shows user task interactions with four eye principle applied

Process with user tasks based on custom life cycle

shows user task interactions with four eye principle applied that supports custom life cycle that allows to add additional phases to user tasks to indicate other states.

Process with user tasks with security on REST api

shows user task interactions with four eye principle applied with security restrictions on REST api.

Process with timers

shows timers (intermediate and boundary) that allows to introduce delays in process execution

Serverless Workflow Getting Started

A Serverless Workflow greeting service with both JSON and YAML workflow definitions

Serverless Workflow with events

A Serverless Workflow service for processing job applicant approvals and that showcases event-driven services.

Serverless Workflow with service calls

A Serverless Workflow service for returning country information

Serverless Workflow GitHub showcase

A Serverless Workflow service that works as a Github bot application, which reacts upon a new PR being opened in a given GitHub project.

Other Misc Examples

Trying the examples with the Kogito Operator

Most examples have a directory named operator including the YAML files to deploy it using the Kogito Operator in an OpenShift cluster. Please refer to the Kogito Documentation of how to install the operator to your environment in order to try it there.

Getting Help

Issues

  • Do you have a minimal, reproducible example for your issue?
    • If so, please open a Jira for it in the Kogito project with the details of your issue and example.
  • Are you encountering an issue but unsure of what is going on?
    • Start a new conversation in the Kogito Google Group, or open a new thread in the Kogito stream of the KIE Zulip chat.
    • Please provide as much relevant information as you can as to what could be causing the issue, and our developers will help you figure out what's going wrong.

Requests

  • Do you have a feature/enhancement request?
    • Please open a new thread in the Kogito stream of the KIE Zulip chat to start a discussion there.