Skip to content

Latest commit

 

History

History
 
 

kogito-scripts-springboot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Kogito 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.6.2+ installed

Compile and Run in Local Dev Mode

mvn clean package spring-boot:run    

Compile and Run using uberjar

mvn clean package 

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

java -jar target/kogito-scripts-sprintboot-{version}.jar

Use the application

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

Log after curl executed

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

Likewise on Springboot you should see a similar log to

Hello john"