Rule orchestration

144 views
Skip to first unread message

Bharat

unread,
Feb 13, 2016, 11:27:18 AM2/13/16
to camunda BPM platform contributors
Hi Guys,

A newbie question here.

I have been playing with Camunda from last one week. Product is amazing. It's so light weight. The best thing is I can just embed it in my spring application!

Now I have a requirement and I think Camunda is the best fit for it. We are planning to develop a simple decision engine for our internal needs. We will have bunch of rules and I think we can use DMN for this, however for orchestration of these rules we need some sort of flow controller. I think we can use BPM here for this. So in a high level we will end up with something like this

Only one BPM file -- purely for orchestration
and 4 or 5 DMN files

What I want to know is
1. Is it right approach
2. Is there any example demonstrating this, so I can start from there
3. With this approach is it possible to configure the process to return a JSON/XML (multiple values/elements obviously)

Thanks in advance for your valuable time.

-Bharat

Philipp Ossler

unread,
Feb 15, 2016, 6:52:46 AM2/15/16
to camunda BPM platform contributors, techie...@gmail.com
Hi Bharat,

I assume what you want to orchestrate your rules because they based on each other. So one rule needs the result of another rule as input. Is it right?

If yes, you can model a process with business rule tasks. For example:

See the docs [1] how to use a business rule task. In the example, you need to map the result in a process variable which is used from the next rule.


Can you please descript your 3rd point. What do you want do return?


Greetings,

Philipp



[1] https://docs.camunda.org/manual/latest/reference/bpmn20/tasks/business-rule-task/



Bharat

unread,
Feb 15, 2016, 8:31:00 AM2/15/16
to camunda BPM platform contributors, techie...@gmail.com
On Monday, 15 February 2016 11:52:46 UTC, Philipp Ossler wrote:
> Hi Bharat,
>
>
> I assume what you want to orchestrate your rules because they based on each other. So one rule needs the result of another rule as input. Is it right?
>
>
> If yes, you can model a process with business rule tasks. For example:
>
>
>
> See the docs [1] how to use a business rule task. In the example, you need to map the result in a process variable which is used from the next rule.
>
>
> Can you please descript your 3rd point. What do you want do return?
>
>
> Greetings,
> Philipp
>
>
>
>
> [1] https://docs.camunda.org/manual/latest/reference/bpmn20/tasks/business-rule-task/



Thanks for the reply Philipp. Appreciate it.

Re 3rd point: Referring to the BPM image you posted above. Say we have exposed this Process as a REST service. Now, based on the first, second and third rule outputs, is there a way to construct a JSON/XML and send it as a response to the caller.

For example..
Assume, we sell insurance products to customers. Based on customer criteria (like age, smoker or not, etc) we want to decide which products we can offer, and what can be the max lumpsum eligibility.

So if I send "customer DOB, smoking status" as input to the service. The service then executes rule 1, 2 & 3 and send response like this
<products>
<product>
<id>XX-lifeinsurance</id>
<maxlumpsum>100000</maxlumpsum>
<.....>bunch of other dynamic parameters derived from rules<...>
<product>
<product>
<id>XX-accidentcover</id>
<maxlumpsum>200000</maxlumpsum>
<critical_illness_lumpsum>20000</critical_illness_lumpsum>
<.....>bunch of other dynamic parameters derived from rules<...>
<product>
</products>


Also, May I know if there is a simple REST example demonstrating this rule orchestration please?

Thanks for your continued help.

-B

Bernd Rücker

unread,
Feb 15, 2016, 9:04:25 AM2/15/16
to camunda...@googlegroups.com
Hi Bharat.

I just recently published a small examle showing "chained" decision taking here: https://github.com/camunda/camunda-consulting/tree/master/snippets/dmn-decision-chaining (unsupported example!).

Maybe that helps you. If you do a decision flow in BPMN note that you have to query the result of the decision(s) from the history if you want to pack it into a REST service, as you can see in the test case: https://github.com/camunda/camunda-consulting/blob/master/snippets/dmn-decision-chaining/dmn-decision-chaining-example/src/test/java/com/camunda/demo/dmn/chaining/InMemoryH2Test.java#L63. This is true because the process instance will run straight through and not saved into the Runtime Database.

Hope that helps
Cheers
Bernd

-----Ursprüngliche Nachricht-----
Von: camunda...@googlegroups.com [mailto:camunda...@googlegroups.com] Im Auftrag von Bharat
Gesendet: Montag, 15. Februar 2016 14:31
An: camunda BPM platform contributors <camunda...@googlegroups.com>
Cc: techie...@gmail.com
Betreff: Re: Rule orchestration
--
You received this message because you are subscribed to the Google Groups "camunda BPM platform contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-dev/685d6bb1-657f-4ece-a4d8-edd508854f6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bharat

unread,
Feb 15, 2016, 11:19:30 AM2/15/16
to camunda BPM platform contributors
Thanks Bernd.

Exactly what I am looking for. Will give it a try now.

Appreciate your help.

-B
Reply all
Reply to author
Forward
0 new messages