43
jBPM5 Community Training Sponsored by Plugtree

JBPM5 Community Training Course - Module #1 Introduction

Embed Size (px)

DESCRIPTION

The first module of the jBPM5 Community Training Courses. For more information visit: http://salaboy.wordpress.com

Citation preview

Page 1: JBPM5 Community Training Course - Module #1 Introduction

  

jBPM5 Community Training Sponsored by Plugtree

Page 2: JBPM5 Community Training Course - Module #1 Introduction

Module 1: jBPM5 Introduction

jBPM5 Community Trainingversion: 1.0-SNAPSHOT

Release Date: 01/28/2011Under The Creative Common License

Page 3: JBPM5 Community Training Course - Module #1 Introduction

Module 1: jBPM5 Introduction

jBPM5 Community Training Course by Mauricio "Salaboy" Salatino is licensed under a Creative Commons Attribution

3.0 Unported License.Based on a work at salaboy.wordpress.

com.Permissions beyond the scope of this

license may be available at http://salaboy.wordpress.com/.

Page 4: JBPM5 Community Training Course - Module #1 Introduction

Agenda

jBPM Project History jBPM5 OverviewjBPM5 GoalsClassic BPMS vs jBPM5 architecture (Competitors)BPMN2 StandardjBPM5 featuresDeveloping Applications with jBPM5Conclusions

Page 5: JBPM5 Community Training Course - Module #1 Introduction

jBPM Project History

jBPM 3.x borns as a BPMS (Business Process Management System)It was classified by JBoss as an integration softwareUntil jBPM 4.x Tom Baeyens was in charge of the projectTom Baeyens quit JBoss and joins Alfresco

Page 6: JBPM5 Community Training Course - Module #1 Introduction

jBPM Project History (Drools)

Drools was born as a Rule Engine.Mark Proctor is the current project leader.In Drools version 4.x a new module appear called Drools Flow.The main idea behind Drools Flow was to provide BPMS capabilities on top of the Rule Engine.Kris Verlaenen, Phd was in charge of the Drools Flow initiative, writing it from the scratch. The main goal of Drools is to provide a platform where rules and business processes can live, coexist and collaborate as Knowledge Representations.

Page 7: JBPM5 Community Training Course - Module #1 Introduction

jBPM Project History

Drools Flow 5.x was released back in 2009The rebranded version of Drools Flow, jBPM5 was released on December of 2010Provides a rock solid BPMS core and a flexible mechanisms to implement the main stages of the BPM disciplineTotally based on BPMN2 jBPM5 was conceived having in mind the code base of Drools Flow and covering all the functionality provided by jBPM 4.xjBPM 5.x is a mature code base with more than 3 years of development and several testing.

Page 8: JBPM5 Community Training Course - Module #1 Introduction

jBPM Project History

The main difference between jBPM5 and other BPMS's is the fact that jBPM5 runs on top of Drools Expert (Rule Engine), providing amazing features like:

The possibility of doing inferences over our business processesHandling process exceptional paths using business rules Mixing Complex Event Processing, Rules and Processes together without learning a new API for each topic

Page 9: JBPM5 Community Training Course - Module #1 Introduction

jBPM5 Overview

Page 10: JBPM5 Community Training Course - Module #1 Introduction

jBPM5 Overview

It is a bridge between Business Analysts and Developers Apache ASL Licensed Central concept inside jBPM5: Business Process BPMS = BPM System

Design / Model (Eclipse Plug in - Web Based Editor)Execute (runtime to execute our processes)Monitor / Optimize (BAM and Reporting tools)

Tightly coupled with the rule engineallow us to represent complex situations (real life is complex)

Page 11: JBPM5 Community Training Course - Module #1 Introduction

Business Process

hmm.. but wait a second, What is a business process?

"A sequence of activities,

performed by humans or systems to complete a business goal"

Page 12: JBPM5 Community Training Course - Module #1 Introduction

Business Process Example

Simple Emergency Service Process

Page 13: JBPM5 Community Training Course - Module #1 Introduction

jBPM5 Features

It provides you a flexible platform for designing and executing your business processesIt provides you an integrated set of APIs for the Rule Engine, Process Engine and the Complex Event Processing EngineIt provides you a platform to build our applications using business processes to guide the company workIt provides you an abstraction about how your company's activities are orchestratedIt provides a simple and automated mechanism to handle information across activities

Page 14: JBPM5 Community Training Course - Module #1 Introduction

jBPM5 competitors

Workflow Execution Engine

BPMSjBPM 3.x

BPMSjBPM 4.x / Activiti

Page 15: JBPM5 Community Training Course - Module #1 Introduction

OSWorkflow

Workflow wf = new BasicWorkflow(username);HashMap inputs = new HashMap();inputs.put("docTitle", request.getParameter("title"));wf.doAction(1, 1, inputs);

Page 16: JBPM5 Community Training Course - Module #1 Introduction

jBPM 3.x

ProcessDefinition processDefinition = ProcessDefinition .parseXmlResource("process-def.xml"); ProcessInstance processInstance = new ProcessInstance(processDefinition);processInstance.signal();

Page 17: JBPM5 Community Training Course - Module #1 Introduction

jBPM 4.x

ProcessEngine processEngine = new Configuration() .setResource(configurationResource) .buildProcessEngine(); ExecutionService executionService = processEngine .getExecutionService();executionService. startProcessInstanceByKey("simpleProcess");

Page 18: JBPM5 Community Training Course - Module #1 Introduction

Activiti5

ProcessEngine processEngine = new ProcessEngineBuilder() .configureFromPropertiesResource(configurationResource) .buildProcessEngine();RuntimeService runtimeService = processEngine . getRuntimeService(); runtimeService.startProcessInstanceByKey("simpleProcess");

Page 19: JBPM5 Community Training Course - Module #1 Introduction

Classic BPMS and Rule Engine Interaction

Page 20: JBPM5 Community Training Course - Module #1 Introduction

Classic BPMS and Rule Engine Interaction

Drawbacks of the classic approach:

The Rule Engine and the BPMS uses different APIsSharing information between the Rule Engine and the BPMS becomes complicated and difficult to maintainOur Business Processes become very complex when we describe the exceptional paths using a process centric vision. We can leverage the declarative approach of business rules to describe exceptional situations.

Page 21: JBPM5 Community Training Course - Module #1 Introduction

Spaghetti BPEL of hell

Page 22: JBPM5 Community Training Course - Module #1 Introduction

Inversion of Control

Business Processes and Business Rules run on top of the Rule Engine

Page 23: JBPM5 Community Training Course - Module #1 Introduction

Inversion of Control

Benefits:

Tightly coupled designProcess Centric vision for common branches Exceptions are handled in a cleaner way with rules

Using a declarative approach No problems with communications and marshalingWe don't need to learn different APIs

Page 24: JBPM5 Community Training Course - Module #1 Introduction

Once again, Business Process

"A sequence of activities,

performed by humans or systems to complete a business goal"

Page 25: JBPM5 Community Training Course - Module #1 Introduction

Business Process Structure

Directed Graph Composed of:Nodes (Activities)Connections (SequenceFlows)

Outgoing and Incoming

Page 26: JBPM5 Community Training Course - Module #1 Introduction

Business Process Structure

Internal Structure: Process

Node ContainerNode

Page 27: JBPM5 Community Training Course - Module #1 Introduction

Simple Process (BPMN2)

<process processType="executable" id="Sample" name="Sample Process" > <!-- nodes --> <startEvent id="_1" name="StartProcess" /> <scriptTask id="_3" name="Hello World" > <script>System.out.println("Hello World!");</script> </scriptTask> <endEvent id="_2" name="End" > <terminateEventDefinition/> </endEvent> <!-- connections --> <sequenceFlow sourceRef="_3" targetRef="_2" /> <sequenceFlow sourceRef="_1" targetRef="_3" /> </process>

Page 28: JBPM5 Community Training Course - Module #1 Introduction

Business Process Definitions

At runtime jBPM5 load the XML process definitions to an Object Model that contains the process structure

Page 29: JBPM5 Community Training Course - Module #1 Introduction

Business Process Runtime

Based on the process structure that jBPM5 creates, we can create new Processes InstancesThese Processes Instances will represent living process executions

Page 30: JBPM5 Community Training Course - Module #1 Introduction

Developing Applications

For developing applications with jBPM5 you will need to know:

Project library dependencies Understand the concept of KnowledgeBuilder, KnowledgeBase and KnowledgeSessionBasic jBPM5 APIs

Page 31: JBPM5 Community Training Course - Module #1 Introduction

Project Dependencies

Maven project dependencies of jBPM5 can be found at JBoss Maven Repositories:

<repositories> <repository> <id>JBoss Maven Repo</id> <name>jboss</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> </repository> </repositories>

Page 32: JBPM5 Community Training Course - Module #1 Introduction

Project Dependencies

The jBPM artifacts that you must use in your projects are:

<dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-flow</artifactId> <version>5.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-flow-builder</artifactId> <version>5.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bpmn2</artifactId> <version>5.0-SNAPSHOT</version> </dependency>

Page 33: JBPM5 Community Training Course - Module #1 Introduction

KBase and KSession

Knowledge Base: it will represent a compiled and static representation of our business assets. The knowledge base is constructured using a Knowledge Builder that will compile our knowledge assets into knowledge packages. The knowledge base can be composed of 1..N knowledge packages.

Knowledge Session: it represent our runtime environment. A knowledge session is created based on a knowledge base and it will contain a living version (in memory) of our knowledge assets. Our applications will interact with it. It will contain our processes and rules running inside it.

Page 34: JBPM5 Community Training Course - Module #1 Introduction

Basic APIs

KnowledgeBuilder and KnowledgeBuilderFactory KnowledgeBase and KnowledgeBaseFactoryStatefulKnowledgeSession

Page 35: JBPM5 Community Training Course - Module #1 Introduction

KnowledgeBuilder

It will compile our business assets into a binary and optimized formatThis process is expensive and must be avoided in production systemsWe usually build our packages once and then store the binary result in a repository to reuse themUseful methods

add(KnowledgeResource resource, ResourceType type)getErrors()getKnowledgePackages()

Page 36: JBPM5 Community Training Course - Module #1 Introduction

KnowledgeBase

It will contain our Knowledge packagesIt represents a static version of our knowledge assets Useful methods

addKnowledgePackage(KnowledgePackage)newStatefulKnowledgeSession()

Page 37: JBPM5 Community Training Course - Module #1 Introduction

StatefulKnowledgeSession

Easy and cheap to createIt will represent our runtime environmentOur processes will run inside a StatefulKnowledgeSessionUseful methods

startProcess(String processId, Map parameters)signalEvent(String eventId, Object event, Long processId)For rules, insert, update, retract, fireAllRules()For events: getWorkingMemoryEntryPoint(String name)

Page 38: JBPM5 Community Training Course - Module #1 Introduction

We have learned ...

jBPM5 is a BPMS that runs on top of Drools Expert (Rule Engine)Knowing the project library dependencies and the jBPM5 artifact dependencies we can create our first jBPM5 project Using the Basic APIs we can set up easily our runtime environmentStay tuned for the next modules that will explain important topics such as:

The Business Process Management DisciplineThe Business Process Modeling and Notation V2Human Interactions inside our processesetc.

Page 39: JBPM5 Community Training Course - Module #1 Introduction

Next Modules

Stay tuned for the next modules that will explain important topics such as:

The Business Process Management DisciplineThe Business Process Modeling and Notation V2Human Interactions inside our processesetc.

Page 40: JBPM5 Community Training Course - Module #1 Introduction

Related Links

You can find more information, examples, tutorials and more in:

Official documentation http://hudson.jboss.org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/target/jbpm-5.0-SNAPSHOT-docs-build/jbpm-docs/html/index.html

Blog Athico: http://blog.athico.com

Salaboy Blog http://salaboy.wordpress.com

Plug Tree Bloghttp://www.plugtree.com

Page 41: JBPM5 Community Training Course - Module #1 Introduction

Enjoy! and be patient for the first Hands On Labs!

Page 42: JBPM5 Community Training Course - Module #1 Introduction

  

Questions?

Page 43: JBPM5 Community Training Course - Module #1 Introduction

  

Contact us atwww.plugtree.com