Will StatefulKnowledgeSession.fireallrules() block in this case ?
by soumya_sd
My question is if I call re.callRuleEngine(facts) in the same thread (which
in turn calls knowledgeSession.fireallrules()) will it "block" till
a) ALL rules are fired (i.e., THEN part of rule is executed for all
matching facts in working memory)
AND
b) MyChannel.send() is executed for all matching facts i.e., the list of
FilteredFacts inside my MyChannel object is populated completely at the end
of the blocking call.
Thanks.
-------------------------------------------------------------------------------------
RuleEngine re = RuleEngine();
re.callRuleEngine(facts);
-----------------------------------------------------------------------------------
rule.drl
rule "some_rule"
dialect "mvel"
when
$my_var : MyValueObject( x > 4.0 )
then
channels["my_drools_channel"].send($my_var);
end
-----------------------------------------------------------------------------------
RuleEngine
{
RuleEngine{
KnowledgeBase knowledgeBase = null;
try {
knowledgeBase = createKnowledgeBase();
} catch (Exception e) {
e.printStackTrace();
}
knowledgeSession = knowledgeBase.newStatefulKnowledgeSession();
knowledgeSession.registerChannel("my_drools_channel", new MyChannel());
}
void callRuleEngine(List<MyValueObject> facts)
{
// insert Facts into
// the working memory.
for (Object fact : facts) {
knowledgeSession.insert(fact);
}
knowledgeSession.fireallrules();
}
}
-----------------------------------------------------------------------------------
public class MyChannel implements Channel {
private List<MyValueObject> filteredFacts;
@Override
public void send(Object object) {
if( object instanceof MyValueObject )
{
MyValueObject obj = (MyValueObject)object;
filteredFacts.add(obj)
}
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/Will-StatefulKnowledgeSession-fireallru...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 10 months
Use of ruleflows in Guvnor
by dollanitri
Hi All,
Currently i'm trying to do a small POC on drools and ruleflows integrating
with Java Custom Application.
Here below are the details:
-- Created decision tables in Guvnor Web based UI and ruleflows in Eclipse
using jBPM plugin.
-- Exposed Drools API into one of the java helper class and called ruleflows
using startprocess.
-- When process starts then it calls Decision tables (by hard coding the
decision table name) from the ruleflow (.rf)
-- Finally getting output from the decision table returned action.
Here my question is
1) There is a option in Guvnor to upload ruleflows (.rf), but seems to be
that its not working.
I tried to upload newly created ruleflow into Guvnor and shown uploaded
successfully, however its not at all using anywhere.
Question : how this ruleflow works in Guvnor after uploading into it?
--
View this message in context: http://drools.46999.n3.nabble.com/Use-of-ruleflows-in-Guvnor-tp3977643.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 10 months
Problem importing bpmn process into oryx designer
by sumatheja
Hi,
I've created a simple bpmn flow which has a start noden rule-flow task
and end. When I try to import it from oryx designer and validate it it
gives an error saying "cannot find process image". Can anyone help me know
what I'm missing.
--
cheers
Sumatheja Dasararaju
13 years, 10 months
Drools Clients
by bhargav99
Hi ,
We are evaluating various open source rule engines market.* Drools
*being one of the most popular products in this category , we like to know
if we can get a list of *clients *or *customers* currently using *drools*
rule engine. This information would be vital for our evaluraion process.
Thanks,
Bhargav
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Clients-tp3979720.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 10 months
unable to write a function in guvnor with generic List as a parameter
by sumatheja
Hi,
I'm trying to write a function in guvnor like
function int applyThresholds(List<Integer> thresholdList, int totalPoints)
It says the List<Integer> ClassNotFound even though I've java.util.List in
the imports. when i remove <Integer> generic it works fine. I'm using
drools and guvnor 5.4 CR1. Am I missing anything? Thanks in advance.
--
cheers
Sumatheja Dasararaju
13 years, 10 months