Passing through a collection of objects

41 views
Skip to first unread message

Tone Loc

unread,
Feb 17, 2016, 5:25:10 PM2/17/16
to OpenRules
Hi all,

I'm new to this, just investigating how to do some stuff.

In the user guide there is an example "DecisionManyCustomers" which is added to the standard installation.  This uses a standard java bean "Customer" and a class "CollectionOfCustomers".

This is great for passing through an array of objects to get a decision about which of those individual objects meets the criteria set-up in the decision table. So 2 questions I guess:-

If I don't want to pass through Customers to my decision but some other group (say, "fur trappers") what changes would I need to make to be able to pass through a group with different attributes to the customers group which came in the DecisionManyCustomers example? Would I have to create a bean and class for this? (not that I would know where to start).

Secondly, the DecisionManyCustomers example uses data set up in a sheet to be processed by the decision.  Could this collection of objects be passed through to the decision if it were a web service? I'm guessing it can and 'RTM' would be a reasonable answer but a page number would be better and any advice about passing through collections would be best of all (however I'm sure that I'll be back with more specific questions later).

Thanks in advance,

Anthony

support

unread,
Feb 18, 2016, 1:15:30 PM2/18/16
to OpenRules
Anthony,

Instead of the class Customer you may create your own class, say FurTrapper, that can be a simple Java bean. It is easy to do under Eclipse IDE when you just define your own attributes and Eclipse generates for you all setters and getters. Then you create your own class CollectionOfTrappers that should include an array of trapper: FurTrapper[] trappers and any other attributes of this collection you want to accumulate inside your rules. Make the proper changes in the Glossary and businessObjects and you are ready to go.

You do not need to "use data set up in a sheet to be processed by the decision" - it si usually done for testing only. In a real production environment data usually comes from a database to initiate your Java objects such as trappers. This approach works with web services quite well. 

Support

Tone Loc

unread,
Feb 18, 2016, 3:54:37 PM2/18/16
to OpenRules
Hi,

Thanks for getting back to me that was pretty clear.

Looking at the other examples, the documentation for DecisionHelloWSCustomer has you using axis 1.4.  Is that still correct? It seems like old, are there other supported methods for creating web services for open-rules decisions?

Thanks,

Anthony

Jacob Feldman

unread,
Feb 18, 2016, 4:22:52 PM2/18/16
to OpenRules
Axis 1.4 is quick and reliable. It is also downloadable from our website. So, by default we use it. However, we have customers such as BOTW that switched to Axis 2.0 themselves and had no problems.
Reply all
Reply to author
Forward
0 new messages