Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java User Group Maas-Rhine February 2018: 7 sins of workflow

365 views

Published on

Slides from my talk at Eureg JUG Aachen in February 2018. You can find the recoding here: https://youtu.be/hS-4hjeFjt0. Code is available: http://github.com/flowing/flowing-retail and https://github.com/flowing/flowing-retail/tree/master/payment-rest.

Published in: Technology
  • Be the first to comment

Java User Group Maas-Rhine February 2018: 7 sins of workflow

  1. 1. The 7 sins of workflow mail@bernd-ruecker.com | @berndruecker Co-founder & Developer Advocate
  2. 2. The 7 sins of workflow 3 2 4 6 5 7 1 https://blog.bernd-ruecker.com/
  3. 3. What is workflow*? * Workflow Automation
  4. 4. The obvious use case for workflow automation: Human task management
  5. 5. Tasklists and task forms …
  6. 6. A simple workflow example Human task management Service collaboration Events , e.g. timers * Modeled in BPMN = ISO Standard for modeling and execution
  7. 7. More realistic examples
  8. 8. Service collaboration
  9. 9. Distributed systems Challenges of asynchronicity Distributed Transactions Communication is complex
  10. 10. Communication is complex Challenge #1:
  11. 11. Photo by Tookapic, available under Creative Commons CC0 1.0 license.
  12. 12. „There was an error while sending your boarding pass“
  13. 13. 3D- Barcode Generator Output Mgmt Check-In Web-UI Me Example
  14. 14. Check-in 3D- Barcode Generator Web-UI Me Output Mgmt Circuit breaker
  15. 15. „There was an error while sending your boarding pass“
  16. 16. Check-in 3D- Barcode Generator Web-UI Me Output Mgmt Stateful Retry Current situation (pretty bad)
  17. 17. Check-in 3D- Barcode Generator Web-UI Me Output Mgmt Stateful Retry Possible situation (pretty good) The failure never leaves this scope!
  18. 18. Workflow automation can do
  19. 19. Challenge #2: Challenges of asynchronicity
  20. 20. Check-in 3D- Barcode Generator Web-UI Me Output Mgmt Asynchronous communication You need to monitor timeouts
  21. 21. Check-in 3D- Barcode Generator Web-UI Me Output Mgmt Remember… The failure never leaves this scope!
  22. 22. Workflow…
  23. 23. Workflow…
  24. 24. Challenge #3: Distributed Transactions Distributed Transactions
  25. 25. Business transactions (sometimes called Saga pattern) Compensation
  26. 26. Compensation Saga-Pattern Manigfold Use Cases for Workflow Automation Business short running (milliseconds) potentially long running long running IT Automation of business processes (STP, Human Task Management, BPM) Business Transactions Communication in distributed systems Decision Automation Order / Application Management Invoice Management / Billing Inbound / Outbound Management Approval Stateful retries Correlate asynchronous responses / events Sequence of decoupled service calls Timeouts Approval Fraud check Risk check Fee calculation Motivated by Microservice Orchestration
  27. 27. Decision Automation
  28. 28. Let‘s simply build this ourselves…* * how hard can it be…
  29. 29. Death by properties panel OK – let‘s buy it from this guy. Low-code sounds great…* * what‘s the worst thing that can happen…
  30. 30. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 7
  31. 31. … There are lightweight and open source workflow engines or state machines available. Leverage them!
  32. 32. Live hacking
  33. 33. Before mapping processes explicitly with BPMN, the truth was buried in the code and nobody knew what was going on. Jimmy Floyd, 24 Hour Fitnesse „
  34. 34. Living documentation
  35. 35. Executable specifications
  36. 36. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 7
  37. 37. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 Stakeholders habitat violation
  38. 38. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 6 5 Granularity bloopers Stakeholders habitat violation
  39. 39. Example
  40. 40. The 7 sins of workflow Zero-code suites Homegrown engine Granularity bloopers Over engineering No engine Wrong engine Wrong usage 6 Stakeholders habitat violation
  41. 41. The 7 sins of workflow Zero-code suites Homegrown engine Granularity bloopers BPM monolith Over engineering No engine Wrong engine Wrong usage Stakeholders habitat violation
  42. 42. BPM architecture - the traditional view BPM This is an Anti-Pattern in microservice architectures!
  43. 43. Photo by born1945, available under Creative Commons BY 2.0 license.
  44. 44. Workflows live inside service boundaries In DDD: Bounded Contexts
  45. 45. Workflows live inside service boundaries The busines process as first class citizen
  46. 46. Finally!
  47. 47. Event-driven example InventoryPaymentOrder ShippingCheckout Monitor https://github.com/flowing/flowing-retail/ Human Tasks H2 H2
  48. 48. Live
  49. 49. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  50. 50. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  51. 51. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  52. 52. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  53. 53. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  54. 54. Manigfold architecture options https://blog.bernd-ruecker.com/architecture-options-to-run-a-workflow-engine-6c2419902d91
  55. 55. New kid on the block https://zeebe.io/ Zeebe Broker Your application Binary (MsgPack) Support streaming & batching Client Horiziontally scalable Append only log / event sourcing
  56. 56. Summary: How to avoid the 7 sins? • Use a lightweight workflow engine or state machine • Use it properly – as a state machine (state, timeouts, retrying, message correlation & deduplication, compensation) • Do not model everything • Leverage BizDevOps & embrace visibility • Slice your processes fitting your contexts (monolith vs. microservices) • Avoid over-engineering (enterprise-wide xyz, abstractions, …)
  57. 57. Thank you!
  58. 58. Code: https://github.com/berndruecker Slides: https://bernd-ruecker.com Blog: https://blog.bernd-ruecker.com Feedback: https://bernd-ruecker.com/feedback

×