30
POLYGLOT & REACTIVE JBPM Maciej Swiderski - Salaboy June ‘15

JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

Embed Size (px)

Citation preview

Page 1: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

POLYGLOT & REACTIVE JBPM Maciej Swiderski - Salaboy June ‘15

Page 2: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

WHO ARE WE?

Maciej Swiderski

Mauricio Salatino

Page 3: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

AGENDA

• jBPM Intro (10 minutes)

• Vert.x in a Nutshell (10 minutes)

• Demo

• Polyglot interactions

• Reactive BPM

Page 4: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

WHAT IS JBPM?

Pure Java Lightweight Process Engine.

You can embed it in your apps or infrastructure.

Main Purpose:

• (Micro)Services Orchestration

• Human Workflows support

Page 5: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

HOW DOES A PROCESS LOOK LIKE?

Page 6: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

KNOWLEDGE IS EVERYTHING (KIE)

• Drools (Rule Engine)

• jBPM (Process Engine)

• Optaplanner (Resource Planning Engine)

• Dashbuilder (Data Analytics & Visualization)

• Uberfire (API to create generic Web IDEs)

Page 7: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

CORE ENGINE• Light-weight , Solid, Stable core engine

• Native support for BPMN 2.0

• Automatically/Natively integrated with:

• Rule Engine - Drools Expert

• Complex Event Processing engine - Drools Fusion

• Configurable engine persistence

• Pluggable variable persistence strategies

Page 8: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

WORKITEMS• jBPM as a process engine executes steps defined in

the process - commonly known as activities

• jBPM introduces concept of work items - definition of work to be performed

• Work Items are composed of two parts • work item definition - allows to define the work

item once and reuse it across projects - this is the “what”

• work item handler - allows to execute work item on runtime environment - this is the “how”

Page 9: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

WHY YOU SHOULD CARE?

• Decouple “what we do” from “how we do it”

• Decoupled lifecycle between your knowledge (process model) and your app infrastructure

• Error Tracking and Auditing for free

Page 10: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

RUN YOUR JBPM• As a Service

• Execution Servers (REST, JMS, SOAP)

• Embedded

• low level API (KIE API)

• services API (CDI, Spring, EJB)

• You can use as much as you need

Page 11: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

TOOLING

• KIE Workbench (is our Web IDE)

• Authoring (focused on Business Users)

• Runtime (Focused on the day to day work)

• Monitoring (Focused on exposing Real Time Data)

Page 12: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

KIE MODULE (KJAR)

• Defines a package with business assets

• Apache Maven is used to: • keep unified and standardized structure of the project• provides dependency management• simplify artifacts distribution and consumption by other projects• get rid of any proprietary formats of knowledge packages

• kjars can have dependencies to any other artifacts including other kjars

• DevOps (Jenkins, Nexus, etc) tools can be used to distribute, host and manager our Kie Modules

Page 13: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

• all assets are stored in source control system - GIT

• web tooling provides access to GIT server: • via its UI (allows to work on assets,

create repositories, clone repositories, etc)

• via IDE (allows to clone, pull, push assets) • via any GIT tool (GUI or CLI) for any

operation GIT supports

REPOSITORY

Page 14: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

KIE MODULES (DEMO)

GAV: org.jbpm:receive-data:1.0 GAV: org.jbpm:send-data:1.0

Page 15: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEPLOYMENT OF BUSINESS ASSETS• It depends on the way jBPM is used

• as a service primary deployment unit is kjar which is automatically downloaded from Maven if does not exist locally - identified by GAV (Group, Artifact, Version)

• embedded within the application

• recommended to rely on kjars as well

• allows to add business assets manually (from any source - file system, classpath, database, etc)

Page 16: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

VERT.X IN A NUTSHELL

“Vert.x is a lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications.”

Page 17: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

VERT.X IN A NUTSHELL• Polyglot

• use your favorite programming language or mix several to develop applications

• Simplicity

• make use of asynchronous APIs without too much hassle

• Scalability

• Scales using message passing to efficiently utilize your server cores.

• Concurrency

• Simple actor-like concurrency model frees you from the pitfalls of traditional multi-threaded programming.

Page 18: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

VERT.X IN A NUTSHELL• Verticle

• The packages of code Vert.x executes. Can be written in various languages (JS, Java, Groovy, etc)

• Module

• Modules can contain multiple verticles, potentially written in different languages. Modules allow functionality to be encapsulated and reused

• Vert.x instance

• Verticles run inside a Vert.x instance. A single Vert.x instance runs inside its own JVM instance

Page 19: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

VERT.X TOPOLOGY

Vert.x instance

Event bus

Verticle instance

Verticle instance

Verticle instance

Page 20: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

VERT.X EVENT BUS• Event bus is the nervous system of Vert.x

• Allow Verticles to communicate with each other regardless what language they were written in

• Clustered - allows to communicate regardless where verticles are located (on the network)

• Simple addressing - simple strings no complex addressing schemes

• Publish/Subscribe and Point to Point messaging

Page 21: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

JBPM AND VERT.X• jBPM module for Vert.x

• allows to start instances of Vert.x with jBPM module dedicated to kjar

• Reactive

• Makes use of clustered event bus to communicate between instances of jBPM module

• Polyglot

• Allows to use different languages to interact with running processes

Page 22: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

JBPM AND VERT.X• Configurable via json file (receive-data.conf)

{

"containerId" : "org.jbpm:receive-data:1.0",

"managed" : true

}

• Started as zipped module

vertx runzip jbpm-vertx-module-1.0.0-mod.zip -conf receive-data.conf

Page 23: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO OVERVIEW

Page 24: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO: POLYGLOT

• Illustrates how jBPM vert.x module can be used with various languages

• Java Script

• Scala

• Groovy

• Ceylon

Page 25: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO: REACTIVE

• Illustrates how jBPM vert.x module makes use of (clustered) event bus to exchange information between processes

• Use of WorkItems to realize/execute send and receive tasks (BPMN2 activities)

Page 26: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO: BPM TOOLING INTEGRATION

• Illustrates how to integrate with existing jBPM tooling to keep track of what is going on with processing managed by jBPM vert.x module instance

Page 27: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO: BPM TOOLING INTEGRATION

Page 28: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

DEMO: SCALABILITY

• Illustrates how easy it is to put up more instances of given kjar to handle increased load

Page 29: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

CONTACT US, BE PART OF THE COMMUNITY…

HTTP://MSWIDERSKI.BLOGSPOT.COM

@SALABOY HTTP://SALABOY.COM

ON IRC (24/7) IRC.FREENODE.ORG CHANNELS: #JBPM, #DROOLS

Page 30: JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM

QUESTIONS?