Evaluation of the of rules with 'window:length' event windows
by senyatur
Hi guys
We are using Drools for event processing. So we have rules that, for
instance, put accumulation function over window of number of elements (not
time).
... from accumulate(Class1($a:a) over window:length(X) from entry-point
"Point"...
The problem we are experiencing that when evaluating the rule when there are
*less* elements than X (window length) the accumulation function is still
calculated which leads to wrong results.
Is there a way in Drools to restrict firing of this type of rules when there
are less than 'length' elements in the session?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Evaluation-of-the-of-rules-with-window-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
How to control the order of rule execution
by San
Hi All
I am just a month old to drools.
We are doing a small poc.
*Our requirement:*-we want 5 rules should be fired but only in a particular
order.say rule 1 first, den rule 2 n so on...
I have proceeded by creating a ruleflow file in eclipse and mentioned the
ruleflow-group names in our correspondong rules in the (.drl) rule file.
In guvner 5.4 i am trying to create a process n importing our .rf ruleflow
file. Its is able to upload it sucessfully bt i am nt able to open it in
guvner editor.
*Questions:*
1st -What cud be d problems in the above case?
2nd- can I create a test case for our rule flow in guvnor and execute it?
3rd- given our requiments is there any better way of executing it other than
rule flow in Drools?
Tnks to all in advance..
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-control-the-order-of-rule-execut...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Killing a session
by mike
Hi there,
Is there any way to kill a running session?
I've been trying with StatefulKnowledgeSession.abortProcessInstance but i
can't get it working.
For instance .. I got this drl
rule "infinite loop"
when x : Integer()
then
System.out.println(x);
Thread.sleep(100);
insert(x + 1);
end
n' this Thread
public class SessionThread implements Runnable {
private StatefulKnowledgeSession session;
public SessionThread(StatefulKnowledgeSession session) { this.session =
session; }
public void run() { session.fireAllRules(); }
}
then i create a session with the drl n' do something like ...
session.insert(42);
Thread thread = new Thread(new SessionThread(session));
thread.start();
Thread.sleep(1000);
session.abortProcessInstance(thread.getId());
I've tried diff processInstanceIds and session.getProcessInstances() but
nothing seems to stop the running session
Thank you
Mike
13 years, 7 months
Guvnor problem - lock file appears in guvnor repository root
by benfro
Hi.
We are trying out Guvnor 5.3.0 in a JBoss 4.2.2 environment.
Guvnor is set up to use an Oracle 11 instance as repository.
We experience a couple of problems:
1) We all login as "guest", and when creating a package, the package appears
on other workstations but no assets. Is this an expected behaviour? We
should be able to see each others rules, right? The DB setup, defined in the
repository.xml file, seems ok, tables are created fine etc.
2) As soon as we start JBoss a .lock file appears in the repository root. It
is tied to the entire JBoss process and cannoit be deleted. Anyone recognize
this?
Sincerely
benfro
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-problem-lock-file-appears-in-guv...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
how to loop back in bpmn process
by sumatheja
Hi All,
I'm trying to write a flow which will loop back (go back to
particular node on a condition and start executing nodes from there) on
passing a certain validation. I'm confused on how exactly to achieve this.
I'm using an OR gateway to split and using XOR to join them back. But the
problem is XOR expects always atleast one branch to be true which is not
necessarily true here and, if I use AND both should be true which again is
not valid here. Can someone suggest a way to achieve this behaviour. Thanks
in advance.
--
cheers
Sumatheja Dasararaju
13 years, 7 months
Somewhat strange question: Rules without a RHS
by Joe Ammann
Hi all
I have an ongoing discussion with my users: They have been using several
home-grown rule oriented applications for years. Almost all of these
"rule engines" were built for one very specific reason, and the users
have come accustomed to just specify a LHS of a rule. They never needed
to specify a RHS, because the action of the rule was pre-determined by
the application. So when the rule fired, it was clear what needed to be
done in the application.
Now want to merge all these "rule engines" onto Drools (5.4.0), and use
the Guvnor BRL editor and DSLs to actually formulate them. Of course now
Drools can not "know" what the RHS is supposed to be, since we have
"merged" several applications. The users now need to select one of
several predefined DSL statements as the RHS, but unfortunately they
consistenly keep forgetting to put an RHS at all. Guvnor validates this
successfully but of course the rules then fail to work.
I have been thinking if there is any way in Guvnor or via some kind of
Drools expert mechanism to say something like "if a rule is in packaga
a.b.c, it's RHS should always be 'foo' unless specified otherwise". To
be honest, I could not come up with a way to achieve this and think just
need to educate my users better. But before doing that, I thought I'd
use the wisdom of this group :-)
--
CU, Joe
13 years, 7 months
Challenge! Using javassist and drools presents an issue with drl
by markricard
In order to make writing drl files easy and not requiring writers to be
developers, I have written some JavaAssist code that dynamically creates a
subclass and new methods in memory.
If for example there is a REAL java class called 'com.foo.Instance'. Via
javasssist, I create a new in-memory subclass called 'com.foo.InstanceEx'.
The new class dynamically creates a new getter called getFoo(). The drl
writer would like to directly reference 'foo' in the drl file like so:
when
i : Instance(foo == 'fee')
The problem is, in order to reference foo, I would need the drl file to do
this:
import com.rrd.xspace.drools.InstanceEx;
But I cannot do that because InstanceEx does not exist at runtime. The
error I get, which is an obvious one, is "Unable to create Field Extractor
for 'foo' of '[ClassObjectType class=com.foo.Instance]' in rule 'Test' :
[Rule name='Test']"
Is there a way to include a dynamic import of a JavaAssist class while I am
constructing the KnowledgeBase instances to run the rules so that I can
reference that new method?
I would hope to have something similar to:
KnowledgeBuilder kbuilder = ....
kbuilder.addImport("com.foo.InstanceEx")
or
kbuilder.addClass(Class.forName("com.foo.InstanceEx"))
Any help GREATLY appreciated.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Challenge-Using-javas...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 7 months