I am somewhat new to rules-based programming, so I thought I'd ask if my
approach to our problem seems valid (or if there are any better ways of
doing it). Basically, we have a bunch of data from public sources. Let's
call them public records. I am going to assert those into the working
memory. Then, we have summary objects that are supposed to summarize
everything we know from the public sources about a specific item. The
summary objects have properties that are to be populated from the related
public record objects. Now, we trust records from some public sources more
than others. So, we would use the values from those public records first to
populate the properties. Anyway, here's my thoughts on my approach:
1. Assert the public records into the working memory.
2. Find the corresponding summary object and assert that into working
memory.
3. Insert RequiredProperty objects (they will have a propertyName field)
for all properties on the summary object that need to be populated.
4. Write my rules based on the existence of a RequiredProperty objects (and
the summary object of course) with a specified propertyName.
So, when my rule fires that sets a property, I'll remove the
RequiredProperty object from working memory so that other rules that try to
set the same property from less trusted public sources won't fire anymore.
We'll use salience to give the rules priority based on our preferences.
Does this sound feasible? Is this the "drools way"?
James Carman
Show replies by date