Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[KIELive#38] Destroy wrong beliefs and run real...

[KIELive#38] Destroy wrong beliefs and run real processes

Learn what are business processes, when to use a process engine, implementation anti-pattens and much more!

About this event

[KIELive#38] Destroy wrong beliefs and run real processes

What is a process? When do you have to use a process engine? In this speech, we'll try to reach the "truth" using the pars destruens and pars construens methodology. After a review of the main anti patterns followed by BPM practitioners, we will go through a simple demo of an Order Fulfillment process.

Link to this video: https://red.ht/kielive38
demo repository: https://github.com/jbossdemocentral/rhpam7-order-management-demo-repo

About the invited speaker:

Donato works in Red Hat as Principal Specialist Solution Architect. He supports customers and partners across EMEA to explore and adopt Business Automation products. His focus is to evangelize and deliver demonstrations, technical workshop and Proof of Concept about Process Automation, Digital Decisioning and Mathematical Optimization.

He also advises customers on related matters: Enterprise Architecture, Application Development, Service Design and Integration.

KIE Community

July 27, 2021
Tweet

More Decks by KIE Community

Other Decks in Technology

Transcript

  1. 1 Destroy wrong beliefs and run real processes Donato Marrazzo

    Principal Specialist Solution Architect Business Automation KIE Live 38
  2. 2 Lord Francis Bacon (1561 – 1626) is an English

    philosopher and statesman, known as father of empiricism. He argued for the possibility of scientific knowledge based only upon inductive reasoning and careful observation of events in nature. A big thank you to my high school philosophy teacher: Prof. Di Lorenzo Pars destruens et pars construens Removes all prejudices and errors, then gain knowledge and truth
  3. 3 Huge processes ▸ When a process has more than

    20 / 30 tasks is hard to understand ▸ Error prone ▸ No clear status
  4. 4 Huge processes Solutions ▸ Re-design the process in multiple

    layers ▸ Reconsider the tasks purpose Golden rules ▸ A process is a chain of business relevant tasks and decisions ▸ A flowchart is a diagrammatic representation of an algorithm, a step-by-step approach to solve a task Causes ▸ Wrong granularity ▸ Lack of business purpose Consequences ▸ BPM engine slow down ・ BPM engines are not designed to implement fine grained tasks ▸ The process is hard to maintain
  5. 5 The following is a flowchart: ▸ Tasks have no

    business purpose (what is the final goal?) ▸ Tasks have a technical purpose ▸ Tasks are in a short living chain ▸ There’s no reason to model it as a process because it does not provide any business visibility ▸ The whole process is done or not, no intermediate state! Lack of business purpose
  6. 6 User interface tight coupling ▸ UI leverages the process

    to control the view ▸ UI has to poll continuously the process status to decide what to show next
  7. 7 User interface tight coupling Solutions ▸ Drop the process

    ▸ Move the logic in the UI layer Golden rules ▸ A process is a chain of business relevant tasks and decisions ▸ A webflow is a diagrammatic representation of the user interaction logic Causes ▸ View control in the wrong layer ▸ Need for a low code dev platform Consequences ▸ BPM engine slow down ・ Continuous polling ・ Short terms timers ▸ A change in the UI logic requires a change in the process logic => hard to maintain
  8. 8 Abusing event sub process ▸ Many event sub processes

    change the execution flow ▸ The logic is fragmented and confusing
  9. 9 Abusing event sub process Solutions ▸ Move from “traditional”

    sequential BPMN to case definition Golden rules ▸ A process design aims to reach the “perfect” repeatable sequence of activities ▸ A case is a collection of facts and events. Knowledge Workers guide the flow selecting among suggested options or creating ad hoc activities. Causes ▸ Business Logic is highly event driven ▸ Users decide what is the next best action Consequences ▸ Traditional BPMN semantic lead to poor process definitions difficult to understand and provide low value in terms of visibility
  10. 10 The process as System of Records ▸ All data

    are passed to the process although the process logic ignore them ▸ Process Variables contain big amount of data ▸ The process engine is continuously enquired to get the latest information
  11. 11 The process as System of Records Solutions ▸ Introduce

    a service layer which is in charge of persisting the data in a proper SoR ▸ When the process logic affects the data, they are updated in the SoR Golden rules ▸ The process has to handle the minimum amount of data necessary to accomplish the “process mission” Causes ▸ The process is seen as the information owner ▸ There is no mediator layer between the UI and the process Consequences ▸ BPM is not efficient in retrieving the information (by default, it handles variable as blob) ▸ The process is overwhelmed by data update events that have no real logical implications
  12. linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 14 Red Hat is the world’s

    leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you Optional section marker or title
  13. 16 Processes and data Why data inside the process? ▸

    Process execution is influenced by the data: ・ Gateways (if … then …) ・ Milestones actively listen for data changes ・ Inbound / Outbound Events comes with data ▸ Process triggers tasks which require data to achieve their goal ・ Regardless of whether they involve human or systems
  14. 17 Data Management Approaches ▸ Temporary Ownership: a process instance

    owns some data during its lifecycle (most common) ・ When the process instance is completed the ownership is transferred to another system ▸ Minimal Replica: a minimal subset of data is copied in the process instance but the data ownership is always outside the process ・ Minimal subset = the information that are strictly required by the process logic ・ Each task is in charge of updating the System of Record and send the minimal replica to the process instance (Consistency)
  15. 18 The red circle represents where customer data are read

    or written. Temporary Ownership Customer id firstName lastName kycResult existing (...) The whole customer flow through the process ▸ Customer can contain references to other data E.g. documents, account transaction log, etc
  16. 19 Data In Motion and At Rest ▸ Data handled

    by a process instance are considered "in motion" because they will be changed by the process logic. They are not consistent enough to be stored in the System of Records. ▸ By design, the process persists the data in the “real” System of Records (a DBMS or an ERP) as they become "stable" or before the process completion. From now on, the data are considered "at rest" outside the process engine. ▸ Some process related information can be promoted to the System of Records. E.g. the approval task date and time.
  17. 20 Analyzing the "in motion" data ▸ RHPAM DB is

    not a historical data warehouse. ▸ Nevertheless, users could be interested in analyzing the "in motion" data to react promptly to the real time information. ▸ How to replicate the runtime information in a data lake: a. External tools: ETL or Change Data Capture depending on the DBMS technology and on pre-existing technologies and skills b. Internal events: run the data replica logic in PAM runtime leveraging Event Emitters (via Kafka?)
  18. 21 Minimal Replica Customer id kycResult existing ▸ Only the

    few data are handled by the process ▸ Tasks ・ Initialized with the id, retrieve required data from the System of Records ・ Update directly the System of Records ・ Pass back to the process the minimal replica id id existing kycResult
  19. 22 No Intelligence for Minimal Replica ▸ When the process

    engine just handles the minimal replica, there’s no reason to extract information for Business Intelligence purposes ▸ All meaningful data are kept in the System of Records
  20. 23 Event Emitter Emitter is the main integration point with

    external systems. It will be called first to get implementation of the EventCollection next depending on the PersistenceEventManager implementation will provide the actual events on three phases: ▸ deliver is the first phase that gives complete view of events before persistence is completed ▸ apply is kind of confirmation that persistence is completed and events can be safely transferred ▸ drop is kind of rejection that persistence failed and events should be discarded <<Interface>> EventEmitter void deliver(Collection<InstanceView<?>> data); void apply(Collection<InstanceView<?>> data); void drop(Collection<InstanceView<?>> data); EventCollection newCollection(); void close();
  21. 24 Integration Examples JBPM-CAMEL implements the following PAM Listeners and

    EventEmitter and provide camel integration end point for any external communication like Kafka, jms, database REST etc… ▸ ProcessEventListeners ▸ TaskLifeCycleEventListeners ▸ CaseEventListeners ▸ EventEmitter http://mswiderski.blogspot.com/2018/11/jbpm-empowered-by-camel-t o-integrate.html
  22. 25 Other ideas ▸ BPMN End event vs. Terminate event

    a. Use wisely the Terminate event ▸ ▸ BPMN inclusive and exclusive gateways a. use a default sequence flow ▸ Use a timer intermediate event with an event gateway ▸ Deadlocks when synchronizing paths ▸ BPMN is not a portable notation a. Besides modeling, BPMN requires an implementation effort ▸ RHPAM is not a database (system of record) a. Keep reference data in a dedicated system of record ▸ RHPAM is not a job scheduler a. Avoid specific date and time conditions b. Avoid Timers with very short duration (< 30s) ▸ Process Modeling Naming Rules
  23. 26 Optional section marker or title Divider title limit to

    two lines Quick tip Try right clicking on the photo and using “Replace Image” to insert your own photo. You are also welcome to use this photo. Optional supporting copy. Lorem ipsum dolor sit amet, consectetuer adipis elit, sed diam nonummy nibh euismod tincidunt ut laoreet. magna aliquam.
  24. 27 To explore On top of that foundation I created

    the WIHs (and some additional logic) to be able to use those Camel routes in a WIH. This the stuff I added to it: https://github.com/apache/camel/tree/master/components/camel-jbpm/src/main/java/org/apache/camel/component/jb pm/workitem This is a demo repo that uses it: https://github.com/DuncanDoyle/customer-onboarding-jbpm-camel-demo Although I think that codebase misses the actual service that it tries to call .... Example routes defined here: https://github.com/DuncanDoyle/customer-onboarding-jbpm-camel-demo/blob/master/src/main/resources/camel-routes. xml https://github.com/DuncanDoyle/customer-onboarding-jbpm-camel-demo/blob/master/src/main/resources/META-INF/kie -deployment-descriptor.xml#L15 That's the WIH config And a CamelContextBuilder that I needed to enable the REST DSL (I think): https://github.com/DuncanDoyle/customer-onboarding-jbpm-camel-demo/blob/master/src/main/resources/META-INF/kie -deployment-descriptor.xml#L23