Drools Guvnor API information?
by Vikas Hazrati
Hi,
I am looking at using Guvnor for our project where users would be creating
rules using our UI. For this i need to add / modify rule or any asset for
that matter using an api.
Unfortunately, i could not find enough documentation to suggest the best way
to use the REST api, which I guess is provided by Guvnor. Could someone let
me know the location of where i can get some information for this api. I
also see that the issue GUVNOR-1080
(https://issues.jboss.org/browse/GUVNOR-1080) is marked resolved so the api
should exist right? or that we cannot access it remotely until we have the
Atom Pub Interface done?
Help appreciated .
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Guvnor-API-inf...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 4 months
How can I nested rules
by leonardo_josue
Hi everybody, I hope some of you can tell me if I can do something with my
problem.
I have a table in a DB with medical information from too many patients. This
information was captured in paper and after put into the table. The
questions have a sequence, and a few answers depend of other answers, for
example:
P1. Age:____
P2. Gander: 1: Female, 2: Male
--> if P1 >= 12 and P2 = 1 then go to p3, else go to p5
P3. How many times have you been pregnant? 0, 1, 2, 3, 4, 5, ______
--> if number > 1 go to P3 else P5
P4. How many babes were born alive? 0, 1, 2, 3, 4, 5, _______
P5. Do you smoke? 1: no, 2: yes
In the table I have something like this:
mysql> SELECT * FROM table;
|id||P1|P2|P3|P4|P5|STATUS
------------------------------
|1|34|1|3|2|1|NULL
|2|10|1|3|2|1|NULL
|3|21|2|1|1|1|NULL
|4|66|1|0|1|1|NULL
|5|14|2|NULL|NULL|1|NULL
|6|09|1|NULL|NULL|1|NULL
I try to set STATUS = "OK" when information was consistent, i.e.
ID = 2. A girl of 10 years hardly been pregnant 3 times
ID = 3. A man can't get pregnant or abort
ID = 4. A woman can't abort if the number of times she has become pregnant
is zero
I'll try to use Drools to do something like this.
rule "Age and gender women"
no-loop
when
p : Person(p1 >= 12 && p2 = 1)
then
//execute rule "Pregnant"
end
rule "Pregnant"
no-loop
when
p : Person(p3 > 1)
then
//execute rule "Aborts"
end
rule "Pregnant"
no-loop
when
p : Person(p4 <= P3)
then
//it's ok
p.Status = 'OK'
end
Is this possible??? I read than you can't nested rules, but I want to know
if exist some way to do. Since now my thanks for any help.
Best regards.
Leo.
--
View this message in context: http://drools.46999.n3.nabble.com/How-can-I-nested-rules-tp4020488.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Calling queries or collect() from functions
by Miguel Paraz
Hi,
I have a rule like:
rule "Rule1"
when
$fact: Fact1()
$allFacts: ArrayList() from collect(Fact1())
then
insert(new Fact2($allFacts.size()));
end
I want to compute $allFacts inside a function since I will use it across
different rules.
This doesn't work because it is not valid Java syntax:
function int size() {
ArrayList a = ArrayList() from collect(InQueuePredicate());
return a.size();
}
Could I put this in a named query, and call it from a function?
Thanks!
Miguel
13 years, 4 months
Re: [rules-users] Eclipse Debugging Drl file
by benq2188
Hello,
I faced with the same problem. Breakpoints are not being hit by debugger. I
have Eclipse SDK version: 4.2.1 and went through the reference manual of
Drools and followed each step carefully.
-Installed GEF
- Downloaded drools-distribution-5.4.0.Final.zip
-Unzipped it into Eclipse main folder
-Restarted Eclipse
-Defined run time based on the latest Drools project jars included in the
plugin
itself.
-Created Drools Project
-Created new launch configuration for Drools Application.
-Put a breakpoint in the helloworld simple project on the first line of the
section "then".
When I debug it as Drools Application, debugger stops in Java breakpoints
but doesn't stop in drl rule.
Any solutions, how can I fix it?
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Eclipse-Debugging-Drl-file-tp3870257p40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Drools 5.5.0.CR1 is using a broken cdi-api version
by Cristiano Gavião
Hello,
I'm using Tycho to create a dependency P2 repository (OSGi environment)
containing JBPM 5.4.0.CR1 and DROOLS 5.5.0.CR1.
I got some problem to properly setup the dependencies for the cdi-api.
The bundle knowledge-internal-api has a dependency to cdi-api (version
1.0-SP4), but this version is tied to this:
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<version>1.0.0.Beta1</version>
And this 1.0.0.Beta1 version of org.jboss.spec.javax.interceptor was not
well osgified. it doesn't have a Bundle-SymbolicName !
I could handle this problem using a newer version of it:
<dependency>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<version>1.0.1.Final</version>
</dependency>
I won't use cdi anyway, but it could help others that decide to use jbpm
with eclipse.
regards,
Cristiano
13 years, 4 months
Noob desperately needing help
by zaphod
So, we have a massive web-based application with a rules engine powered by
drools 4.0.7...I have a time-based rule that fires, executes about 80% of
the java code, and then just stops. No error, no exception, no nothing...it
just stops. Until I restart the node, all rules processing is suspended.
I've let this process run for 24 hours without intervention, but it really
is hung. And I know it's not in a loop, as I'm outputting console messages,
and I know the exact line that the app is hanging on. I have tried upgrading
to drools 5.4, but we didn't write the kernel of the rules engine, and I'm
not really in the mood to deal with re-writing it, unless I absolutely have
to.
This is the first time I've ever seen anything like this, and this app has
been running for 4 years with no rules-engine issues. We use it
everywhere....we are an EMS research organization supporting 3 states, and
the application uses the rules engine to determine state-based EMS logic.
We also use it as a timing trigger to email notifications to various EMS
personnel to notify them of hospital facility closings, bed availability,
etc.
I have absolutely no idea what the problem is, or how to present it to the
mailing list users in a way that might identify what the issue really
is...so anyone who is game to help, ask me questions, and I'll answer them
as best I can.
Thanks for anyone interested in helping debug this issue....
Paul Cooper
Developer
EMS Performance Improvement Center
Chapel Hill, NC
--
View this message in context: http://drools.46999.n3.nabble.com/Noob-desperately-needing-help-tp4020589...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months