Slide 1

Slide 1 text

1 Destroy wrong beliefs and run real processes Donato Marrazzo Principal Specialist Solution Architect Business Automation KIE Live 38

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

3 Huge processes ▸ When a process has more than 20 / 30 tasks is hard to understand ▸ Error prone ▸ No clear status

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

8 Abusing event sub process ▸ Many event sub processes change the execution flow ▸ The logic is fragmented and confusing

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

12 ...and remind: many others antipatterns exists!

Slide 13

Slide 13 text

13 Order Management Running “Real” Processes

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

15 Optional section marker or title Process and data

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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)

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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.

Slide 20

Slide 20 text

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?)

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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 <> EventEmitter void deliver(Collection> data); void apply(Collection> data); void drop(Collection> data); EventCollection newCollection(); void close();

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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.

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

28 Web UI Backend µService RHPAM Domain DB