Can a Blaze rule or Decision Table make a web service as part of its decision process?
I don't believe that SRL can directly call a web service. However; that being said, create a small Java or .NET class (depending on your version of Blaze) that does the call for you. Import that class into Blaze, and then use it to do your web service calls. Keep in mind that if you use the web service call as part of the condition of a rule then you may not get correct results if the "answer" from the web service changes over time. The call to the web service will be evaluated once on entry to the ruleset and will not be re-evaluated again during the course of the execution of the ruleset. There are warnings in the manuals about using functions that apply here.
Business Rules Consulting, Inc.
Like Tas said, it is possible (by creating a class that expose the functionality you need) to invoke a web service method as part of a rule service.
That does not mean you really should do it, though (and I am sure Tas will agree with me).
If you can at all make it happen with regards to your business requirements etc, try to make your rule services stateless and self contained (i.e. no database-, web serivce- or other external, possibly blocking calls).
This will make your rule services easier to deploy, test, scale etc. It will also be easier to calculate how many rule agents to configure, given the number of CPUs/cores on your deployment machine(s).
An alternative solution is to make the information returned from the web service a part of the input to your rule service. That way you can more easily specify test data sets, and like we have said, you still need to create the actual integration outside of Blaze anyway.
joe.yang wrote:Can a Blaze rule or Decision Table make a web service as part of its decision process?
I agre with Jostein. If at all possible, make your rule service self contained. I've worked at clients that wanted to blame the rule service for slow performance, but since it was self contained, I just added a start and completion time to the output and there was no longer any question about the rule service performance. If a call is added for an external data source or external service, the performance is no longer in your control and can lead to a lot of painful performance discussions. with the finger pointed at you.
One design I have used is to process through a rule service as far as possible andt then return with the request for the additional data. This is most useful when the data is not always needed and is "expensive" to obtain. Try to make the decision without it first, and if needed then request it as additional input.
Thank you guys.
Thank you to our top contributors,Tas & Jostein!
Retrieving data ...