maandag 8 mei 2017

Oracle Process Cloud Service - Decision Model Notation part 1


Recently, Oracle Process Cloud Service (PCS) has made another major step forward through the addition of a whole new way of dealing with business rules. This brand new Decision Model Notation (DMN) feature is developed seperate from the actual processes and deployed as a microservice, so your decision models can be reused and everything is nicely loosely coupled. I like it.

What I also like about DMN is that it's much more (business) user friendly than the rule engine from Oracle SOA Suite, which was used until now. While it was performing well and somewhat agreeable for technical users, business users were often lost and leaving the business rule modelling to developers. With this new DMN feature, this is no longer necessary. Business users will be able to do much more, if not everything, themselves and actually enjoy the experience!

I've decided to write a series of blogs about the different types of decision models that can be created and how to use them. But first we need to turn it on.

Getting Started

When you're in the home screen, click on your login name in the top-right corner and choose 'Administration'. On the Admin page, go to 'UI Customization' and tick 'Enable DMN in Composer', then Save.

Now you're ready to go! You can go back to the home page now, click 'Develop Processes' and then under Create, you will have the option to create a New Decision Model. As you can see, these Decision Models are seperate from your normal PCS applications, but you can call them from your processes. Once you have created your Decision Model, your interface will show you Services on the left, Input Data on the right and Decision Models in the middle.

Input Data

The objects and the left and right can be expanded. Here's a brief explanation of what they contain, starting with the right: Input Data. When you expand it, you can see two options: Input Data and Type Definition. In Type Definitions, you can setup complex types for your input data, like lists or elements that contain attributes. Types can also refer to other types and so on and so on. It's pretty much a declarative way to make an XSD.


In Input Data, you can then refer to these Types, but also create strings, numbers and other basic stuff. In this case, I choose to make a SalesOrder, referring to the SalesOrderType I've created. This Input Data is obviously very important, because it will be the facts in your Decision Model and defining the interface of your Service.

Decision Table

So, now we know how to turn on DMN and how to create Input Data. Now let's create a simple Decision Table to make it work. Just click on the Blue + next to Decisions and choose Decision Table on the right. Since my Decision Table will decide the approval level needed for the Sales Order, the output will be a simple string value.

Once the Decision Table has been created, you obviously need to fill it. You start with Enter Expression on the left and just type the first letters of your Input Data object. DMN will suggest automatically what you want and you can just select it. In this case, I wanted to have SalesOrder.TotalAmount as input, but oops... I forgot to add it to the Type! No problem, you can always modify your Types later and the changes can be used immediately. Now we can enter our rules, which is also very nice and declarative. It could look something like this:

Absolutely no coding is necessary! To test it, you can use the test button in the top-right corner (the blue play button) and the test interface is very easy to use. Once you're satisfied, save your work.

Creating a Service

Believe it or not, creating a Service is even easier. Expand the menu on the left, create a Service, give it a name and drag the Input Data and Decision on the Input and Output fields. It will generate a REST Service and will give you the URL, as well as request and response payload when you click on Payload. Obviously, you'll have to fill in the data yourself, but all the types are described, so it will be very easy to use. Now you're ready to deploy, but the runtime aspects and calling the Decision Model from a process we will save for a later blog.

Conclusion

Oracle has created a significant improvement in Decision Modelling with their DMN-based feature. It's easy to use, business friendly and allows for fast development. Further blogs will get into more complex rules, different types of rules, calling decision services from processes and the runtime environment.

Geen opmerkingen:

Een reactie posten