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.

7 sins of workflow

523 views

Published on

Talk held on 21st of Septemer 2017 at Bedcon Java conference in Berlin about the 7 sins of workflow management in Java

Published in: Technology
  • Be the first to comment

7 sins of workflow

  1. 1. The 7 sins of workflow mail@bernd-ruecker.com
  2. 2. The 7 sins of workflow 3 2 4 6 5 7 1
  3. 3. What is workflow?
  4. 4. The obvious use case for workflow: Human task management
  5. 5. A simple example Human task management Service collaboration Events , e.g. timers * Modeled in BPMN = ISO Standard for modeling and execution
  6. 6. Tasklists and task forms …
  7. 7. Another use case: service collaboration
  8. 8. Service A Challenge: Synchronous collaboration Call service B Service B The network is unreliable Hystrix adds circuit breaker & fail fast Retry capability & async behavior is missing
  9. 9. Service A Challenge: Asynchronous collaboration Send message to B Service B Wait for response Timeout handling Message correlation & deduplication State handling Parallelism & merging
  10. 10. Challenge: Distributed transactions 1. book hotel 2. book car 3. book flight 6. cancel hotel 5. cancel car 4. In case of failure trigger compensations book trip Service A Car ServiceHotel Service Flight Service ACID-Transactions only local in the service contexts Distributed transaction via Saga pattern using compensating activities
  11. 11. A workflow engine is a (persistent) state machine
  12. 12. What BPMN can do
  13. 13. What BPMN can do
  14. 14. What BPMN can do
  15. 15. Toolbox for distributed systems Handling of time & timeouts Retry Versioning Compensation & Saga Message correlation & deduplication
  16. 16. Decisions
  17. 17. Workflow and BPM
  18. 18. … and death by properties panel Same story with BPM: Shiny vendors promised zero-code … proprietary, alien like tools …
  19. 19. Let‘s simply build this ourselves…* * how hard can it be…
  20. 20. It is en-vogue
  21. 21. This is not a new idea… Own DSL, parsing, graphical representation, modeler, persistence, escalation, version management, tooling, …
  22. 22. Alarming by management attention
  23. 23. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 7
  24. 24. BPM done right Developer friendly Composable BizDevOps
  25. 25. … There are lightweight and open source workflow engines or state machines available. Leverage them!
  26. 26. Spring Boot example @Component @EnableBinding(Sink.class) public class MessageListener { @Autowired private ProcessEngine camunda; @StreamListener(target = Sink.INPUT) public void orderPlacedReceived(Message<Order> message) { camunda.getRuntimeService().createMessageCorrelation(message.getMessageType()) .processInstanceBusinessKey(message.getTraceId()) .setVariable("orderId", message.getPayload()) .correlate(); } }
  27. 27. Living documentation
  28. 28. Executable specifications
  29. 29. Operational visibility 345 67812
  30. 30. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 7
  31. 31. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 4 6 5 Stakeholders habitat violation
  32. 32. The 7 sins of workflow Zero-code suites Homegrown engine No engine Wrong engine 6 5 Granularity bloopers Stakeholders habitat violation
  33. 33. Example
  34. 34. The 7 sins of workflow Zero-code suites Homegrown engine Granularity bloopers Over engineering No engine Wrong engine Wrong usage 6 Stakeholders habitat violation
  35. 35. 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
  36. 36. Microservice Orchestration?
  37. 37. End-to-end processes cross microservice boundaries Order Inventory Payment
  38. 38. Payment Distributed flows are owned by microservices Order Distributed orchestration
  39. 39. End-to-end processes as 1st class citizen PaymentOrder Core Capability Support Capabilities Business Capabilities
  40. 40. Order Order Order Order Architecture Order Engine A Payment Engine B Monitoring Human Task Management Coarse grained central monitoring Fine grained monitoring & operations (per context) DevOps Tec Ops Biz Ops Central
  41. 41. Example InventoryPaymentOrder ShippingCheckout Monitor https://github.com/flowing/flowing-retail/
  42. 42. Container (e.g. Tomcat, WildFly, Websphere, …) Architecture possibilities Your application Engine DB BPMN Java … Your application Engine DB BPMN Java … Engine (Docker, Tomcat, …) Your application DB Embedded engine Container managed engine Remote engine BPMN Java, C#, Go, JS, …
  43. 43. Live
  44. 44. 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
  45. 45. 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, …)
  46. 46. Avoid the 7 sins and life will be great!
  47. 47. Thank you!
  48. 48. Code: https://github.com/berndruecker Slides: https://bernd-ruecker.com Blog: https://blog.bernd-ruecker.com Feedback: https://bernd-ruecker.com/feedback

×