Flow with Rules (RuleFlowGroup): how to share parameters/facts
by Nol de Wit
(using Flow and Rules 5.0)
In a small pilot we are considering to replace part of the work in
some of the subprocesses with rules. I can't seem to figure out how to
transport the parameters within the flow to the data the rules should
act upon.
In the Flow-only model, parameters are added as a parametermap at the
point the flow is started using:
parameterMap.put("report", report);
ksession.startProcess("myModule", parameterMap);
A 'standalone' rule model is given its data by feeding it some 'facts' using:
ksession.insert(report);
ksession.fireAllRules();
(..right? Haven't done to much of that, but I believe that is the way
it is done)
So if I combine Flows and Rules (using RuleFlowGroup), how do I make
sure the rules are given the correct data? My data (report) first
needs to go through a couple of flow actions, next through an XOR, of
which each output is connectedand then after each XOR output contraint
a
Currently I still use the first option, but the rules don't get fired
(the flow is started, and runs untill the RuleFlowGroup....). If I add
a ksession.fireAllRules() I see no difference.
Thanks,
Nol
15 years, 9 months
Facts or rules ?
by Bertrand Grottier
Hello,
I am a newbie with business rules systems.
I would like to implement a component that "compute" the price of products. There can be a great number of potential prices (maybe 10^4 or 10^5).
My first idea was to create template rules, "feeded" by a database. In other words, the information about prices would be contained in the rules.
Eventually, I decided to create Prices objects, that are also inserted in the Knowledge session (Prices become facts). The rule engine just "matches" the appropriate price object with each product (there are other rules then to compute the final price).
Price
{
_productId ;
_beginDate ;
_endDate ;
....
_price ;
}
Product
{
_id ;
_date ;
...
_
}
Are my explanations clear enough ?
Is this a good approach or is it stupid ? Why ? What are the good practices ?
Thank you in advance for your help.
Benoît
_________________________________________________________________
Découvrez comment SURFER DISCRETEMENT sur un site de rencontres !
http://clk.atdmt.com/FRM/go/206608211/direct/01/
15 years, 9 months
5.1 JavaDoc
by David Cracauer
Greetings,
I'm working through some issues with flow, and I want to have a look at the
(complete) doc, including the impl classes. Is this hosted/available
anywhere? I tried to build it from source, and I'm not getting anywhere.
Thanks,
Dave
--
View this message in context: http://n3.nabble.com/5-1-JavaDoc-tp708822p708822.html
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
drl's and silent failures
by Barry Kaplan
** warning: This is a rant, but it just might save you some head scratching
if you run into these issues **
I really hate writing rules. Not, well not rules, but rules in the DRL
language. There are so many edge conditions that fail silently. Here just
two from today:
...
then
retract(f1) // some comment
retract(f2)
end
In the above retract(f2) will not be invoke. No message about any problems
-- it just doesn't happen. Remove the comment and f2 is retracted.
And, where 'ksession' is a global
...
then
update(ksession.getFactHandle(f1), new MyF1(10, 10))
end
In this one the constructor used for MyF1 does not exists. No message, just
silent failure. Change the rule to:
...
then
MyF1 fi_new = MyF1(10, 10)
update(ksession.getFactHandle(f1), f1_new)
end
And now the error message about the missing constructor is produced.
--
View this message in context: http://n3.nabble.com/drl-s-and-silent-failures-tp704973p704973.html
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Logging using JSR94 StatelessRuleSession
by madchen
I set up the rule session basically like this:
RuleServiceProvider ruleServiceProvider =
RuleServiceProviderManager.getRuleServiceProvider("http://drools.org/");
RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime();
(StatelessRuleSession) session = ruleRuntime.createRuleSession( uri, null,
RuleRuntime.STATELESS_SESSION_TYPE);
I can't see a way to use AgendaEventListener because there is no place to
add listeners. I tried using KnowledgeRuntimeLoggerFactory, but I get this
error "org.drools.jsr94.rules.StatelessRuleSessionImpl cannot be cast to
org.drools.event.KnowledgeRuntimeEventManager"
I was wondering if anyone knew of a good way to do logging with this setup?
Thanks,
Kevin
--
View this message in context: http://n3.nabble.com/Logging-using-JSR94-StatelessRuleSession-tp707186p70...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Tuples in Agenda Item.
by Rajnikant Gupta
Hi,
I have a doubt regarding tuples. I created a rule using complex types
objects. I am comparing two complex type objecs which have parent-child
relationship eg. "ParentType.equals(ChildType)". I expect this to follow
java rule which allows such comparision. Now when I run the rules with
different values for fields in ParentType and ChildType (which means the
rule should fail) to my surprise it evals to TRUE. Also upon inspection, the
tuple shows me only the ChildType instance not the ParentType.
I would appreciate any help on this.
Regards,
Rajnikant
15 years, 9 months