Cloud Native Business Automation
With Activiti Cloud
jdk.io
Activiti Cloud
activiti.org
Gitter: Activiti/Activiti7
Twitter:
• @activiti
• @salaboy
• @ryandawsongb
Github:
• Activiti
• ryandawsonuk
• erdemedeiros
Ryan Dawson Elias De Medeiros
Aims
• Show what Cloud Native Business Automation means
• Explain this with a Twitter-based open source example
• Reveal the advantages of Cloud Native Business Automation
Agenda
● Business process Automation - BPM & BPMN
● Trending topics example
● Monolith vs Microservices
● Activiti Cloud Architecture
● Activiti Connectors
● Query and Audit modules
● The future
BPM & BPMN
BPM
Business Process Management
● Modeling
● Management
● Automation
● Measurement
● Optimization
Popular in:
Healthcare, manufacturing,
publishing, insurance.
BPMN
Business Process Model And Notation
● Standard for Business Process Modeling
● Specification for
○ Graphical representation
○ Execution semantics
● Currently in the version 2.0 (January
2011)
○ www.omg.org/spec/BPMN/2.0/PDF
BPMN - Standardised Visibility
Benefits of BPM
● Common language between technical and domain experts
○ Bridge between the design and implementation
● Ensure that the same steps are performed no matters who is handling it
● Easy to monitor and make changes
○ Which is the current state of a customer order?
○ Where are we spending time while processing orders?
■ Where are the bottlenecks?
■ Can we improve it by redesigning the process?
Trending topics
example
Trending Topics Campaigns
● Imagine we’re a marketing firm
● We want to run campaigns to incentivise social media (e.g.
Twitter) users to promote brands
● We’ll periodically reward users who best promote the brand
Trending Topics Campaigns BPMN
Reward Process
Tweet Analysis Process
Design ->
Implementation
Design -> Implementation
● We designed our process in a modelling tool
● In it each Service Task is a block of logic
● We need to implement that logic
● Typically with a Java Class that implements JavaDelegate
● Java Delegates wire custom code into BPMN processes
Java Delegates
<serviceTask name="Process Tweet"
activiti:class="org.activiti.runtime.service.ProcessTweetDelegate"
>
public class ProcessTweetDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
// perform processing
}
}
Java Classpath Sharing
● Implementing the Service Tasks as Java Delegates tends to
mean they share a JVM
● And they also share a Java Classpath with the Process
Engine
● So each new process adds further classes and libraries to
the Java classpath
Monolith vs Microservices
● Single JVM = monolith
● This constrains us if we want to:
○ scale parts independently
○ exploit fault-tolerance using replicas
○ release components independently ...
Let’s Go Cloud Native
● What if our Service Tasks could be microservices?
● And the BPM engine could be a microservice too?
Process
Tweet
Process
Tweet
Analyse
Tweet
Activiti 7
Principles/Approaches
● 12 factors App
● Domain Driven Design
Tools/frameworks
● Spring Boot 2.0
● Spring Cloud
● Docker
● Kubernetes
● Helm
Getting the most from Kubernetes
Activiti Cloud
Architecture
Infrastructure
For us: how all these autonomous services work together in a resilient way
•Glue and Tooling for our Cloud Native Services
• Service Registry
• Distributed Configuration Service
• Distributed Messaging (Streams)
• Distributed logging and monitoring
• Gateway
• Netflix (Circuit Breakers, Bulkheads, Fallbacks, Feign)
• Contracts
• Cloud Deployers
Spring Cloud
Infrastructure
Application
Application
Campaign Runtime Bundle
Process executor
Runtime Bundle Implementation
● Spring boot app
● Maven dep to add starter
● Processes in src/main/resources
● Maven dep for DB
● Spring Cloud Stream config
● Message to stream starts process
Activiti Connectors
Application
Cloud Connectors
•Integration points
• Service task business logic
■ Process incoming tweet
■ Perform sentiment analysis
■ Rank the authors
■ ...
Before - Java Delegates
<serviceTask name="Process Tweet"
activiti:class="org.activiti.runtime.service.ProcessTweetDelegate"
>
public class ProcessTweetDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
// perform processing
}
}
Same JVM as
process executor
Now - Spring Cloud Streams
<serviceTask name="Process Tweet"
implementation="Process English Tweet">
@EnableBinding(ProcessingConnectorChannels.class)
public class TwitterProcessingConnector {
@StreamListener(value = "twitterProcessingConsumer")
public void process(IntegrationRequestEvent event) {
// perform processing
// send result back
}
}
spring.cloud.stream.bindings.twitterProcessingConsumer.destination=Process English Tweet
public interface ProcessingConnectorChannels {
@Input("twitterProcessingConsumer")
SubscribableChannel twitterProcessingConsumer();
}
Different JVM / docker
container:
Can scale independently.
So What Does Our Architecture
Look Like Now?
Campaign Processes Recap
Reward Process
Tweet Analysis Process
Process Architecture
● Messages to Runtime Bundle
start processes
● Runtime bundle executes
process according to the BPMN
● Calls out to connectors
● Ranking connector used by both
processes
● Further components (not shown)
add supplementing services
(query, gateway etc.)
Query and Audit
modules
Application
Campaign Query Service
[Campaign Audit Service]
Demo
Activiti Cloud BluePrint
Trending Topic Campaigns
Services Build Through Jenkins-X
Services Promoted Through Helm
● Jenkins X uses a git repo to represent the environment.
● This maps to a namespace (in this case staging)
● Kubectl get pods in that namespace shows us what’s
running:
Campaign Dashboard
The future
Look into the
Future•Jenkins X (in progress)
•Spring Cloud Kubernetes (in progress)
•Istio Service Mesh (about to start)
•JHipster (in progress)
•JHipster
The Future
Look into the
Future
Digital Business
Platform
● Where there are review processes, there are often
documents
● Activiti is supported by Alfresco, makers of the
Alfresco Content Repository
● Activiti Cloud is part of the evolution of the Alfresco
Digital Business Platform, which also includes the
Content Repository. a UI Development Framework
built on Angular and more
● Expect more cool cloud stuff in this space too
Thanks!
Please do chat with us!
activiti.org
Gitter: Activiti/Activiti7
Twitter:
• @activiti
• @salaboy
• @ryandawsongb
Github:
• Activiti
• salaboy
• ryandawsonuk
• erdemedeiros
Have a look at the example!
...and the video (more to come)

Jdk.io cloud native business automation

  • 1.
    Cloud Native BusinessAutomation With Activiti Cloud jdk.io
  • 2.
    Activiti Cloud activiti.org Gitter: Activiti/Activiti7 Twitter: •@activiti • @salaboy • @ryandawsongb Github: • Activiti • ryandawsonuk • erdemedeiros Ryan Dawson Elias De Medeiros
  • 3.
    Aims • Show whatCloud Native Business Automation means • Explain this with a Twitter-based open source example • Reveal the advantages of Cloud Native Business Automation
  • 4.
    Agenda ● Business processAutomation - BPM & BPMN ● Trending topics example ● Monolith vs Microservices ● Activiti Cloud Architecture ● Activiti Connectors ● Query and Audit modules ● The future
  • 5.
  • 6.
    BPM Business Process Management ●Modeling ● Management ● Automation ● Measurement ● Optimization Popular in: Healthcare, manufacturing, publishing, insurance.
  • 7.
    BPMN Business Process ModelAnd Notation ● Standard for Business Process Modeling ● Specification for ○ Graphical representation ○ Execution semantics ● Currently in the version 2.0 (January 2011) ○ www.omg.org/spec/BPMN/2.0/PDF
  • 8.
  • 9.
    Benefits of BPM ●Common language between technical and domain experts ○ Bridge between the design and implementation ● Ensure that the same steps are performed no matters who is handling it ● Easy to monitor and make changes ○ Which is the current state of a customer order? ○ Where are we spending time while processing orders? ■ Where are the bottlenecks? ■ Can we improve it by redesigning the process?
  • 10.
  • 11.
    Trending Topics Campaigns ●Imagine we’re a marketing firm ● We want to run campaigns to incentivise social media (e.g. Twitter) users to promote brands ● We’ll periodically reward users who best promote the brand
  • 12.
    Trending Topics CampaignsBPMN Reward Process Tweet Analysis Process
  • 13.
  • 14.
    Design -> Implementation ●We designed our process in a modelling tool ● In it each Service Task is a block of logic ● We need to implement that logic ● Typically with a Java Class that implements JavaDelegate ● Java Delegates wire custom code into BPMN processes
  • 15.
    Java Delegates <serviceTask name="ProcessTweet" activiti:class="org.activiti.runtime.service.ProcessTweetDelegate" > public class ProcessTweetDelegate implements JavaDelegate { @Override public void execute(DelegateExecution execution) throws Exception { // perform processing } }
  • 16.
    Java Classpath Sharing ●Implementing the Service Tasks as Java Delegates tends to mean they share a JVM ● And they also share a Java Classpath with the Process Engine ● So each new process adds further classes and libraries to the Java classpath
  • 17.
    Monolith vs Microservices ●Single JVM = monolith ● This constrains us if we want to: ○ scale parts independently ○ exploit fault-tolerance using replicas ○ release components independently ...
  • 18.
    Let’s Go CloudNative ● What if our Service Tasks could be microservices? ● And the BPM engine could be a microservice too? Process Tweet Process Tweet Analyse Tweet
  • 19.
    Activiti 7 Principles/Approaches ● 12factors App ● Domain Driven Design Tools/frameworks ● Spring Boot 2.0 ● Spring Cloud ● Docker ● Kubernetes ● Helm
  • 20.
    Getting the mostfrom Kubernetes
  • 21.
  • 22.
  • 23.
    For us: howall these autonomous services work together in a resilient way •Glue and Tooling for our Cloud Native Services • Service Registry • Distributed Configuration Service • Distributed Messaging (Streams) • Distributed logging and monitoring • Gateway • Netflix (Circuit Breakers, Bulkheads, Fallbacks, Feign) • Contracts • Cloud Deployers Spring Cloud
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
    Runtime Bundle Implementation ●Spring boot app ● Maven dep to add starter ● Processes in src/main/resources ● Maven dep for DB ● Spring Cloud Stream config ● Message to stream starts process
  • 29.
  • 30.
  • 31.
    Cloud Connectors •Integration points •Service task business logic ■ Process incoming tweet ■ Perform sentiment analysis ■ Rank the authors ■ ...
  • 32.
    Before - JavaDelegates <serviceTask name="Process Tweet" activiti:class="org.activiti.runtime.service.ProcessTweetDelegate" > public class ProcessTweetDelegate implements JavaDelegate { @Override public void execute(DelegateExecution execution) throws Exception { // perform processing } } Same JVM as process executor
  • 33.
    Now - SpringCloud Streams <serviceTask name="Process Tweet" implementation="Process English Tweet"> @EnableBinding(ProcessingConnectorChannels.class) public class TwitterProcessingConnector { @StreamListener(value = "twitterProcessingConsumer") public void process(IntegrationRequestEvent event) { // perform processing // send result back } } spring.cloud.stream.bindings.twitterProcessingConsumer.destination=Process English Tweet public interface ProcessingConnectorChannels { @Input("twitterProcessingConsumer") SubscribableChannel twitterProcessingConsumer(); } Different JVM / docker container: Can scale independently.
  • 34.
    So What DoesOur Architecture Look Like Now?
  • 35.
    Campaign Processes Recap RewardProcess Tweet Analysis Process
  • 36.
    Process Architecture ● Messagesto Runtime Bundle start processes ● Runtime bundle executes process according to the BPMN ● Calls out to connectors ● Ranking connector used by both processes ● Further components (not shown) add supplementing services (query, gateway etc.)
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
    Services Promoted ThroughHelm ● Jenkins X uses a git repo to represent the environment. ● This maps to a namespace (in this case staging) ● Kubectl get pods in that namespace shows us what’s running:
  • 45.
  • 46.
  • 47.
    Look into the Future•JenkinsX (in progress) •Spring Cloud Kubernetes (in progress) •Istio Service Mesh (about to start) •JHipster (in progress) •JHipster The Future
  • 48.
    Look into the Future DigitalBusiness Platform ● Where there are review processes, there are often documents ● Activiti is supported by Alfresco, makers of the Alfresco Content Repository ● Activiti Cloud is part of the evolution of the Alfresco Digital Business Platform, which also includes the Content Repository. a UI Development Framework built on Angular and more ● Expect more cool cloud stuff in this space too
  • 49.
    Thanks! Please do chatwith us! activiti.org Gitter: Activiti/Activiti7 Twitter: • @activiti • @salaboy • @ryandawsongb Github: • Activiti • salaboy • ryandawsonuk • erdemedeiros Have a look at the example! ...and the video (more to come)