PV207 BPM Labs Building Intelligent Applications with Kogito Mgr. Ivo Bek Senior Product Manager Mgr. Marian Macik Senior Quality Engineer April 2021 1 2 KOGITO ● Domain-Driven Development ● Generated Domain-specific APIs from your BPMN and DMN models ● Lightweight orchestration microservices ● Event-driven business logic ● Dev-mode hot reload ● Distributed sagas for microservices ● Serverless workflows ● Polyglot programming More info at ● Blogs ● Youtube https://kogito.kie.org/ 3 PREREQUISITES ● Java with JAVA_HOME configured (should be already done for jBPM) ● Visual Studio Code ● Kogito Bundle Extension for VS Code 4 YOUR FIRST KOGITO APPLICATION ● Generate a preconfigured Quarkus application with Kogito extension at code.quarkus.io ○ Generate your application -> Download as a zip ● Design BPMN/DMN in src/main/resources folder ○ VS Code ○ bpmn.new ● myProcess ● Start the application in development mode ○ ./mvnw clean compile quarkus:dev ● Domain-specific API available at http://localhost:8080/q/swagger-ui/ ○ OpenAPI specification ○ Generated only in development mode by default 5 YOUR FIRST KOGITO APPLICATION ● Start a process curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"personName" : "John"}' http://localhost:8080/myProcess ● Show processes curl -H 'Accept:application/json' http://localhost:8080/myProcess ● Show Tasks curl -H 'Accept:application/json' http://localhost:8080/myProcess/{puuid}/tasks?user=admin ● Complete a task curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"personName" : "John Doe"}' http://localhost:8080/myProcess/{puuid}/{taskName}/{tuuid}?user=admin “Raw commands” 6 YOUR FIRST KOGITO APPLICATION ● Change the greeting phrase ○ Edit an asset, e.g. the script task ○ Execute a command to invoke the Kogito endpoint again ○ Asset is recompiled and a new version is invoked ● Compile ○ ./mvnw clean install ○ Append -Dquarkus.swagger-ui.always-include=true to include Swagger UI in production ● Run ○ java -jar target/quarkus-app/quarkus-run.jar ○ Application uses whole quarkus-app directory ● Run on a different port ○ java -Dquarkus.http.port=8090 -jar target/quarkus-app/quarkus-run.jar 7 KOGITO EXAMPLES https://github.com/kiegroup/kogito-examples KAFKA MESSAGE EVENTS process-kafka-quickstart-quarkus TIMERS process-timer-quarkus 4-EYE PRINCIPLE process-usertasks-quarkus …and more Thank you, questions? 8