2. Mario Fusco
Red Hat Principal Sw Engineer
Drools project lead
Kogito founder
Java Champion
Edoardo Vacchi
Red Hat Senior Sw Engineer
Kogito founder
3. Agenda
● Business automation in the cloud: a
serverless workflow - demo
● What is business automation:
introduction to Drools and jBPM
● Kogito: business automation in the cloud
● Quarkus: an open source stack
to write cloud native Java apps
● Decisions as a service:
serverless DMN - demo
+
4. ● World around us has changed
● Different usage patterns
● New deployment techniques
● Better usage of machine and cluster resources
The reasons for a change
5.
6.
7. Application Density
CONTAINER ORCHESTRATION
Server Server Server
Traditional Java
Stack
NodeJS
NodeJS
NodeJS
NodeJS
NodeJS
NodeJS
Traditional Java
Stack
Traditional Java
Stack
Go Go Go
Go Go Go
Go Go Go
Go Go Go
Go Go Go
Go Go Go
8. Application Density
CONTAINER ORCHESTRATION
Server Server Server
NodeJS
NodeJS
NodeJS
NodeJS
NodeJS
NodeJS
Go Go Go
Go Go Go
Go Go Go
Go Go Go
Go Go Go
Go Go Go
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
Native Java
13. “building and running applications that do not
require server management. It describes a
finer-grained deployment model where
applications, bundled as one or more
functions, are uploaded to a platform and then
executed, scaled, and billed in response to the
exact demand needed at the moment.”
event
action
result$
CNCF Serverless Whitepaper v1.0
15. Workflows
● Workflow is the procedural
movement of information,
material, and tasks from one
participant to another
● A workflow may be sequential,
with each step contingent upon
completion of the previous
one, or parallel, with multiple
steps occurring simultaneously
28. Cogito, ergo sum
Pronunciation
/ˈko.d͡ ʒi.to/, [ˈkoː.d͡ ʒi.to]
(Don't worry, nobody in the team gets it right, anyway)
see also: http://kverlaen.blogspot.com/2019/09/etymology-of-kogito.html
René Descartes
29. Kogito, ergo automate
● BTW, this is not Mario
● Not a pirate
● It is a viking
● Odin, who sacrificed his eye for
knowledge
30. ● A cloud-native development, deployment and
execution platform for business automation:
○ Rules and Decisions
○ Processes and Cases
○ Serverless Workflow
● ... under the covers
○ the backbone is code generation based on business assets
○ executable model for the process/rule/decision definitions
○ type safe data model that encapsulates variables
○ REST api for each public business process/decision/rule
Introducing Kogito
33. ● Responsible for building with selected runtime
○ Quarkus
○ Spring Boot
● Provision services on demand and remove them when no longer needed
● Manage deployed services including their dependencies
● Service discovery based on labels
● Guarding services of losing their dependants
● Security provisioning and propagation
Operator
34. ● Deploy and manage your services with operator and intuitive CLI tool
$ kogito new-app my-app
Create new project with default services provisioned
$ kogito deploy my-app https://github.com/user/myapp
Deploys given application from source and attaches to required infrastructure
Operator centric
44. What is Business Automation
● Processes
Set of activities and tasks that,
once completed following a
specific workflow, will accomplish
an organizational goal
● Rules
Encapsulate domain and define
business-specific constraints and
behaviors, keeping them
separated from the main
application flow
46. What is a Rule
● A business rule is a piece of logic that captures "what to do" depending
on a context (Facts)
● Usually captured in natural language first
WHEN <CONDITIONS>
THEN <ACTIONS>
47. Introducing Drools
● Easier to understand → Requirements can be more naturally translated
into rules. It is more likely for a technically skilled business analyst to verify,
validate or even change a rule than a piece of Java code
● Improved maintainability → We don't care about how to implement a
solution only what needs to be done to solve a problem
● Deals with evolving complexity → It's easier to modify a rule than a Java
program and to determine the impact of this change on the rest of the
application
● Modularity → Each rule models an isolated and small portion of your
business logic and is not part of a monolithic program
● Clear separation of business logic from the rest of the system →
Business and infrastructural code have very different life cycles
● Complex Event Processing → Facts can be handled like timestamped
events allowing temporal reasoning on them
RULES
48. How a Rule Engine Works
● The Rule Base contains a computation efficient
representation of the set of the defined rules
● The Working Memory contains the set of facts
inserted into session
● The engine matches the fact in the working
memory against the rules set
● When a match is found it creates an activation
and puts it into the agenda
● An activation is the tuple of facts matching the
conditions of a rule plus the rule itself
● When all activations have been created the
agenda elects through a conflict resolution
strategy the one to be executed first
● The elected activation is passed to the
execution engine and then fired
49. A simple rule set
rule RaiseAlarm when
exists Fire()
then
insert( new Alarm( "house1" ) );
System.out.println( "Raise the Alarm");
end
rule CancelAlarm when
not Fire()
a : Alarm()
then
delete( a );
System.out.println( "Cancel the Alarm");
end
rule TurnSprinklerOn when
s : Sprinkler( on == false )
f : Fire( room == s.room )
then
modify( s ) { setOn( true ) }
System.out.println( "Turn on the sprinkler for room " +
f.getRoom().getName() );
end
rule TurnSprinklerOff when
s : Sprinkler( on == true )
not Fire( room == s.room )
then
modify( s ) { setOn( false ) }
System.out.println( "Turn off the sprinkler for room " +
s.getRoom().getName() );
end
rule OK when
not Alarm()
not Sprinkler( on == true )
then
System.out.println( "Everything is ok" );
end
Pattern-matching
against objects in the
Working Memory
Code executed when
a match is fired
51. Almost anything in any
domain can be expressed
as process or rule.
It’s a matter of recognizing
patterns to be able to avoid
repetition and mistakes, and
by that automating
business.
52. jBPM provides various capabilities that simplify and externalize business
logic into reusable assets such as cases, processes, decision tables and
more. It consists of:
● business processes (BPMN2)
● case management (BPMN2 and CMMN)
● decision management (DMN)
● business rules (DRL)
A toolkit for building business
applications to help automate
business processes and decisions
55. ● Adapts to your business domain instead of
the other way around
● No more leaking abstractions of the platform
into your client applications
● Stay focused on business requirements
instead of implementation technology
Focus on business domain
instead of technology
57. ● Achieve instant developer efficiency by having
○ Tooling embeddable wherever you need it
○ Code generation taking care of 80% of the work
○ Flexibility to customize, only use what you need
○ Simplified local development with live reload
Offers a powerful developer experience
59. ● If you think about business automation think about the cloud as this is
where your business logic lives these days
● Achieves amazingly fast boot time and low memory footprint by
leveraging newest technology
○ Quarkus
○ Kubernetes/OpenShift/KNative
Designed from ground up to run at scale
66. Hot Reload
● ./mvn compile quarkus:dev makes
Quarkus run in dev mode and provide
hot-reload capabilities
● Changes made to source and
configuration files are automatically
re-compiled once the browser is
refreshed
● Thanks to Kogito’s Quarkus extension,
also Drools and jBPM files are
recognized as hot reloadable
artifacts and the corresponding rules
and processes are regenerated
73. What is DMN?
● DMN (Decision Model and Notation) is a standard for Decision
Management from OMG
● Standardizes decision automation from modelling to execution
● A sibling and complementary standard to BPMN (processes) and
CMMN (case management)
● A complement to analytics and AI models in general
○ DMN integrates with analytic models and provides explainable
white box decisions
● DMN models are stateless only (perfect fit for serverless architectures)