How to aggregate decisions of multiple rules?? (In Guvnor)
by bbarani
Hi,
We have multiple rules defined in Guvnor and we fire all the rules at a
time. There is a decision object set for each rule and I am trying to figure
out a way to aggregate the result using the prirority of the decision object
(kind of logical AND / OR)
For Ex: The priority of the decision would be set as below
Priority:
Priority3 Priority2 Priority1 Exception on any rule
Granted Action not Supported Denied Deferred
After the rules are fired (I am considering 4 rules here) the final decision
should be as follows
Sample Rule result:
Rule Rule1 Rule2 Rule3 Rule4
FinalDecison
Decisions Granted Granted Granted Deferred
Deferred
Granted Granted Action Not Supported Granted Action Not
Supported
Granted Granted Denied Granted
Denied
Granted Granted Granted Granted
Granted
Is there a way to acheive this using rule flow group / any other simple way?
Thanks,
Barani
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-aggregate-deci...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months
Re: [rules-users] Possible concurrency issue in Drools
by Norman C
I've run into this issue a few more times. Should I log a JIRA ticket for
this? Any advice would be appreciated.
Thanks,
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Sat, July 31, 2010 9:56:26 PM
Subject: Re: Possible concurrency issue in Drools
All,
Just wanted to mention, I'm using version 5.0.1 of Drools.
Thanks,
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Sat, July 31, 2010 9:50:19 PM
Subject: Possible concurrency issue in Drools
Hi All,
I recently ran into an issue which I believe might point to a concurrency
issue. My server stopped processing new requests, so I did a thread dump. In
examining the dump, I found that all of the processing threads, save two, were
blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of
the other two threads appeared to be infinitely looping in the
NamedEntryPoint.insert method. Here are snippets of the stack traces:
ActiveMQ Session Task" prio=10 tid=0x00002aab0003b000 nid=0x7b98 runnable
[0x000000004c086000..0x000000004c087c90] java.lang.Thread.State: RUNNABLE
at org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121) at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
ActiveMQ Session Task" prio=10 tid=0x000000005a35cc00 nid=0xdf6 runnable
[0x000000004a268000..0x000000004a269a90] java.lang.Thread.State: RUNNABLE
at org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
So it seems like one while the first thread is holding the lock and is
attempting to remove an object handle from the object store in NamedEntryPoint,
the other thread is trying to resize that same object store in response to an
addHandle call that puts it over the threshold. I haven't worked out exactly
how these concurrent accesses to the same object store by two different threads
causes an infinite loop in both threads, but it seems like the call to
SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock.
Is this correct? I can imagine that resizing a large hash map could potentially
take a long time and thus synchronizing this call could impact performance, but
somehow, the action of resizing the table must be protected in some way from
adversely impacting other operations on the table.
Any help would be appreciated.
thanks,
Norman
14 years, 3 months
Drools Expert: monitor rules & report activity
by Dieter D'haeyere
@ll,
I have a question regarding the possibilities to monitor and report on the
rules activity.
I have seen that with Drools Guvnor, it is perfectly possible to monitor
scenario's, see what rules fired, etc.
Now, going further, I have two questions:
- Is it possible to monitor rule activity (which rules got fired etc) in a
production situation. Eg. Is it possible to start recording activity at
some time until a proble occured and to review the logs afterwards. This
would be of use when scenario's are not covering all possible cases.
- Is it possible to produce reports on rules, usage of rules (eg. what rules
are fired and what rules were fired most), performance, ...
And if not, what could be a good starting point to create them ?
My experience with Drools is rather limited. Let's say that I am interested
in expert system and technologies surrounding it. At this moment I am
getting a 'theoretical' grip on Drools and its possibilities (of course, I
couldn't help also creating some kind of poc :) ).
Sincerely,
Dieter D'haeyere.
14 years, 3 months
Drools Web Service or external JAR in Oracle Database?
by tom ska
Hello,
I have my Drools project, and I want to use a Drools JAR in Oracle PL/SQL.
The problem is, that importing JAR to Oracle means for me (as far as I know)
splitting JAR (in Oracle Database) to classes. After importing I have few
thousands of classes in my Oracle Database. I want to avoid this, so I
decided to use Soap Web Service as facade for my Drools and connection
between Drools and PL/SQL.
Now I have two questions:
1.) Can I import Drools JAR's to Oracle without splitting it to thousands of
classes?
2.) If no - I want to use this JAR as external source. I think, that Web
Service is good interface. Am I right? ;) I used to use JAX-WS to create Web
Services, but maybe Drools has own method of creating Web Service (Drools is
sooooo powerful ;) )
Thanks,
tom.
14 years, 3 months
Incorrect allowable comparison when using Guvnor GUI Rules - known bug?
by Stephen Mcgruer
Hi there. I was just wondering if the following was a known bug or not
(and if it was
fixed in Guvnor 5.1 - I am using 5.0):
I have two classes, Foo.java and Bar.java. Bar has a property in it,
an integer (also
tried doubles, not tried anything else) called barInt. Foo also has a
property, an
instance of Bar called fooBar.
Creating a GUI rule in Guvnor, I begin with the 'when' block. I add a
check for a Foo. In
this Foo, I add a check upon its fooBar parameter. Now, I want to
match on the fooBar's
barInt property being less than a hundred. So, I click on fooBar, and
choose the 'barInt'
subfield. It appears, *BUT* there is no option for "is greater than"
or "is less than",
only "is equals to" and "is not equals to"! I have tried manually
creating such a rule,
and using "<" or ">" is allowed there, so it is a bug - or at least a
missing feature
with the GUI.
I have an entire report written up, with attatched files and
screenshots and everything,
but I just wanted to check:
A. If this is a known bug.
B. If it is fixed in Guvnor 5.1.
C. Where to submit bug reports for Guvnor.
Cheers,
Stephen
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
14 years, 3 months
Downloading 5.1: bad contents of binaries?!
by Wolfgang Laun
After downloading 5.1 binaries from
http://www.jboss.org/drools/downloads.html
and unzipping them in a fresh, new directory I find:
wlaun@atvienw39033:/extra/drools-5.1/bin$ ls -l
total 14316
-rw-r--r-- 1 wlaun wlaun 116205 2010-08-04 13:44 antlr-runtime.jar
-rw-rw-r-- 1 wlaun wlaun 12866 2010-07-30 10:22 drools-ant-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 156008 2010-07-30 10:22 drools-api-5.1.0.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 127191 2010-08-04 13:44 drools-api.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 16589 2010-07-30 10:22 drools-bam-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 266804 2010-07-30 10:22 drools-bpmn2-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 38093 2010-07-30 10:22 drools-camel-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 84894 2010-07-30 10:22 drools-clips-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 1119468 2010-07-30 10:22 drools-compiler-5.1.0.jar
<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 1159712 2010-08-04 13:44
drools-compiler.jar <<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 2103665 2010-07-30 10:22 drools-core-5.1.0.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 1776713 2010-08-04 13:44
drools-core.jar <<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 49926 2010-07-30 10:22
drools-decisiontables-5.1.0.jar <<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 47227 2010-08-04 13:44
drools-decisiontables.jar <<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 8992 2010-07-30 10:22 drools-doc-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 61872 2010-07-30 10:22 drools-grid-core-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 30056 2010-07-30 10:22 drools-jsr94-5.1.0.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 30110 2010-08-04 13:44 drools-jsr94.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 60520 2010-07-30 10:22
drools-persistence-jpa-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 199641 2010-07-30 10:22
drools-process-task-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 13949 2010-07-30 10:22 drools-simulator-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 46808 2010-07-30 10:22 drools-spring-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 53291 2010-07-30 10:22
drools-templates-5.1.0.jar <<<<<<<<<<<<<<<<<<<<<
-rw-r--r-- 1 wlaun wlaun 46160 2010-08-04 13:44 drools-templates.jar
<<<<<<<<<<<<<<<<<<<<<
-rw-rw-r-- 1 wlaun wlaun 192069 2010-07-30 10:22 drools-verifier-5.1.0.jar
-rw-rw-r-- 1 wlaun wlaun 35248 2010-07-30 10:22 drools-workitems-5.1.0.jar
-rw-r--r-- 1 wlaun wlaun 534827 2010-08-04 13:44 joda-time.jar
-rw-r--r-- 1 wlaun wlaun 13749 2010-08-04 13:44 jsr94.jar
-rw-r--r-- 1 wlaun wlaun 499068 2010-08-04 13:44 jxl.jar
drwxrwxr-x 2 wlaun wlaun 4096 2010-07-30 10:22 lib
-rw-rw-r-- 1 wlaun wlaun 11358 2010-07-30 10:22 LICENSE-ASL-2.0.txt
-rw-r--r-- 1 wlaun wlaun 607526 2010-08-04 13:44 mvel2.jar
-rw-r--r-- 1 wlaun wlaun 4372548 2010-08-04 13:44
org.eclipse.jdt.core_3.4.4.v_894_R34x.jar
-rw-rw-r-- 1 wlaun wlaun 3084 2010-07-30 10:22 README_DEPENDENCIES.txt
-rw-r--r-- 1 wlaun wlaun 119888 2010-08-04 13:44 xpp3.jar
-rw-r--r-- 1 wlaun wlaun 24956 2010-08-04 13:44 xpp3_min.jar
-rw-r--r-- 1 wlaun wlaun 431406 2010-08-04 13:44 xstream.jar
Please s.o. look into this.
-W
14 years, 3 months
Fusion - Why needs the stream time-ordered input
by Tina Vießmann
Hi,
I'm restarting getting to know Drools (Fusion). Now I'm thinking about
the stream processing mode.
The documentation says the events must be time-ordered - they must be
insert into the stream in the order in which they are occur so. Am I
correct that it has to be that way, because the timestamps given to the
events when they are insert into the working memory shall represent the
correct order?
My events already have an attribute representing their timestamp. I've
told that the engine using the @timestamp(...) command.
In that case, is it important anyway that the events are insert
time-ordered?
I'm thankful for any explanations and advises. Thank you :)
Grettings
Tina
14 years, 3 months
Help regarding populating values from presentation layer into Fact Typpes in drools
by Swapnil Sawant
Hi,
In drools, I have seen that following functionalities have been implemented :
- Creating a fact type which can be used in a rule
- Creating rule by declaring functions or by using DSL
- Testing the rule using test scenario
Here, I had a question regarding decoupling of fact types between my application and drools.
I wanted to whether writing a java code for adding values from form/database(i.e. my application) into fact types of drools package which I have created is must or is there any automated way for doing this ?
For example,
If new rule gets added which will result in changing fact (either modify existing or add new fact).
In this case one has to write a code for populating presentation layer values into this newly modified/created fact type. Can this be automated..?
>From client support perspective -How to manage addition of New Rule to existing Rule base..?
Thanks & Regards,
Swapnil Sawant | iLabs | L & T Infotech
Plot no. EL - 200,TTC Electronic Zone,Shil-Mahape road,Navi Mumbai - 400 701
Extn: +91 22 6795 4325
Mail: Swapnil.Sawant(a)lntinfotech.com<mailto:Swapnil.Sawant@lntinfotech.com>
www.lntinfotech.com
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
14 years, 3 months
Cannot work out how to get created fact to retract on change of 'when' conditions - help!
by Stephen Mcgruer
Hey,
We have the following situation: Fact1 and Fact2 both have a 'score'
property. They also both have a 'month' property. When a Fact1 and a
Fact2 have the same month (at most there will only be one such pairing
for each month), a Fact3 is created with a score made from adding the
two base Facts scores:
rule "ExampleRule"
dialect "mvel"
when
Fact1( fact1Month : month, fact1Score : score > 0)
Fact2( month == fact1Month, fact2Score : score > 0)
then
Fact3 fact3 = new Fact3();
fact3.setScore( fact1Score + fact2Score);
insertLogical(fact3);
end
Our problem is that if fact1Score or fact2Score is now changed, a new
Fact3 with a new score is created, *but* the old Fact3 is of course
not removed - the conditions in its when still hold true as well (the
new score is still above 0).
Can anyone think of a way to make sure that if either fact1Score or
fact2Score is changed, then the old fact3 is removed from memory?
The only way we could at all think to do this is to add a timestamp to
fact3, and to have another rule that retracts old fact3s if there is
one with a newer timestamp and the same month... but it seems horribly
messy.
Thanks,
Stephen
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
14 years, 3 months
KnowledgeAgent and OSGI
by mmarmol
Hi, I have managed to install Drools-core and Drools-compiler in my Equinox
osgi environment, I can compile rules and execute them just fine, I was just
wandering how to configure a KnowledgeAgent using
KnowledgeBuilderFactoryService and KnowledgeBaseFactoryService. I managed to
configure one but i am not able to reload rules when they change at runtime.
I have started ResourceChangeScannerService and
ResourceChangeNotifierService, changeset related to the rules file gets read
but no change gets implemented. An idea?
Here is the code:
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
ServiceReference serviceRef = bc
.getServiceReference(ServiceRegistry.class.getName());
ServiceRegistry registry = (ServiceRegistry) bc.getService(serviceRef);
KnowledgeBuilderFactoryService knowledgeBuilderFactoryService = registry
.get(KnowledgeBuilderFactoryService.class);
KnowledgeBaseFactoryService knowledgeBaseFactoryService = registry
.get(KnowledgeBaseFactoryService.class);
ResourceFactoryService resourceFactoryService = registry
.get(ResourceFactoryService.class);
KnowledgeBuilderConfiguration kbConf = knowledgeBuilderFactoryService
.newKnowledgeBuilderConfiguration(null, getClass()
.getClassLoader());
KnowledgeBuilder kbuilder = knowledgeBuilderFactoryService
.newKnowledgeBuilder(kbConf);
ResourceFactoryService resource = resourceFactoryService;
kbuilder.add(resource.newFileSystemResource(filePath),
ResourceType.CHANGE_SET);
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors());
throw new RuntimeException(kbuilder.getErrors().toString());
}
KnowledgeBaseConfiguration kbaseConf = knowledgeBaseFactoryService
.newKnowledgeBaseConfiguration(null, getClass()
.getClassLoader());
KnowledgeBase kbase = knowledgeBaseFactoryService
.newKnowledgeBase(kbaseConf);
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "false");
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "CoreDroolsAgent",kbase,
aconf);
kagent.applyChangeSet(resource.newFileSystemResource(filePath));
Thanks in advance!
Cheers
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OS...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months