JBPM5 Community Training Course - Module #1 Introduction
jBPM5 Community Training Sponsored by Plugtree
Module 1: jBPM5 Introduction jBPM5 Community Training version: 1.0-SNAPSHOT Release Date: 01/28/2011 Under The Creative Common License
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/.
AgendajBPM Project HistoryjBPM5 OverviewjBPM5 GoalsClassic BPMS vs jBPM5 architecture (Competitors)BPMN2 StandardjBPM5 featuresDeveloping Applications with jBPM5Conclusions
jBPM Project HistoryjBPM 3.x borns as a BPMS (Business Process ManagementSystem)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
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 DroolsFlow.The main idea behind Drools Flow was to provide BPMScapabilities on top of the Rule Engine.Kris Verlaenen, Phd was in charge of the Drools Flowinitiative, writing it from the scratch.The main goal of Drools is to provide a platform where rulesand business processes can live, coexist and collaborate asKnowledge Representations.
jBPM Project HistoryDrools Flow 5.x was released back in 2009The rebranded version of Drools Flow, jBPM5 wasreleased on December of 2010Provides a rock solid BPMS core and a flexiblemechanisms to implement the main stages of the BPMdisciplineTotally based on BPMN2jBPM5 was conceived having in mind the code base ofDrools Flow and covering all the functionality providedby jBPM 4.xjBPM 5.x is a mature code base with more than 3 years ofdevelopment and several testing.
jBPM Project HistoryThe main difference between jBPM5 and other BPMSs isthe fact that jBPM5 runs on top of Drools Expert (RuleEngine), providing amazing features like: The possibility of doing inferences over our business processes Handling process exceptional paths using business rules Mixing Complex Event Processing, Rules and Processes together without learning a new API for each topic
jBPM5 OverviewIt is a bridge between Business Analysts and DevelopersApache ASL LicensedCentral concept inside jBPM5: Business ProcessBPMS = 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 engine allow us to represent complex situations (real life is complex)
Business Processhmm.. but wait a second, What is a business process? "A sequence of activities, performed by humans or systems to complete a business goal"
Business Process ExampleSimple Emergency Service Process
jBPM5 FeaturesIt provides you a flexible platform for designing andexecuting your business processesIt provides you an integrated set of APIs for the RuleEngine, Process Engine and the Complex Event ProcessingEngineIt provides you a platform to build our applications usingbusiness processes to guide the company workIt provides you an abstraction about how your companysactivities are orchestratedIt provides a simple and automated mechanism to handleinformation across activities
Classic BPMS and Rule Engine InteractionDrawbacks of the classic approach: The Rule Engine and the BPMS uses different APIs Sharing information between the Rule Engine and the BPMS becomes complicated and difficult to maintain Our 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.
Inversion of ControlBusiness Processes and Business Rules run on top of theRule Engine
Inversion of ControlBenefits: Tightly coupled design Process Centric vision for common branches Exceptions are handled in a cleaner way with rules Using a declarative approach No problems with communications and marshaling We dont need to learn different APIs
Once again, Business Process "A sequence of activities, performed by humans or systems to complete a business goal"
Business Process StructureDirected Graph Composed of: Nodes (Activities) Connections (SequenceFlows) Outgoing and Incoming
Business Process StructureInternal Structure: Process Node Container Node
Business Process DefinitionsAt runtime jBPM5 load the XML process definitions toan Object Model that contains the process structure
Business Process RuntimeBased on the process structure that jBPM5 creates, wecan create new Processes InstancesThese Processes Instances will represent living processexecutions
Developing ApplicationsFor developing applications with jBPM5 you will need toknow: Project library dependencies Understand the concept of KnowledgeBuilder, KnowledgeBase and KnowledgeSession Basic jBPM5 APIs
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>
Project DependenciesThe jBPM artifacts that you must use in yourprojects 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>
KBase and KSessionKnowledge Base: it will represent a compiled and staticrepresentation of our business assets. The knowledge base isconstructured using a Knowledge Builder that will compile ourknowledge assets into knowledge packages. The knowledge basecan be composed of 1..N knowledge packages.Knowledge Session: it represent our runtime environment. Aknowledge session is created based on a knowledge base and it willcontain a living version (in memory) of our knowledge assets. Ourapplications will interact with it. It will contain our processes andrules running inside it.
Basic APIsKnowledgeBuilder and KnowledgeBuilderFactoryKnowledgeBase and KnowledgeBaseFactoryStatefulKnowledgeSession
KnowledgeBuilderIt will compile our business assets into a binary andoptimized formatThis process is expensive and must be avoided in productionsystemsWe usually build our packages once and then store thebinary result in a repository to reuse themUseful methods add(KnowledgeResource resource, ResourceType type) getErrors() getKnowledgePackages()
KnowledgeBaseIt will contain our Knowledge packagesIt represents a static version of our knowledge assetsUseful methods addKnowledgePackage(KnowledgePackage) newStatefulKnowledgeSession()
StatefulKnowledgeSessionEasy 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)
We have learned ...jBPM5 is a BPMS that runs on top of Drools Expert (RuleEngine)Knowing the project library dependencies and the jBPM5artifact dependencies we can create our first jBPM5 projectUsing the Basic APIs we can set up easily our runtimeenvironmentStay tuned for the next modules that will explain importanttopics such as: The Business Process Management Discipline The Business Process Modeling and Notation V2 Human Interactions inside our processes etc.
Next ModulesStay tuned for the next modules that will explain importanttopics such as: The Business Process Management Discipline The Business Process Modeling and Notation V2 Human Interactions inside our processes etc.
Related LinksYou can find more information, examples, tutorials andmore 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 Blog http://www.plugtree.com
Enjoy! and be patient for the firstHands On Labs!