Executing BPMN 2.0 with jBPM 3
or (at your option) any later version
Falko Menge
JUDCon 2010
Berlin
• Consultant, trainer & coach for
  jBPM 3 & 4, Drools, BPMN                   Falko Menge
• Developer of several                   falko.menge@camunda.com
  Open Source projects
  (Activiti, Oryx Editor, WSDL2XForms,
  InstantSVC, …)
• Member of BPMN specification team
  at OMG
• Co-author of „BPMN 2.0 by Example“

Areas of Interest:
BPM, SOA & EAI with Open Standards
and Open Source Software
Process Execution
(BPMN 2.0, jPDL, BPEL, XPDL, …)
Enterprise Applications with Java EE
Overview



           BPMN

           Mapping BPMN to jPDL

           Abstracting the Engine
BPMN?
BPMN 2.0 – An Example
BPMN 2.0 Status




                  …
Why does everybody want BPMN 2.0?




         <XML>     Diagram          Execution   <XML>
                 Interchange        Semantics
BPMN 1.x: Just Symbols




                         Notation
BPMN 2.0: Model and Notation


     Execution
                        Examples
     Semantics




       Model            Notation




                       XML Diagram
    XML          XMI
                       Interchange
          XSLT
Desired Architecture with BPMN 2.0
What does that mean as well?
Where are those
BPMN process engines?
Currently, jBPM 3 is used
Isn‘t there a gap?




                     ?
Goal: Forward Engineering




                            Mapping



                             Or even
                            Roundtrip?

       Process                           Process
       Analyst                           Engineer
Mapping Overview (1/2)
Mapping Overview (2/2)
Does that mean there are different models?
                 „Call                                          FraudService.
                Fraud-                                      checkFraud(customer)
               Service“




                            ??




      BPMN Repository                 Developer                     Repository in
        (Signavio)                 Repository (SVN)                Process Engine




                            Model in
                           Developer


                Business                              Model in
                  Model                               Execution


                                          Logical
                                          Model
Patterns

  Pool extraction
  Transform custom elements
  into standard language constructs
  Custom task service
  Localization
What about my Java code?
Process Engine Abstraction Layer (PEAL)
                                             ESB


                             Application              Services




                                           API

        BPMN                                     Binding
        Modell
                   Mapping

                                     Process
                                     Engine

                                                 Binding

                                    Connectivity



                 Services                                  Application

                                       ESB
Example Code with PEAL



   UserTask task3 = taskService
       .createTaskQuery()
       .processInstanceId(pi.getId())
       .potentialOwner("mike")
       .uniqueResult();
   assertEquals("Specify Advertising strategy",
                task3.getActivityName());

   variables = new HashMap<String, Object>();
   variables.put("website_name", "SetpStone");
   task3.complete(variables);

   pi.reload();
   assertTrue(pi.isEnded());
   Changes to the jbpm 4 API are minimal (but can be bound to
   jbpm 3 and other engines as well)
Data Object Abstraction
                                                                       API
                    DataObject                              «interface»
                                                         DataObjectAware
                                                   +getPersistentDataObject()
               +getValue()                         +setPersistentDataObject()
               +setValue()                         +getTransientDataObject()
                                            1
                                                   +setTransientDataObject()
                                                   +...()


 PersistentDataObject        TransientDataObject
                                                                                  ExecutionContext
                                                                                                             ExecutionContext
                                                                                  DataObjectAware
 +getValue()
  getValue()                 +getValue()
                              getValue()
 +setValue()                 +setValue()
                                                                                                         1

                                                                                   ContextInstace
                                                                                                             ContextInstance
                                                                                  DataObjectAware

                                                                                                         1
         MyPersistentDataObject
     -NAME : String = "MyVariable"                                                ProcessInstance
                                                                                                             ProcessInstance
                                                                                  DataObjectAware

                                                                                                         1

Project specific DataObjects                                                    Binding   (e.g.jBPM 3)   jBPM 3
Abstraction of Service Adapters
jBPM 3




                                                    API




Binding (e.g. jBPM 3)




                        Project specific adaptors
Why so complicated? Example with asynchronous Services


         <<Node>>
    Invoke ESB Service
                                                    EJB-Call
     TX 1: create request                           without sync.
                                    jBPM job
                                                    result
     TX 2: call EJB
                                                           ESB
     TX 3: process response     Signal from JbpmCallback




         <<Node>>
         Invoke EJB
     TX 1: create request                           EJB-Call with
                                    jBPM job        sync. result
     TX 2: call EJB
                                    jBPM job
     TX 3: process response


                 jBPM Process
Process Engine Abstraction Layer (PEAL)
                                             ESB


                             Application              Services




                                           API

        BPMN                                     Binding
        Modell
                   Mapping

                                     Process
                                     Engine

                                                 Binding

                                    Connectivity



                 Services                                  Application

                                       ESB
Thank you for your attention – Any questions?
camunda services GmbH
 Thank You!                                                           Zossener Str. 55-58
                                                                      1096 Berlin
                                                                          1
                                                                      Telefon: +49 30 664 0409-00
                                                                      Telefax: +49 30 664 0409-29
                                                                      Email: info@camunda.com




                                                 Falko Menge
                         Consultant, trainer and software developer
                                      falko.menge@camunda.com


JUDCon
Berlin, 8 October 2010

                                                                      The BPM Blog
                                                                      www.bpm-guide.de

Executing bpmn 2.0 with j bpm 3 or (at your option) any later version

  • 2.
    Executing BPMN 2.0with jBPM 3 or (at your option) any later version Falko Menge JUDCon 2010 Berlin
  • 3.
    • Consultant, trainer& coach for jBPM 3 & 4, Drools, BPMN Falko Menge • Developer of several falko.menge@camunda.com Open Source projects (Activiti, Oryx Editor, WSDL2XForms, InstantSVC, …) • Member of BPMN specification team at OMG • Co-author of „BPMN 2.0 by Example“ Areas of Interest: BPM, SOA & EAI with Open Standards and Open Source Software Process Execution (BPMN 2.0, jPDL, BPEL, XPDL, …) Enterprise Applications with Java EE
  • 4.
    Overview BPMN Mapping BPMN to jPDL Abstracting the Engine
  • 5.
  • 7.
    BPMN 2.0 –An Example
  • 8.
  • 9.
    Why does everybodywant BPMN 2.0? <XML> Diagram Execution <XML> Interchange Semantics
  • 10.
    BPMN 1.x: JustSymbols Notation
  • 11.
    BPMN 2.0: Modeland Notation Execution Examples Semantics Model Notation XML Diagram XML XMI Interchange XSLT
  • 12.
  • 13.
    What does thatmean as well?
  • 14.
    Where are those BPMNprocess engines?
  • 15.
  • 16.
  • 17.
    Goal: Forward Engineering Mapping Or even Roundtrip? Process Process Analyst Engineer
  • 18.
  • 19.
  • 20.
    Does that meanthere are different models? „Call FraudService. Fraud- checkFraud(customer) Service“ ?? BPMN Repository Developer Repository in (Signavio) Repository (SVN) Process Engine Model in Developer Business Model in Model Execution Logical Model
  • 21.
    Patterns Poolextraction Transform custom elements into standard language constructs Custom task service Localization
  • 22.
    What about myJava code?
  • 23.
    Process Engine AbstractionLayer (PEAL) ESB Application Services API BPMN Binding Modell Mapping Process Engine Binding Connectivity Services Application ESB
  • 24.
    Example Code withPEAL UserTask task3 = taskService .createTaskQuery() .processInstanceId(pi.getId()) .potentialOwner("mike") .uniqueResult(); assertEquals("Specify Advertising strategy", task3.getActivityName()); variables = new HashMap<String, Object>(); variables.put("website_name", "SetpStone"); task3.complete(variables); pi.reload(); assertTrue(pi.isEnded()); Changes to the jbpm 4 API are minimal (but can be bound to jbpm 3 and other engines as well)
  • 25.
    Data Object Abstraction API DataObject «interface» DataObjectAware +getPersistentDataObject() +getValue() +setPersistentDataObject() +setValue() +getTransientDataObject() 1 +setTransientDataObject() +...() PersistentDataObject TransientDataObject ExecutionContext ExecutionContext DataObjectAware +getValue() getValue() +getValue() getValue() +setValue() +setValue() 1 ContextInstace ContextInstance DataObjectAware 1 MyPersistentDataObject -NAME : String = "MyVariable" ProcessInstance ProcessInstance DataObjectAware 1 Project specific DataObjects Binding (e.g.jBPM 3) jBPM 3
  • 26.
    Abstraction of ServiceAdapters jBPM 3 API Binding (e.g. jBPM 3) Project specific adaptors
  • 27.
    Why so complicated?Example with asynchronous Services <<Node>> Invoke ESB Service EJB-Call TX 1: create request without sync. jBPM job result TX 2: call EJB ESB TX 3: process response Signal from JbpmCallback <<Node>> Invoke EJB TX 1: create request EJB-Call with jBPM job sync. result TX 2: call EJB jBPM job TX 3: process response jBPM Process
  • 28.
    Process Engine AbstractionLayer (PEAL) ESB Application Services API BPMN Binding Modell Mapping Process Engine Binding Connectivity Services Application ESB
  • 29.
    Thank you foryour attention – Any questions?
  • 30.
    camunda services GmbH Thank You! Zossener Str. 55-58 1096 Berlin 1 Telefon: +49 30 664 0409-00 Telefax: +49 30 664 0409-29 Email: info@camunda.com Falko Menge Consultant, trainer and software developer falko.menge@camunda.com JUDCon Berlin, 8 October 2010 The BPM Blog www.bpm-guide.de