2012 02-04 fosdem 2012 - guvnor and j bpm designer


Published on

Presentation over Drools, Guvnor, jBPM and jBPM Designer given by Geoffrey De Smet and Marco Rietveld at FOSDEM 2012.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Who’s heard of BPM? Who’s actually written BPMN? Who’s heard of jBPM? Who’s worked with business analysts? Who has enjoyed working with business analysts? Who’s sees themselves becoming a business analyst in the coming years? ... my apologies.
  • Please, if you become a business analyst, let the developers do their work. I’ve worked a few different places where the software requirements were filled with business terms that took a while to learn. Regardless of where you work, as a developer you have to learn the domain: bank accounts, freight logistics, insurance models, etc. Part of the problem here is that not only do the business analysts have to create and write down the business process – we then have to translate it into code. There’s a duplication of effort in the sense that both analyst and developer sometimes have to understand the business process fully. And of course, there are always “gotcha’s” -- my housemate was complaining the other day about how they wanted generic screens for processing orders (train-related company) except for that 1 (of 7) screen.
  • This is a slightly more polite version of the last slide. We want the business analysts to concentrate on the business process – not the code. (Anecdote: an ex-colleague analyst of mine was great – but he was an old developer, and wanted us to code things certain way. I would say to him: “The hell with that – you do your work, I’ll do mine!”) Make them active participants in the process.
  • This is what I’m going to talk about: - Business Analyst stuff and what we then use to implement it - What is this thing i’m talking about and.. what does it do? - Demo! (people who are taking naps, please wake up) - Summary, because you’ll have forgotten everything I said before the demo
  • It’s why developers at companies who don’t make software, get paid. Not really – it’s more than that: it’s whole interaction. Visibility: Hey, I can understand what’s happening! Monitoring: Wow, I can really see what’s happening now! High-level: Huh, I understand what’s going on here. Continuous: Modification of BP’s without developer involvement Speed: Which means work is done more quickly Agility: Which means companies/development can respond more quickly
  • Worked at a logistics company, and changing how incoming freight information was processed was a nightmare. - Change requests - New Projects - AHHH... I’m having flashbacks. Unstructured/Non-linear: maybe it’s not a A, B, C process: - for example: Monitoring, processing incoming streams of input Adaptive Case Management - Basically, data-driven processes – where the process is based on the data, not the other way around Event-driven: - Multiple events “processed” in one process
  • Model: graphical Notation: xml-based syntax Execution: how things should be done “ Understandable” -- see next slide, xml, not easily readable - collaboration between different parties - and we’re moving on, now..
  • Ehh.. no one wants to write bpmn 2. Which is why we have the designer
  • Hey, we’re done with the Business Analyst stuff..
  • JBPM is an open-source business process management project, for those of you who don’t know how to read
  • Explain diagram Point out integration with rules
  • So, done with the background, and now we’re going to look at Designe Lead on Designer in Tihomir Surdilovic, based on the Oryx project with lots of additionsr
  • So, we edit BPMN processes here. The BPMN it creates conforms to the BPMN syntax (big surprise!) and it works with BPMN internally. But it does more.. (and I’ll get to that in a sec). Guvnor integration helps make guvnor the “one-stop shop” Some people have built their own applications by embedding Designer and using the Guvnor rest api.
  • This is just a brief overview so that you guys will know where to look when I’m doing the demo.
  • On the left is a set of images showing how the shape menu works.
  • Task form generation
  • 2012 02-04 fosdem 2012 - guvnor and j bpm designer

    1. 1. Geoffrey De Smet Marco Rietveld Managing workflows and business rules with Guvnor and jBPM designer
    2. 2. Business Logic Integration Business Logic Integration Platform Rule engine Workflow Complex event processing (CEP) Business Rule Management System (BRMS) Automated planning
    3. 3. Geoffrey De Smet Why would I need Drools and Guvnor?
    4. 4. Use cases I have hammer, so every problem is a nail?
    5. 5. The myth <ul><li>Drools is a rule engine
    6. 6. So because </li><ul><li>Drools can fulfil business rules
    7. 7. Drools is Turing complete </li></ul><li>we should write the entire business layer in Drools? </li><ul><li>No!
    8. 8. Not imperative </li><ul><li>Not like Java, Scala, Groovy, ... </li></ul><li>Declarative </li><ul><li>Like RegEx, SQL, JPA-QL, …
    9. 9. Easier to read, better at scaling </li></ul></ul></ul>
    10. 10. When to use Drools <ul><li>Extract business decisions in Drools that either: </li><ul><li>Require schooled domain expertise
    11. 11. Change often/fast </li></ul></ul>
    12. 12. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
    13. 13. Insurances acceptance and fee calculation </li></ul></ul>
    14. 14. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
    15. 15. Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul></ul>
    16. 16. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
    17. 17. Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul><li>Diagnostics </li><ul><li>Possible diseases based on symptoms </li></ul></ul>
    18. 18. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
    19. 19. Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul><li>Diagnostics </li><ul><li>Possible diseases based on symptoms </li></ul><li>Complex validation </li><ul><li>Car parts selection </li></ul></ul>
    20. 20. Use cases <ul><li>Financial decisions </li><ul><li>Mortgages acceptance and interest calculation
    21. 21. Insurances acceptance and fee calculation </li></ul><li>Price calculations </li><ul><li>Phone/Telecom bills </li></ul><li>Diagnostics </li><ul><li>Possible diseases based on symptoms </li></ul><li>Complex validation </li><ul><li>Car parts selection </li></ul><li>Not a good use case: an XML parser </li><ul><li>Use Java code for that </li></ul></ul>
    22. 22. Mortgages example
    23. 23. Developers don't like data input from spreadsheets <ul><li>Before App 1.0: Mortgages rules in a spreadsheet </li><ul><li>Which version/copy of the spreadsheet file?
    24. 24. Which field has the result our application needs? </li></ul></ul>Version 1 Version 2
    25. 25. Mortgage experts like the flexibility of spreadsheets <ul><li>Since App 1.0: Mortgages rules in source code </li><ul><li>Changing business rules not flexible enough
    26. 26. Business rules are hard coded in Java </li></ul></ul>Invalid: must be a number
    27. 27. Mortgage experts change their mind a lot <ul><li>Flooded with new improvement requests: </li><ul><li>when income below 500
    28. 28. when income below 1000 and age above 50
    29. 29. when income below 1% of mortgage amount </li></ul></ul>Invalid: must be a number
    30. 30. Mortgage experts like the flexibility of Guvnor <ul><li>App 2.0: Mortgage rules in Guvnor repository </li><ul><li>Flexible like spreadsheet </li><ul><li>But backed by formal DRL and JavaBeans </li></ul><li>No spreadsheet versions/copies </li></ul></ul>
    31. 31. My business requires domain expertise Only mortgage managers understand mortgage rules
    32. 32. Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this company for year(s). </li></ul></ul>
    33. 33. Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this company for year(s). </li></ul><li>Do we have </li><ul><li>university's degree in economics? No
    34. 34. participated in mortgages conferences/courses? No
    35. 35. years of mortgage customer experience? No </li></ul></ul>
    36. 36. Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this company for year(s). </li></ul><li>Do we have </li><ul><li>university's degree in economics? No
    37. 37. participated in mortgages conferences/courses? No
    38. 38. years of mortgage customer experience? No </li></ul><li>Do we have a clue when the mortgage rules need to change? No </li></ul>
    39. 39. Schooled domain expertise <ul><li>Are we, the developers, domain experts? </li><ul><li>Yes, we've been working in this company for year(s). </li></ul><li>Do we have </li><ul><li>university's degree in economics? No
    40. 40. participated in mortgages conferences/courses? No
    41. 41. years of mortgage customer experience? No </li></ul><li>Do we have a clue when the mortgage rules need to change? No
    42. 42. Are we, the developers, domain experts? No </li><ul><li>Mortgage manager is the domain expert </li></ul></ul>
    43. 43. Domain experts can not read/write Java source code <ul><li>Communication problem </li><ul><li>Domain expert can not read it: </li></ul></ul>for (Mortgage m : mortgages ) { for (Applicant a : m.getApplicants()) { if (a.getAge() > 70 ) { boolean existsGuarantor = false ; for (Guarantor g : m.getGuarantors() { if (g.getAge < 60 ) { existsGuarantor = true ; } } // Will they spot the bug in this code? if (existsGuarantor) { m.setApproved( false ); } } } }
    44. 44. Domain experts can read rules in the Guided Rule Editor
    45. 45. Domain experts can write rules in the Guided Rule Editor Change
    46. 46. Translated to DRL Executed on JavaBeans
    47. 47. Guided Rule Editor demo video Demo video
    48. 48. Natural language (DSL) <ul><li>DSL is even easier to read/write </li></ul><ul><li>Developers create the building blocks
    49. 49. Domain experts make the building </li></ul>Source: wikipedia
    50. 50. My business rules change often This mortgage rule change must be released by noon
    51. 51. Deliver changes fast
    52. 52. Deliver changes fast
    53. 53. Deliver changes fast
    54. 54. Business rule change <ul><li>Not a data change </li><ul><li>Requires test and release lifecycle
    55. 55. Logic changes </li></ul><li>Not a software change </li><ul><li>Delivered in hours, not days
    56. 56. Self-service by mortgage manager </li></ul></ul>
    57. 57. Testing before releasing <ul><li>Domain experts need to unit test too </li><ul><li>Example: mortgage of Erik must be disapproved </li></ul></ul>
    58. 58. Releasing <ul><li>Release a snapshot of the rules package
    59. 59. Available at URL: </li><ul><li> </li></ul></ul>
    60. 60. Deployment infrastructure
    61. 61. Auditable and reproducible Why was that mortgage approved last year?
    62. 62. Auditing <ul><li>View old revisions of rules </li></ul>
    63. 63. Summary
    64. 64. Summary <ul><li>Use Drools and Guvnor
    65. 65. When your business decisions either </li><ul><li>Require domain expertise
    66. 66. Change often/fast </li></ul></ul>
    67. 67. Marco Rietveld
    68. 68. How do we keep business analysts from bothering us? Wait, you want A to do D, but not B and C?!?
    69. 69. How do we let business analysts do their work?
    70. 70. The agenda <ul><li>BPM, BPMN 2.0 and jBPM
    71. 71. What does jBPM Designer do?
    72. 72. Demo
    73. 73. Summary </li></ul>
    74. 74. B usiness P rocess M odelling <ul><li>Visibility
    75. 75. Monitoring
    76. 76. High - level </li></ul><ul><li>Continuous improvement
    77. 77. Speed of development
    78. 78. Increased agility </li></ul>A business process is a collection of steps that when executed, accomplish a specific goal. It can often be described using a flow chart.
    79. 79. Flexible and Adaptive Processes Traditional workflow systems have problems with change, complexity, flexibility, data-intensive applications... BPM helps us with: <ul><ul><li>Unstructured, non-linear or flexible processes
    80. 80. Adaptive Case Management </li><ul><li>Data dependent/conditional processes </li></ul><li>Event-driven BPM </li></ul></ul>
    81. 81. BPMN 2.0 <ul><li>OMG specification </li><ul><li>Model
    82. 82. Notation
    83. 83. Execution semantics </li></ul><li>“Understandable” by all business users
    84. 84. Extensible </li></ul>
    85. 85. BPMN 2.0 Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <definitions id=&quot;Definition&quot; targetNamespace=&quot;http://www.example.org/MinimalExample&quot; xmlns=&quot;http://www.omg.org/spec/BPMN/20100524/MODEL&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd&quot;> <process processType=&quot;Private&quot; isExecutable=&quot;true&quot; id=&quot;ScriptTask&quot; name=&quot;ScriptTask Process&quot; tns:packageName=&quot;com.sample&quot; > <!-- nodes --> <startEvent id=&quot;_1&quot; name=&quot;StartProcess&quot; /> <scriptTask id=&quot;_2&quot; name=&quot;Hello&quot; scriptFormat=&quot;http://www.java.com/java&quot; > <script>System.out.println(&quot;Hello World&quot;);</script> </scriptTask> <endEvent id=&quot;_3&quot; name=&quot;EndProcess&quot; > <terminateEventDefinition/> </endEvent> <!-- connections --> <sequenceFlow id=&quot;_1-_2&quot; sourceRef=&quot;_1&quot; targetRef=&quot;_2&quot; /> <sequenceFlow id=&quot;_2-_3&quot; sourceRef=&quot;_2&quot; targetRef=&quot;_3&quot; /> </process> <bpmndi:BPMNDiagram> <bpmndi:BPMNPlane bpmnElement=&quot;ScriptTask&quot; > <bpmndi:BPMNShape bpmnElement=&quot;_1&quot; > <dc:Bounds x=&quot;16&quot; y=&quot;16&quot; width=&quot;48&quot; height=&quot;48&quot; /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement=&quot;_2&quot; > <dc:Bounds x=&quot;96&quot; y=&quot;16&quot; width=&quot;80&quot; height=&quot;48&quot; /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement=&quot;_3&quot; > <dc:Bounds x=&quot;208&quot; y=&quot;16&quot; width=&quot;48&quot; height=&quot;48&quot; /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement=&quot;_1-_2&quot; > <di:waypoint x=&quot;40&quot; y=&quot;40&quot; /> <di:waypoint x=&quot;136&quot; y=&quot;40&quot; /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement=&quot;_2-_3&quot; > <di:waypoint x=&quot;136&quot; y=&quot;40&quot; /> ...
    86. 86. So.. we have a way of looking at business processes and a way of specifying them..
    87. 87. jBPM project <ul><li>Open-source business process management </li><ul><li>Embeddable, lightweight Java process engine, supporting native BPMN 2.0 execution
    88. 88. Eclipse-based and web-based editor
    89. 89. Pluggable persistence and transactions (JPA / JTA)
    90. 90. Pluggable human task service based on WS-HumanTask
    91. 91. Management console (process instance management, task lists, task form management, and reporting)
    92. 92. History logging (querying / monitoring / analysis)
    93. 93. Etc.. </li></ul></ul>
    94. 94. jBPM application architecture Core Services Business Analyst End User Developer Rules Core Engine Guvnor Repository Eclipse Editor Web-Based Designer History Log Task Service jBPM Console Your Application Your Services
    95. 95. <ul><li>BPM, BPMN 2.0 and jBPM
    96. 96. What does jBPM Designer do?
    97. 97. Demo
    98. 98. Summary </li></ul>
    99. 99. jBPM 5 Designer <ul><li>Integrated with Guvnor </li><ul><li>Versioning, storage and deployment </li></ul><li>Embeddable (in your own application) </li><ul><li>includes a javascript interface
    100. 100. JSON used for communication </li></ul></ul><ul><li>Targets business users </li><ul><li>Allows users to focus on process creation </li></ul><li>BPMN 2.0 web editor </li><ul><li>Creates fully executable BPMN
    101. 101. Supports the jBPM BPMN subset </li></ul></ul>
    102. 102. jBPM Designer Features 1. Shape repository panel 2. Canvas 3. Properties panel 4. Toolbar 5. Footer 6. Process information
    103. 103. Designer: Shape Menu 1. Connection section 2. Morphing section
    104. 104. Designer: Task Form Generation <ul><li>Automatic generation of forms for human tasks </li><ul><li>Using defined process variables,
    105. 105. human task data I/O parameters and associations
    106. 106. (HTML/Javascript) Source immediately available
    107. 107. Generated forms are stored in Guvnor
    108. 108. All forms are fully usable inside jBPM console
    109. 109. Each form includes basic JavaScript form validation </li></ul></ul>à à
    110. 110. <ul><li>Business analyst stuff
    111. 111. Obligatory introduction to project
    112. 112. Demo!
    113. 113. Summary (AKA The End) </li></ul>
    114. 114. The Slide that you guys look at while I switch to the demo! Bonus: how many (full or partial) circles are on this slide?
    115. 115. Demo: Employee Evaluation <ul><li>1. jbpm-installer </li><ul><li>+ latest version of Designer
    116. 116. + latest version of Guvnor </li></ul><li>2. Start up installer </li><ul><li>(JBoss AS7 + Guvnor + Designer + Console) </li></ul><li>3. Create process in Guvnor/Designer </li><ul><li>Import real process... </li></ul><li>4. Save process
    117. 117. 5. Run process! </li></ul>
    118. 118. Summary
    119. 119. How do we keep them busy? <ul><li>BPM & BPMN 2: Business Process Modelling </li><ul><li>“Go work on the Business Process!” </li></ul><li>jBPM: how to implement an analyst’s work </li><ul><li>Process engine that executes the BPMN </li></ul><li>jBPM Designer: “Look at what you can do!” </li><ul><li>BPMN process creation and modification
    120. 120. Integration with Guvnor: </li><ul><li>Versioning, storage and deployment </li></ul></ul></ul>
    121. 121. Q&A <ul><li>Drools/Guvnor homepage </li><ul><li>http://www.jboss.org/drools </li></ul><li>jBPM homepage </li><ul><li>http://www.jboss.org/jbpm </li></ul><li>Source code: </li><ul><li>http://www.github.com/droolsjbpm
    122. 122. Designer: http://www.github.com/tsurdilo/process-designer </li></ul><li>Download this presentation </li><ul><li>http://www.jboss.org/drools/presentations </li></ul><li>Twitter: @geoffreydesmet & @marcorietveld
    123. 123. Google+: Geoffrey De Smet & Marco Rietveld
    124. 124. IRC: #drools, #droolsdev and #jbpm on Codehaus </li></ul>
    125. 125. Image sources <ul><li>http://images2.visual-paradigm.com/bpva/tutorials/businessprocessmodeling_screenshots/31_complete_bpd.png
    126. 126. http://mainthing.ru/wp-content/uploads/2010/12/battleship-en.png
    127. 127. http://www.slideshare.net/krisverlaenen/jbpm5-argentina-workshop
    128. 128. JBPM online documentation: http://docs.jboss.org/jbpm/v5.2/userguide/ </li></ul>