Why this interview?

Matteo Mortari is a Senior Software Engineer at Red Hat, where he contributes in Drools development and support for the DMN standard. In this interview, we try to find out more about his work in the process automation field.

Here there are some quotes I found particularly interesting:

I hope that people can realize that there is a lot of things that they can leverage from these rule engine and process automation in their own project, nothing taking away from describing DSL and the languages parsing.

Now with these DMN standards, you can really describe end-to-end all your process and all your decision management activity. This is something that I find very valuable, because it is a way to describe how you make up decisions with decision tables, and other visual notation that in the standard are called “boxed expression”. And with a language that is called the FEEL, that stand for “friendly enough expression language”.

Now the evaluation of the risk is not done with a decision table that an analyst with experience has done. It’s really made up from a machine-learning predictive model that was produced by the machine-learning process, which is based on the data that the company or the business somehow have collected throughout the years, and all the data that are relevant for doing the predictive model. 

What we are trying to contribute and to help, to best support, is how you take that predictive model and you deploy it into production. So to give all the tools and support needed to be sure, “Okay, it’s performing well, it’s performing as we expect.” And not something that is just thrown away and you hope for the best.

When you think about microservices, it’s very important that you have the framework that supports you as best. This is important because you can use Drools, DMN, BPMN in a microservices oriented way. There are really many ways to do it, and we’re building together a very interesting platform where we had people that say before maybe they were not so fancy of the big monolithic way of doing these kind of things. And they are really excited and happy, as we are, in order to bring this to this new era of the cloud.

You can find the resources related to this interview here:

DEMO: Machine Learning + Decision Management (video link): https://www.youtube.com/watch?v=EVXp2q_8yFw

Drools featuring DMN support: https://drools.org/learn/dmn.html

Learn DMN: http://learn-dmn-in-15-minutes.com

Kogito: http://kogito.kie.org/

TrustyAI introduction: https://blog.kie.org/2020/06/trusty-ai-introduction.html

TrustyAI aspects: https://blog.kie.org/2020/06/trusty-ai-aspects.html

Federico Tomassetti: Hi Matteo. Thank you very much for joining us.

Matteo Mortari: Hey Federico. Nice to see you again. And thank you for having me today.

Federico Tomassetti: Yeah. Very happy to have Matteo today, because Matteo is working at Red Hat on process automation and Red Hat has several very important projects in this area like for example, Drools or jBPMN and also they’ve recently done some interesting work on the DMN standard, so they’re going to tell us all about this stuff. But can you please start by telling us something about yourself?

Matteo Mortari: Absolutely. I’m Matteo Mortari. I’m a software engineer, I’m based in Italy today, these days for like everyone I guess, around the world working from home, but I’ve got a little piece of the office with me at my own house. As you mentioned I work for Red Hat, and specifically in the process automation. We have several kind of product based on popular open-source project, you named a few of them. Drools, which is a free and open-source rule engine. jBPM, which is an engine that execute BPMN, so process definition files. OptaPlanner for constraint optimization, and more recently we are starting a couple of more projects, one is Kogito that is adding cloud-native capabilities for the projects that I just described. And Trusty AI, which is an initiative that tries to bring some of the explainability tracing and these capabilities for augmenting all these platforms with the things that you would really need when you put machine-learning into production. So these are the project that we work with. I work more on the Drools side of things, and specifically the DMN support that you described.

Matteo Mortari: And yeah, it’s a pleasure to be here, I follow your communities with Strumenta and I think there are really a lot of common grounds or point of contact between what we do in the support of the standards, and what you do sometimes in the community of Strumenta where for instance, you want to define a DSL for a specific business or company. So it’s a pleasure to be here, because I hope that people can realize that there is a lot of things that they can leverage from these rule engine and process automation in their own project, nothing taking away from describing DSL and the languages parsing.

Federico Tomassetti: Yeah, I think there are definitely a lot of commonalities. I mean, earlier today I was speaking with a client, they were discussing about combining BPMN with DSL so maybe later we will discuss about this? So yes, you have described a lot of activities that Red Hat is doing, but can you tell us a bit more about what you are specifically interested into?

Matteo Mortari: Absolutely. So actually, here, just for a little fun, when I graduated from engineering university, part of my thesis was to use a rule engine. And this is where I actually stumbled upon Drools, the open-source project in the first time. Then I didn’t start working as a software engineer just out of university, but I kept an interest on these topics. And a few years down the line, I started to use Drools as an open-source user. So I was working for another company and we were making use of Drools, the open-source project. And little by little it started that you know, you help by finding a reproducer or finding, spotting little bugs.

Matteo Mortari: And then I started to contribute even more, even more and basically this is part of what led me to Red Hat. Because now, okay, when I find bugs I’m also responsible in trying to fix them for as much as I can, of course. I’m not working alone in here actually, it’s really a pleasure to be working with a lot of really esteemed colleagues in Red Hat, and in the community. So what I like about Drools is that yes, it’s a Red Hat sponsored project, but we have also a lot of interesting contribution from the community, and also from the users to the historical contributors.

Matteo Mortari: Specifically, my interest in the more recent years, has been the support of the DMN standard, that stand for decision management and notation. It is a standard by means, like BPMN, it’s a formalism. So we as Red Hat, it’s not us that we came up with this standard, there is a consortium, it’s called the OMG, you can find all the information on the OMG.org website. And that is a consortium, basically, of companies and relevant interested Companies, and subject domain matters expert. And what is done there, is the standards are defined, but not the implementation.

Matteo Mortari: So what we do, is that we [Red Hat] provide support for these standards. So it means that, basically there are a lot of companies that if they support the standard to the conformance, means that what you describe using this formalism, can be executed let’s say on the Red Hat engine, or also on other engines. This could be thought as somehow similar to using a programming language. If you use Java to write a program, then you can expect that the javac compiler, that is either is provided and okay, it’s one but actually, you agree on the semantic of what a Java program means. So that is the standard that we provide.

Matteo Mortari: This decision management and notation, modeling and notation standard, DMN, it’s a way to describe business rules, and how you actually come up with a business relevant decision, hence the decision in the name. It is a very companion standard I would say to BPMN, in the fact that they try to really, together, to bring all the notation that you need to describe your business process and your business activities with decisions. So a typical example.

Matteo Mortari: You start with the BPMN process that describes, “Okay, I start an activity, I do a certain type of things, and then I do something else.” At a certain point before today, you were really meaning to take a decision at a certain task. So what you can do now with DMN is something that before in BPMN, you could only do it with basically just proprietary notation or proprietary language, that was, “How do I come up to decide if I have to do a certain sub-task or another one?”

Matteo Mortari: Now with these standards, you can really describe end-to-end all your process and all your decision management activity. So this is something that I find very valuable, because it is a way to describe how you make up decisions with decision tables, and other visual notation that in the standard are called “boxed expression”. And with a language that is called the FEEL, that stand for, friendly enough expression language. And here, okay, there is a lot of insider jokes, like if it is really that business friendly because… Yeah, it has the identifier support of space in the name, and all the weird characters.

Matteo Mortari: But let’s say, from people with a programming background, we can be sometimes, it can be a bit strange. Especially because you find a lot of very funny interaction sometimes in the system. But yeah, this is one part. And of course, this is one of the standard that we support in Drools. But Drools remains a forward chaining and backward chaining rule engine. So you can still use Drools rules to describe more complex scenario, especially when it is about knowledge representation and reasoning. So you can define what we call “technical rules” that are more like… They look a little bit more like code. That you have a pattern matching with the rules, you say, “When I see a certain type of object with certain type of constraints, then you perform some action.”

Matteo Mortari: And also it can do Prolog style backward chain reasoning that basically it’s through query, let’s say, “Okay, if I needed to know who is the father of John?” Then you describe your facts in the working memory, and then you can use queries to basically reason in a backwards chain fashion. Similarly to Prolog on how you would come up with your goal, basically.

Federico Tomassetti: Yeah. Prolog sounds already a bit more intimidating that FEEL… Yeah but-

Matteo Mortari: Yeah, absolutely. And though it’s like… Prolog something on its own, so of course here is just an example to an analogy. I have to say, from my limited experience before joining Red Hat and really making use of it, I can see benefit of using all of these standards. So technical rules, DMN for decision description, and BPMN to describe your process. Especially the part where you might be more interest to use DMN to model how to do your decision with your domain expert, and BPMN too because they are visual standards. While DRL I would do it for more technical rules, and especially when the knowledge representation and reasoning that you would like to formalize is something that is for instance, maybe not done with DMN. That is, DMN is always represent a stateless function. So it’s similar to that, it’s always stateless, you’d say, “Okay, given my certain type of data as an input, then I will make my decision.” But it doesn’t really handle state, or how you would like to augment some facts with more information.

Matteo Mortari: So of course, you can always simulate that, but for that I would still keep to Drools, because it has the concept and the semantic of stateful reasoning, so you can say, now you know something and then maybe something later you want to retract fact from the working memory say? Or maybe something that before it was truth, it’s not truth any longer? You can do this kind of reasoning with Drools.

Federico Tomassetti: … We have named a lot of different technologies that can be used in the contest of process automation. But maybe could be useful for some listeners to make a step back and explain a little bit about what is process automation, what it can be used for what are examples of applications?

Matteo Mortari: Absolutely. Actually, maybe what I can do is that I can share just a couple of slides with you?

Federico Tomassetti: Yes, that would be great.

Matteo Mortari: Instead of me talking, then we can use it to support the discussion. It will be not a crash course on DMN, but I hope that this can give an idea about what you can do… What the standard is, and what you can do with it.

Matteo Mortari: So here you should see… I’m just using a few slides from a previous presentation, and what you see here, it’s the de facto, introductory example for DMN. Here the use case is when you want to decide if you want to allow automatically a loan to the prospect customer that you have coming here? So here we can see that we have a graph, a direct acyclic graph specifically. And this is one of the main concept of DMN, it’s the DRG, the decision requirement graph.

Matteo Mortari: Basically, what you are describing here are your input of the decision model, are the boxes with the round corner. In the case here is the application, that the prospect is coming to you with the data that can be the name, the age, the salary that this person has, how many basically money he has in the bank? And what you want to do is, you want-

Federico Tomassetti: Sorry, just to… Here, the application, it’s not a program, the application is someone submitting, making a request, in a way? Yeah.

Matteo Mortari: … Absolutely. Sorry, also this is a very business domain jargon. Because in the loan verticals, so in the finance service industry, these are usually called “application”. Thank you for reminding this to me, because for me now I take it for granted. But for an agnostic reader or a listener, may be not so obvious. So thank you for specifying this. And this is the input data, so the input values that you have for your domain model. You can have also more than one, and this can be structured data as well.

Matteo Mortari: So think about this as the input parameters of your function. And what you will do with this DRG, you specify all the decisions and sub-decisions that you can take while evaluating this model. So in this case we can see, and you basically follow the arrow, what we can see here, if I take it from top to bottom, we can say, “Okay, Routing is the name that I’ve given to the final decision. It is the final decision because there are no longer any other arrows coming out of these decisions here.”

Matteo Mortari: But to decide here about something, we need to know something more before. And what we need to know is actually two sub-decisions. One is called the “application risk”, and one is called the “eligibility”. So these are mainly sub-decisions, and what you have with the clipped cornered boxes are business knowledge model node in DMN terms, it basically represent function.

Matteo Mortari: So what we can say about this graph? We can say, “Okay, the customer comes. He gives me his data. And what I will do is that I first, I need to compute two risk. One is the application risk, giving some scoring. And if it is eligible, depending on some policy. That can be the policy of the bank or the credit institute.

Matteo Mortari: And then once I’ve decided these two sub-decision, then I can make the final one. So this is how this graph works. Usually what you have behind each of these boxes are decision tables for the most part, or you can have what in DMN is called “boxed expression”. Other way that you can define, I don’t know, something like mathematical formulas, or you can describe what would be similar in programming language, like some statement blocks. And what you do basically with all these graphical and tabular notation, is you describe your policies, you describe how you want to make basically your decision.

Matteo Mortari: So here, just a decision table, I think most people can immediately understand how this works. Basically you have some input columns, there are the one on the left, and here you evaluate some of the constraint that must be met in order to come with some result. So every time that you have some decision table, you check which are the actual values? If it is an existing customer in this case, and how much is the risk score? And you decide how you want to compute the value for the output. And you can compose all of these boxed expressions, so visual notation and decision table notation to really describe your policies, and all your business relevant decisions.

Matteo Mortari: What I believe it’s really interesting, and I just keep it here on the slide, is that how these fit into the existing context where maybe people are more familiar with BPMN. So in BPMN normally, you describe the start of your process, and here we can see there is like a human task where we need to collect the applicant data. And then we perform a task, which is decide if to accept? Or you need to decline the request of the loan. This is a very simple and trivial BPMN definition.

Matteo Mortari: Before DMN, how you dealt with these tasks in every system? It was different. Because for instance, in jBPM you use Drools. In other platforms you may have your own rule engine and how you come with this final decision. Because here at the gateway of the BPMN, you need to decide if to go with the accept routing or the decline routing?

Matteo Mortari: Now with DMN, you can actually combine the two diagram together. And you can say, “Okay, here now, I go to use a DMN model.” So you use the same business process variable, you can be the input of your model. And as we’ve seen before, you have all the power that you can do with BPMN and DMN to describe how you do your policy.

Matteo Mortari: Here it’s a very simple example using a loan application. And these are the most common example that you will see working actually in the wild right now, although I have to say there is really a gain of interest also in other verticals, like healthcare and other type of domains. But I hope that this even being very, I would say, a trivial and very synthetic way on how you decide for, if to provide a loan or not, using these standards I hope that can give an example on how these standards can be combined together.

Federico Tomassetti: I think it’s very interesting, I want to see if I understood it correctly, maybe summarize for some people listening. So we had a BPMN for a number of years, and it was perfect for defining processes, but in these processes we needed to take decision. And basically there was not a standard way to describe these decision. So every toolmaker was permitting to specify decision in different ways, now instead we have DMN which is the standard, so we have a standard way to represent decision. We have also display that we can… decompose decision in single steps.

Federico Tomassetti: So for example, we can have for a complex decision, a sub-decision be taken by different departments and combine. So you were evaluating for example the risk and eligibility to take the final decision. And then there are ways to define these decisions which are compatible with DMN. For example, using decision tables or FEEL, this expression language, is that right?

Matteo Mortari: Absolutely. And maybe to that, so it’s a very good overview, the one that you’ve taken, and is very truth. Another perspective that you can use to reason about these standards, especially for those with our programming background, is that BPMN standard is more procedural. So it’s something like a procedural language, you do this, then you do that, then you have an if/else, the gateway, so you decide if to go one branch or the other?

Matteo Mortari: So BPMN procedural. Similarly, you may have some declarative language, like I don’t know, SQL. So SQL you don’t have the series of steps, so SQL you define, “Okay, this is all that I want based on some constraint.” So SQL declarative, and similarly DMN is very declarative, as you said. You can specify your main goal, and then how you come up with that final goal. It’s also another interesting perspective for those listening in that are more from a programming background and would like to understand how to apply, how to reason about these standards.

Federico Tomassetti: Okay. And so can I take other technologies and make them fit into the DMN standard, for example if I need to take one decision using artificial intelligence, can I find a way to make it fit in a box and use it into DMN?

Matteo Mortari: Absolutely, and it’s a very hot topic, I would say, these days. And by “these days” I mean these years. Actually, I’d say I would like to stress one point. You use the term “artificial intelligence” and indeed here we can be even more precise. So we can really plug in what could be machine-learning predictive models inside of DMN. Because normally, when we speak about artificial intelligence, what sometimes the people mean is really machine-learning, which is the hot topic of these days.

Matteo Mortari: So it’s important to remember that a rule engine like Drools and the support as well for this DMN that uses the same algorithm behind the scene, derives from Rete and in Drools, we have a specific algorithm that is an optimized version of Rete called Phreak. And the rule engine, or production systems, are more what I would call “classic AI”. So how you make knowledge representation and most importantly reasoning on the knowledge representation.

Matteo Mortari: Within AI, so this is a one that, I would say the classic part. So of course the tools have not been rusting, so the DMN, it thought from the ground up to integrate with machine-learning predictive models. So here, we can think about regression models, we can think about clustering, we can think even about computer vision, we can think whatever we want. There is a standard, again another standard, but again it’s not just one of many, it’s really the most famous, and actually it’s been available for many years called PMML, predictive model markup language. It’s not made by the OMG consortium, it’s made by another entity, but is a still valid way to represent predictive models.

Matteo Mortari: Here it’s a very key point that I would like to stress out, in a very highlighted way, is that using PMML doesn’t mean that people doing much learning activities need to change their tool. Not at all. People who do data science, for instance, they will use, I don’t know, TensorFlow, R or Python, whatever framework in Python. I’m sorry I’m not uber technical about the most available frameworks nowadays for machine-learning. But there are many availables.

Matteo Mortari: Most of them, they do support the export on the PMML standard. So the PMML, it’s only a way to serialize your predictive model. So data scientists will continue to do their job as they do today, we are not talking here about changing the way they do machine-learning. But their activity, instead of persisting the result which is the predictive model in a proprietary format, we suggest them: export it with a PMML, there are several executor available in both the proprietary and in the public domain, we also support PMML execution as well in Drools.

Matteo Mortari: And what you can do now is that you have persisted your predictive model with an open standard. So you can integrate it in Drools, and basically what you can do in DMN, you can say, “Okay, we have seen in the example model there that at a certain point one sub-decision needed to evaluate a risk, the risk of the client, if it is a good client or a bad client.” And normally here, it was done analytically with decision tables before all of these tools were available with machine-learning. But nowadays, really data is the new oil for the company, that is why machine-learning is so popular for them.

Matteo Mortari: So what the standard allows you to do, is that instead of using a decision table, you can plug in a predictive model that is described and persisted with a PMML format. And you can execute it. So now the evaluation of the risk, so if it is a good customer or bad customer is not done with a decision table, that an analyst with experience has done. It’s really made up from a machine-learning predictive model that was produced by the machine-learning process, which is based on the data that the company or the business somehow have collected throughout the years, and all the data that are relevant for doing the predictive model.

Matteo Mortari: So there are many standards in this area that are very relevant to all these process automation. Basically, automating the business process and the business decision that the business need to do in its day to day. And PMML is one of them. There is also another one that it’s called CMMN, which is for case management, which is what I would say, I’m simplifying here a lot but it’s a very relaxed way to describe a process more in a case fashion where you cannot specify very procedurally oriented, “Okay, do this and then do that.” It’s more relaxed.

Matteo Mortari: But really what I am experiencing that it was not the case of a few years ago, is that there were not this many open standards that allow you to describe all of this end to end. So I think this is really valuable, and of course, we invite everyone to check them out. We have also… We are working on the open-source, so we can be even reachable and to answer questions, so I really invite people to check them out, especially in the integration between machine-learning predictive model with PMML and DMN, because I think this is a topic that is becoming really, really hot these days.

Federico Tomassetti: Yeah, but I think it was surprising for me, when I learn about this technology from you how flexible this is. Because now I can start defining a process, maybe I can maybe represent a decision initially with a simple decision tables, because this is something that I know that maybe my organization will be using it for a while? But later, when we develop some machine-learning solution, we are able to plug it in and replace our simple… Improve on decision table with something more advanced, and still fitting? And so it gives me the idea of something flexible that can also keep up with possible solution for making decision that will appear later.

Matteo Mortari: Absolutely, and what is also important to say here, is that when you do… the put-into-production of all these models, it’s very important to perform tracing, auditing, and here really opens the door to… Actually, sorry, I’m just maybe going ahead of myself here, but this is a very good moment to maybe stress out about one of our project that we didn’t describe so far, which is Trusty AI. It’s an initiative within the same people, basically the same group, and it’s a set of capabilities indeed to support tracing, auditing, also the provenance of the data, it’s very important when you have these business decision process, but also how you perform the machine-learning, and how you come up with a predictive decision?

Matteo Mortari: Because nowadays with the GDPR and all of these legislations, the company and the business, it’s really liable to say how… In front of the law it needs to describe how you perform certain business action or business decision. So we have this initiative called Trusty AI. Which provides all this set of capabilities, so you might be interested to know, okay. Tracing and auditing is the, I would say, the most trivial, so people that are your listener can really well understand why this is trivial but also really needed. So we have this capability throughout the platform.

Matteo Mortari: There is the provenance information and this is very relevant, it cannot be underestimated when you put this into production. But especially as well about explainability, which is a very hot topic nowadays. We don’t go into the details about the algorithm per se, so of course we support the plugin with the LIME or Shapley algorithm that are, I would say, some of the most famous descriptor for basically explainability of predictive models.

Matteo Mortari: But what we do really aim for with Trusty AI, is to give all the set of capabilities to support explainability for the end users. So let’s say that in this case, we have seen the decision about a loan, if to give the loan automatically, or to reject it. So in this case, what Trusty AI can do, is it can tell you, “Okay, this decision was come, mainly because these are the most relevant factors that contributed to this decision, for let’s say the predictive models, and here it can be LIME, Shapley or anything else that can be relevant with a counter-example, something like… If only this value was just a little higher, then we would have approved it.” So this is part of Trusty AI.

Matteo Mortari: But also as well, it’s all the tracing back. Because you can say, “Okay, and this value was here in the decision models because it came from all these inputs and sub-decisions, and this decision model was the one that was evaluated because it was part of the business process that started with something else.” So here it’s something that instead of people are having to do it themself on their own platform, we provide really the capability with Trusty AI.

Matteo Mortari: And I think it’s very interesting, this topic, on the specific use case that I mentioned to you right now, we have partially in our video demo that shows all these BPMN, DMN and PMML in action, so maybe I will send you the link and you can insert it in the blog post? Because there that can give the people some ideas on how you can integrate these standards, and use some of the tracing and monitoring of these decisions.

Federico Tomassetti: Yeah, I think it’s a very important topic. You reported that is, the new regulation like GDPR force company to explain why a decision is taken, so if you go to a bank ask for a loan and it’s rejected, you cannot just say, “Because the computer says so.” But they should give you a reason to ensure there was not discrimination for example. But I think it’s also useful to verify that the system is working correctly. So maybe a human being can double check if there are some corner cases that are not so well handled by the machine-learning?

Matteo Mortari: Absolutely, and also when you started towards… So basically, Trusty AI and all these capabilities… We’re integrating it into this platform because what we found is that people are looking indeed into launch into production. Of course, BPMN, DMN, but especially with machine-learning, if you treat it only as a black box, then really let’s say, it gives uncomfortable thoughts to the people who are pushing the button to send this into production, and especially because they have business impact. We don’t have to forget that. So there is really this area that is a bit neglected, maybe? That I see outside in the wild, because of course, doing the machine-learning activity and coming up with the predictive models that does your prediction is the most fun. I can totally understand.

Matteo Mortari: And here, what we are trying to contribute and to help, to best support, is how you take that predictive model and you deploy it into production. So to give all the tools and support needed to be sure, “Okay, it’s performing well, it’s performing as we expect.” And not something that is just thrown away and you hope for the best. Of course, this cannot be done! So these are the part that we mainly focus on. And it’s done really at different levels, from a more technical level to the more business relevant KPIs for instance.

Matteo Mortari: So when you do tracing and auditing, you can really immediately do some business relevant dashboard to really make sure that your KPIs are really within the range that you expect. The video that I mentioned to you about gives some insights on how you can do that with the tools and the standards that we’re talking about.

Federico Tomassetti: Good, I think it’s a crucial piece to make sure that the humans stay in control, we’re just not at this machine-learning overlords taking decision over us! But I think there are a million things that we want to discuss, and we have 15 minutes, so we may need to make the best use out of it. I was thinking to ask you about the typical users of Drools. Do you think it’s a good topic?

Matteo Mortari: Absolutely. So as we’ve seen, these are standard that you can use for describing business, but also as well any kind of knowledge representation and reasoning. So the main reason why you would like to use a rule engine, is when you have a software system that need a way to upgrade on how you perform some decisions? Or if somehow you want also as well to interact with the domain expert.

Matteo Mortari: So say that you have a domain expert that can tell you how he thinks about a problem, how he describes how the business works? You could, as a software engineer, write a program that implements what the business analyst have told you, and the difficultly that you will have is how… To make sure first of all that you’ve coded everything that he asked you. And to verify with her that actually what you implemented really address her requirements. So there is a lot of testing involved, and this is somehow difficult because the business analyst is not technical about code, and vice versa.

Matteo Mortari: So here is one aspect why you might be interested in rule engine, is that it provides you several tools, DMN is one of them but we have also decision tables, we have also DSLs, that you can plug in that will actually translate into rules for the rule engine. So it gives you a set of tools that you can use as a common ground, so you can bring the business analyst and the developer responsible together, sort of like on a whiteboard, and to describe with a higher semantic language or visual notation your business requirements. And then put it in the production.

Matteo Mortari: Another very interesting, this is more technical, is when you update these rules, or your requirements often. So instead of coding a lot of very branchy if-then-else that becomes quickly a spaghetti code, the rule being declarative, DMN, technical rules of DRL, are all the declarative language. So similarly, you don’t have to have this spaghetti of procedural code. But you have a declarative way to describe your problems and what is your knowledge, and how you reason on top of this knowledge.

Matteo Mortari: So I believe these are the main interesting point where you would like to use a rule engine. There are some cases where it’s more stateless in nature, and these can be a good fit for DMN because as we’ve seen, you come with some input and you evaluate some output. Then new input comes, and you evaluate some other output. There are some other use cases that are what called the CEP for complex event processing. And this is more what we do with Drools in technical rules.

Matteo Mortari: And it is about reasoning about temporal. For instance, when you want to detect some fraud detection, sometimes nowadays it’s a lot of machine-learning. But there are still a lot of business analysts that will tell you, “We definitely want a system that when a certain type of events happen, and a certain of these event happen before or after a certain type of other event, and there are some constraint about the value between these events? Then we definitely want to emit a warning of a fraud detection.”

Matteo Mortari: So you don’t want to describe it with a machine-learning. You want to describe it with a declarative rules, so you can use Drools rules to write these declarative decisions. And especially the CEP part is what I think is one of the most powerful, because you will keep a sliding window basically of events in your memory, and you will reason on these complex event. Of course there are different way that you can apply it for I would say, micro sliding window or bigger sliding window, it all depends on the domain and the actual problem that you are defining.

Matteo Mortari: But based on my previous experience, these are, I would say, the most two interesting ways that we like to use a rule engine for this scope.

Federico Tomassetti: So for example, someone who is an analyst but is not a developer could use Drools to define rules, you’re saying, time-based like for example say, “Okay, if someone withdraw exactly the maximum available on this card, one minute after midnight and immediately withdraw one minute before and then after the maximum amount?” Maybe we want to be worried about that?

Matteo Mortari: Exactly as you said. And these of course, here it’s more let’s say… If you had to write this with code, then it would be very difficult because you will need to do some management of collection, then you need to select from collections the two events that could match, then you may need to verify the match. So doing that procedurally it’s very complex and very difficult to have an analyst to check it.

Matteo Mortari: But with a rule, it’s very simple. In your case, you say, “A rule, something strange between midnight.” You can even give it a meaningful name for the business, and then you say when, and then you say, “I have withdrawn of a certain amount one minute before midnight.” It’s one minute before it’s really written with these terms, and then you have another which say, “Withdrawn one minute after then.” And then you make the other…

Matteo Mortari: And of course, these are technical rules, but you can also as well do DSL that basically produce these kind of rules. So for the business that really do not want to touch the technical rules at all, or there are not very comfortable in dealing with that directly? You can offer DSL that basically are like template for rules. And basically the end result will be the same.

Federico Tomassetti: Okay, so in these scenarios the developer prepared the DSL and put the analyst in the position to define a way that the business rules will… Okay, it makes sense. Are the user of Drools different from the user of BPMN as background? Do you think one of the two is more technical?

Matteo Mortari: I think that there are a lot of overlaps. Also there are a lot of use cases where you might be interested to use BPMN alone, even without any Drools or just very little, something like you want basically just to make sure you have formalized your business process. There are very different use cases and depending on the perspective, just to give you one example.

Matteo Mortari: We talk a lot during today about the finance and service industries, but I’ve seen a lot of interest as well from the healthcare domain. So there what you have is that they use the BPMN and DMN as a standard to define clinical pathways. But again, their use of the standard, it’s of course not to a replacement for a doctor, but just to ensure the quality of the process in their domain. So there what is really powerful about the standards is that the user, it’s really the doctor who benefits the most in making sure, to use the system, to confirm the procedure or the pathway that he is performing with the patient. Meanwhile, the institution and especially because it’s liable a little maybe with the insurance company and so on, can use that as a way to support the doctor in her activity, and basically to make sure that okay, yes. He performed that exam because indeed it’s part of our quality, and our processes inside of the healthcare institute, it is part of our clinical pathway that we want to follow with our patient, basically.

Matteo Mortari: And you can use this tool to support, as a proof for your decision. Which are ultimately, especially in this case, it’s not a way… So to be clear, and maybe for a more of fun, is we are… They are not used to say that Google is becoming your new doctor. Because of course, this is not totally the intention! Really, tools to support. And as with any technology, this can be really powerful in order to make sure that basically the doctor later is not called-in to justify further, but everything is structured following these procedures, is the standards. And so basically it can be described and justified in the most, I would say, relevant way.

Matteo Mortari: So here it’s really empowering for anyone. Basically, in this case the doctor has a tool that support, rather than scouting around in a lot of paper, the decision. It’s really a tool that supports, and can even feedback if for something like the procedure, which normally is implemented in Word document, so it’s like you need to find a reference in a text. So here you can really describe it with a tool that allows you to automate what you describe as the business problem. And the doctor can even feedback to say, “Here, something is not going right.” Or, “These are standards, our clinical pathway needs to be updated.”

Matteo Mortari: Meanwhile, the institute can have insurance that the quality of their process in their field, it’s really followed it through. So instead of having a lot of document that the doctor needs to read and make sure to implement, here is a tool that is more supportive of this update activity. And of course, is a guarantee for the patient, because of course we can be even more sure that the pathway is followed as it is described, basically, by the healthcare institute. So there are a lot of, I would say, applications.

Matteo Mortari: One of the most interesting one to me that is also like a cross pathway as well, is for natural language processing, there their’re using Drools rules. Because they were describing the rules of the Italian grammar, which is very difficult, especially for me, at least! Being Italian, but sometimes it’s very… There are some very corner cases, and of course actually can be very well described with Drools rules. And they use it as a support for the natural language processing. So this was one of other interesting aspect of how you can Drools.

Matteo Mortari: It’s very flexible. You can use it really for doing a lot of things. And being open-source, it’s actually available for even everyone that has a little pet or DIY project that will like to integrate it? I welcome everyone to check it out.

Federico Tomassetti: I think you said something that is very important when you were talking about these healthcare example that these tools are there to support the expert, not as a way to replace them. And I recently read this book, The Checklist Manifesto, who has been written by a doctor. And it was explaining how providing simple checklist to doctors helped them solve a lot of problems. Of course, not because they lack the competence to do their job, of course they’re great professionals. But they are always under a lot of pressure, they are doing one million things at a time, and so having a tool that support you doing your job is not diminishing your value, just a tool to help you reduce the errors that we all do. And so this is obviously more advanced than a checklist! But I think the principle…

Matteo Mortari: Absolutely, and you couldn’t have said it better, I’m 100% with you in the way that you summarize. I will add something more that I’m experiencing, and maybe here is something that the audience that will be reading this conversation or seeing the video maybe can comment out?

Matteo Mortari: Just as a… I’m a software engineer, so I’m not a expert in other domains, but I see in these papers published, for instance in healthcare, that scoring tables are implemented with different styles all the time. And wouldn’t it be great if instead of having every paper writes the scoring algorithm with its own way, its own style of tables, its own style of formulas… Wouldn’t it be great if instead everyone just attached… Like you can attach data in a CSV format, which is an open standard. You can attach a DMN model, to say, “Okay. Here is directly how I do the computation for my paper of research.” Because really, let’s say in one year that I’ve been just by accident been shown all these papers, every paper has its own way to describe these mathematical formulas or scoring tables, or decision-making things.

Matteo Mortari: Or sometimes it’s even scattered in… The guidelines are really in PDFs that are, a PDF of a PowerPoint. So I think that we as a software engineers, we can really support the people here. I can understand that okay, it needs some learning about the standard, it’s not a very… Simply, you can talk to the computer and the computer will do the things for you. We are not there. But it’s a very, I would say, simple standard graphically. So once you get these couple of concepts about which are your input and your output? It’s very basic. It can really, I think benefit all the verticals, not only healthcare but anyone that is looking to describe in a way that can be not tied to a specific vendor or framework or system, how it make her decision. And basically just be sure that that semantic is captured in the model, and can be executed on any system that will support the standard. This are the goals indeed of the standard, so that’s why we really take good care to implement and to support them.

Federico Tomassetti: Yeah, let’s hope it gets more adoption. But before we close, I wanted to ask about trends that you see in the future. I think we have anticipated a bit one of those, because we have talked about Trusty AI and so this is a big component, but do you see other trends that are particularly important?

Matteo Mortari: Absolutely. The cloud, it’s, I would say a very common trait nowadays. And especially also this year, I think that it has shown really where the industry is going. So we have, within the rules, jBPM, OptaPlanner, and of course also with Trusty AI we have also this project called Kogito. Which is a set of capabilities to really better support all these projects in a cloud-native environment. What I mean by that is that typically, I would say… The classic approach of deploying these rules and processes and DMN decision into production, you add… And here, I will speak more to the computer science and the software engineer out there. Normally there was the so-called application server, or you had a Spring Boot application.

Matteo Mortari: Nowadays it’s more about Kubernetes and sending, basically having these, I would say, simplify here pods in the cloud. So you will really try to strive for having, instead of a big monolithic application, a server which is running all the time and you deploy or un-deploy your application there. What you are striving for are microservices, and potentially as much as possible, stateless competition. Because they simplify a lot of these kind of application.

Matteo Mortari: So what we do with Kogito is to give this sort of capabilities to be deployed in the cloud. So what really allows you to do, is that you can describe still your application by means of business process with BPMN, decision model with DMN and Drools rules. And the Kogito framework, what it allows you to do is that, instead of all that application meant to be deployed on application server, it actually builds a standalone application that can be supported on top of the Quarkus framework, or the Spring Boot framework.

Matteo Mortari: So basically what you will get out of the box is really for instance, the REST point that you can call in order to start your process, and stop your instance. Or take a decision. And how does asset interacts together? Maybe at a certain point, the BPMN would need to call the DMN model to perform the decision? So this is also nicely integrated. With also the monitoring and tracing that we spoke about for Trusty AI.

Matteo Mortari: And yeah, I would say it’s gaining a lot of interest, so if anyone thought, “Okay, those are rules, BPMN is really for big, monolithic things.” I would invite them to think again, and join us on the Kogito community. We are very welcome for all the different setups, so I would invite you to really check this out. Because of course, the business processor needs the persistence layer, but this is like an externalized, it’s obstructed the way. Because of course, business process are stateful. But Kogito provides the capability in order for jBPM when running on Kogito to really have the performance layer in the most cloud-native fashion.

Matteo Mortari: Very important as well, we have the operators. These are really powerful instruments for everyone managing a Kubernetes cluster. So you have that. And of course, everything that you need, I would say in a cloud-native environment thanks to Kogito. So basically, what we try to do, is that you bring your business domain model. And you bring your domain asset, like BPMN for describing the process, or DMN, and with Kogito, we really try to ease your work as much as possible, in order to make it as a standalone cloud-native application.

Matteo Mortari: Will all the tools that are needed, I would say, on the Java layer, but also as well for managing the cluster where these application are meant to be run. So you really, you will see that inside of the Kogito community, us, that we are working on that, we are really the part that we are focused from Drools and jBPM, making sure that it work correctly, OptaPlanner as well. But also as well, the Trusty AI people that are interacting with, and people who are really doing the tools like the operator for instance, in order to make sure that, “Okay, somebody comes, they just deploy your business asset.” So here the focus is really on bringing from that, to automatically generate whatever is necessary in order that your application is now published on a cloud-native cluster, potentially on OpenShift if you want.

Matteo Mortari: It’s really interesting because when you think about microservices, it’s very important that you have the framework that supports you as best. So this is important because you can use Drools, DMN, BPMN in a microservices oriented way. There are really many ways to do it, and we’re building together a good, I would say, a very interesting platform where we had people that say before maybe they were not so fancy of the big monolithic way of doing these kind of things. And they are really excited and happy, as we are, in order to bring this to this new era of the cloud. So this is an important trend, and everybody can check it in the link, I will suggest it, but it’s basically on the kie.org domain, there is the Kogito sub site, and along with the blog you can find all the blog posts where we describe what we are doing, and we hope that we can engage with the people that seems very excited about these evolutions.

Federico Tomassetti: I think, well we have taken a lot of your time, but I think that today you have defined a very complete pictures with every single element that you have described would deserve for hours discussion. But I think that this interview could be very useful for people to get a global picture of what exists, and then they can of course read and explore every single tool from Drools, BPMN, DMN, Trusty AI, Kogito, there are a lot of solution that… Some based on standards, some implementation very useful provided by Red Hat, so I think there is a lot of material to study and explore.

Matteo Mortari: Thank you. And indeed also what I really glad that Red Hat allows us to do it, because we are upstream and community first. Then really we are in the open, building this tool, and actually we are doing it together with the end user. So if anyone is interested, there are very different mediums that people can interact with. There are blog post and video as well, we describe what we are doing and the new features and capabilities that are available. But also as well we have mailing list, and even a chat on… Nowadays we are using Zulip chat. So it’s really… You just need to choose the medium that is most comfortable with you, if you are a user to interact with us. We try to be really as much responsive as possible because for us indeed, we are really active in the open-source and the upstream communities, because this is what we are doing everyday.

Matteo Mortari: And so you can definitely find me there, as well as my other colleagues and we’ll be very happy to hear about your use case, and if you need some guidance on how to implement, or if you had a problem with your project, it’s a way to interact. And actually, just as I here, I’m also the perfect witness because this is what occur to me, I was a Drools open-source user before having the opportunity to join. So it’s really a welcome community, I totally invite people to check out the project, if that help for their business problems or even just their own pet project or DIY project that they do in their own weekends? I think there are many possibilities open with these tools and standards.

Matteo Mortari: And of course again, I welcome everyone to check out our open-source communities and as well also, what I find most interesting are the meet-ups that you, Federico run, because even for us they are very, very interesting. What I’m really happy is that we get all these communities that describe in the open the way they’re working the tools, and how they solve really business relevant problem or computer science problem. I think we are really in exciting times, so don’t be shy to interact because I find all of these communities to be very welcoming. So I invite people to be very active there.

Federico Tomassetti: Good, good. And maybe some of them will become a colleague of yours, who knows?

Matteo Mortari: I don’t know, I don’t know! Things really happen in a very strange way, I reckon we can never, I’m sure you can never say no. Definitely what I found out is that you always learn something. So this is for sure what I can ensure people is that interacting with if you are a… If you’re just, I would say, do the little step in order to interact? Really you will find out most of the people are very responsive in these communities. Of course, we try to be but also in your community and in many others. So you just have doing, the little say, maybe sometimes it’s laziness or sometimes you’re shy. There are many mediums, chart, mail list, forums as well. Just win the little step, and you will find that for sure you will learn something new. And that is the most important, then you compound on that. So this is my personal advice to everybody out there listening, who maybe a bit reluctant to interact, please don’t because it’s very important to join in these communities.

Federico Tomassetti: Yeah, I think it’s a very important message, and I think it’s a good way to end our chat. And thank you a lot for dedicating all the time, and for all the work that you and your team are doing.

Matteo Mortari: Thank you to you and for the opportunity, it was such a pleasure and we’ll definitely see at your meetups.

Federico Tomassetti: Great, okay. Thank you, bye.

Matteo Mortari: Thank you, bye, have a great day.