A quickstart project that processes travellers in the system. It's main purpose is to illustrate local service invocation.
This example shows
-
invoking local service class that is a injectable bean
-
control flow based on service calls
-
New Travelers Diagram
- New Travelers Diagram Properties
- New Travelers Diagram Properties
- Store Traveler Service Call
- Store Traveler Service Call
- Store Traveler Service Call
- Stored Traveler Gateway Yes Connector
- Stored Traveler Gateway No Connector
- Greet New Traveler Service Call
- Greet New Traveler Service Call
- Audit Traveler Service Call
- Audit Traveler Service Call
- Multi Params Process
- Multi Params Diagram Properties
- Multi Params Diagram Properties
- Hello Service Calls
- Hello Service Calls
You will need:
- Java 11+ installed
- Environment variable JAVA_HOME set accordingly
- Maven 3.6.2+ installed
mvn clean package spring-boot:run
mvn clean package
To run the generated native executable, generated in target/
, execute
java -jar target/kogito-service-calls-sprintboot-{version}.jar
To make use of this application it is as simple as putting a sending request to http://localhost:8080/travellers
with following content
{
"traveller" : {
"firstName" : "John",
"lastName" : "Doe",
"email" : "[email protected]",
"nationality" : "American",
"address" : {
"street" : "main street",
"city" : "Boston",
"zipCode" : "10005",
"country" : "US" }
}
}
Complete curl command can be found below:
curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"traveller" : { "firstName" : "John", "lastName" : "Doe", "email" : "[email protected]", "nationality" : "American","address" : { "street" : "main street", "city" : "Boston", "zipCode" : "10005", "country" : "US" }}}' http://localhost:8080/travellers
After the above command you should see a log similar to the following
To call Hello Service send a request to http://localhost:8080/multiparams
with following content
{
"name" : "John",
"age" : 44,
}
Complete curl command can be found below:
curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"name" : "John", "age" : 44}' http://localhost:8080/multiparams
After the above command you should see a log similar to the following