Re: [rules-users] Ant compiler task?
by JigarP
Hi,
can you provide complete example with required details so we can try to run
it locally and try to understand ant task with .brl to .drl conversion. as
we are not getting enough information for this.
Regards,
Jigar
Fernando Meyer wrote:
>
> Basically you need to add the drools-ant on your classpath
>
> define your compile task
>
> <taskdef name="rulebase"
> classname="org.drools.contrib.DroolsCompilerAntTask"
> classpathref="drools.classpath" />
>
> And use the rulebase task as the following example
>
> <target name="rules" >
> <rulebase
> srcdir="${eclipsepath}src/test/resources/rules"
> tofile="${eclipsepath}target/cheese.rules"
> classpathref="cheese.classpath" >
> <include name="*.drl" />
> <include name="*.brl" />
> <include name="*.xml" />
> <include name="*.dslr" />
> </rulebase>
> </target>
>
>
> you can see my test XML file here
> http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-ant/src/test/r...
>
>
> On Fri, Mar 7, 2008 at 5:59 PM, Eric Miles <eric.miles(a)kronos.com> wrote:
>
>> I see numerous references to the Ant task in the documentation but see
>> no documentation on how to use it. Where can I find some? Google
>> turned up nothing...
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> Fernando Meyer http://fmeyer.org
> JBoss Rules Core Developer
> fernando(a)fmeyer.org
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
View this message in context: http://www.nabble.com/Ant-compiler-task--tp15906277p18684653.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
question about drools-dataloaders & drools-server
by 周进刚
Hi,
What roles the drools-dataloaders and drools-server play in the drools source?
Thanks.
Robin.
----------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Group Ltd., its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.
-----------------------------------------------------------------------------------------------
16 years, 7 months
VerifyError with Db4oInstrumentationLauncher
by Scott Reed
I am trying out transparent persistence using
Db4oInstrumentationLauncher. I am getting a VerifyError "Illegal type in
constant pool". Since I do not get these without the launcher I wonder
if there is something I missed in the docs about implementing this
feature. Any ideas or suggestions would be welcome.
Thanks,
Scott
16 years, 7 months
Re: [rules-users] Snapshot doesn't include the updated rule?
by Paul Sentosa
Hi Yu Wang,
thanks for the reply.
Anyone else have had the some problem too?
Or did we miss some basic knowledge for using the BRMS correctly?
Any suggestions, tips, solutions are highly appreciated
Thanks
ps
----- Original Message ----
From: Yu Wang <yuwarm(a)gmail.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Friday, July 25, 2008 10:06:10 PM
Subject: Re: [rules-users] Snapshot doesn't include the updated rule?
The BRMS is not very stable. I had similar problems. For some reason, regenerating a snapshot once gave me errors. But then I generated the same snapshop using a new name, it is fine. Also after about 5 rounds of rebuilding and regenerating of snapshot, the server kind of freezes. I have to restart it to bring it back to normal, and I do that once or twice everyday.
On 7/25/08, psentosa <psentosa(a)yahoo.com> wrote:
Sorry ..forgot to mention...
i use Drools/BRMS 4.0.7, Eclipse 3.4 Ganymede...
just now i try to recreate the snapshot after rebuilding the package (i.e.
create the snapshot from menu "package", and not from "Deployment", and
suddenly I can't open the source package anymore. So I delete the snapshot
and redo the steps and then the updated rule is there.
Still the application didn't get the updated result.
Only after restarting the server is the updated result available.
regards
--
View this message in context: http://www.nabble.com/Snapshot-doesn%27t-include-the-updated-rule--tp1865...
Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 7 months
count with nested condition
by Yoni Mazar
Hi all,
Our object deals with the clinical domain. We have a class LabEvent that
represents a visit in the laboratory. Each event is associated (using the
laboratoryResult association) with one or more LabResult objects (children),
each represents the results of a particular test.
in the rule LHS we want to express the following condition:
"At least two LabEvents in the last month, with a LabResult with value
greater than 1.8"
of note, the application asserts the LabEvent objects to the workingMemory.
in DRL we tried to write it as:
ArrayList(size>1) from collect(
LabEvent(eval( dateWithinLastMonths(effectiveTime,1)),
results:laboratoryResult)
LabResult( value >1.8) from results)
Of course, the problem is that collect expects a single pattern...
Does anyone has a simple idea how to express this business logic?
Thanks, Yoni
--
View this message in context: http://www.nabble.com/count-with-nested-condition-tp18710506p18710506.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
'from global' and the workingMemory
by Yoni Mazar
Hi all,
Let's look at the following example:
****DRL file***************
global java.util.List list1;
global java.util.List list2;
rule "r1" when Fact(...) from list1 then ....
****Application************
List<Fact> facts1 = ...
List<Fact> facts2 = ...
List<Fact> allFacts= facts1+facts2
StatelessSession session = ...
session.setGlobal("list1", facts1);
session.setGlobal("list2", facts2);
session.execute(allFacts)
The question: will rule "r1" use the facts from the working memory and a
rete algorithm, or will it naively loop on list1 items?
BTW, can we use generic in the DRL section? for example:
global java.util.List<Fact> list1;
Thanks for the help, Yoni
--
View this message in context: http://www.nabble.com/%27from-global%27-and-the-workingMemory-tp18728639p...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
Filter incorrect abbreviations
by Pete Crenshaw
Hello Droolers,
I'm a Drools novice and I'm stuck with a basic rule problem.
In my domain I use a list of abbreviations to describe the conditions of a
system.
Before I can check the state of my system I have to verify all applied
abbreviations.
The List of abbreviations is not a fixed list it's more like a combination
of chars, combined in different ways on fixed positions.
This is a small cutout:
A cutout of possible chars at Position 1: A B C D F H
A cutout of possible chars at Position 2: - A C s n b
A cutout of possible chars at Position 3: - A B E F M
A cutout of possible chars at Position 4: - H L O R U
Now it is allowed to combine the following abbreviations:
(another small cutout)
A--O A--R A--U A--L
BAAO BAAR BAAU BAAL
but it is not allowed to combine this:
AA** B-** (* stands for all possible chars on a position)
Now I have 2 basic Questions:
1) How can I pick abbreviations that are NOT allowed?
I think it's easy to say:
rule "Rule 1"
when
a : Abbreviation( pos1 == 'A', pos2 == '-', pos3 == '-', pos4 == 'O' )
then
# do something positiv
end
But how can I pick up all the wrong combinations without hardcoding them?
This would end up in a never-ending story.
2) Upgrading the "Rule 1" from my 1st Question I'm looking for a way to make
the
Rules more generic.
I don't want to hardcode all possible abbreviation combinations.
How can I realise something like this VERY INFORMAL notation:
rule "Rule 2"
when
a : Abbreviation( pos1 == 'A', pos2 == ['-','D','H'], pos3 == '-',
pos4 == ['O', 'R', 'U', 'L'] )
# If abbreviation looks like A--O, AD-O, AD-U, AH-R, etc. everything
is fine.
# It's time for "Rule 2" to do something positiv
then
# do something positiv
end
"Rule 2" should find all the abbreviations that are build up according to
a set of allowed char combinations.
OR
rule "Rule 3"
when
a : Abbreviation( pos1 == 'A', pos2 != ['-','D','H'], pos3 != '-',
pos4 != ['O', 'R', 'U', 'L'] )
# If abbreviation looks like AA-O, AB-U, A-AO, A--K, etc. something is
wrong.
# It's time for "RULE 3" to announce something negative
then
# announce something negative
end
"Rule 3" should filter all the abbreviations that are violating a set of
allowed char combinations.
Thanx 2 all droolers in advance.
Pete
16 years, 7 months
'not exist' and decision tables
by Yoni Mazar
Hi all,
We are trying to express the following business logic: "IF there is no
LabEvent of type <T> in the last <N> days THEN raise an alert".
Where <T> and <N> are:
"INR", 7
"CBC", 14
"AST", 30
etc.
writing this in DRL will be something like:
when not exist ( LabEvent(type==T && eval(inLastNDays(date,N))))
On first look, this looks as a classical decision table. Each column in a DT
is a field constraint. But, where can we write the 'not exist' expression?
In addition, is there an easy way to see the rules (in DRL) generated from a
DT?
Thanks for the help, Yoni
--
View this message in context: http://www.nabble.com/%27not-exist%27-and-decision-tables-tp18728156p1872...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
Discover when a rule isn't more active
by Claudio Rainoldi
Hi everyone,
isn'it there a way to find when a rule isn't more active.
For example if i have this rule:
rule "light 2 on"
dialect "java"
when
Light (name=="0/0/2", actualvalue=="1");
then
System.out.println("luce 2 on");
end
when someone turn on the light 2 i discover that the rule is fired using an
Agenda Event Listener and the method afterActivationFired;
But when someone turn off the ligth isn't there a similar way to discover
that the rule "light 2 on" isn't more active.
My only solution is to use the dual rule:
rule "light 2 on_dual"
dialect "java"
when
not (Light (name=="0/0/2", actualvalue=="1"));
then
System.out.println("luce 2 off");
end
Isn't there a more sample way to do this?
Thanks in advance.
Cla
16 years, 7 months