tree: 89288a411fbe5173831c9e06f9995baf544db114 [path history] [tgz]
  1. docs/
  2. operator/
  3. src/
  4. mvnw
  5. mvnw.cmd
  6. pom.xml
  7. README.md
kogito-springboot-examples/process-scripts-springboot/README.md

Process script invocation

Description

A quickstart project is the simplest hello world kind of example, it accepts input and replies with hello message.

This example shows

  • invoking scripts from within process
  • Diagram Properties (top)
  • Diagram Properties (bottom)
  • Hello Script Task
  • Update Message Script Task

Build and run

Prerequisites

You will need:

  • Java 11+ installed
  • Environment variable JAVA_HOME set accordingly
  • Maven 3.8.6+ installed

Compile and Run in Local Dev Mode

mvn clean compile spring-boot:run

Package and Run using uberjar

mvn clean package

To run the generated native executable, generated in target/, execute

java -jar target/process-scripts-springboot.jar

OpenAPI (Swagger) documentation

Specification at swagger.io

You can take a look at the OpenAPI definition - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available Swagger UI.

In addition, various clients to interact with this service can be easily generated using this OpenAPI definition.

Submit a request

To make use of this application it is as simple as putting a sending request to http://localhost:8080/scripts with following content

{
    "name" : "john"
}

Complete curl command can be found below:

curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"name" : "john"}' http://localhost:8080/scripts

Response should be similar to:

{
    "id":"ab5239e2-f497-4684-b337-5a44440b38dd",
    "name":"john",
    "message":"Hello john"
}

And also in SpringBoot log you should see a log entry:

Hello john

Deploying with Kogito Operator

In the operator directory you'll find the custom resources needed to deploy this example on OpenShift with the Kogito Operator.