Re: [rules-users] Basic doubt regarding Drools Fusion - @expires
by Greg Barton
Yes, but I just fired up a small project using it and it used 100% of CPU. If you build the attached project you'll see the tests run just fine. (They use fireAllRules.) If you launch from the commandline, ("java -jar target/DroolsBoxes-1.0.jar") which uses fireUntilHalt, the rules fire (and complete) just fine, but it continues to use 100% of a cpu core indefinitely. This is with 5.1.1. If I change the drools version to 5.2.0-SNAPSHOT it compiles but the tests won't run. They all fail with the following exception:
java.lang.NoSuchMethodError: org.drools.spi.DeclarationScopeResolver.<init>([Ljava/util/Map;Ljava/util/Stack;)V at org.drools.rule.builder.RuleBuildContext.<init>(RuleBuildContext.java:72) at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1198) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:629) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:278) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:451) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28) at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:75) at com.sample.DroolsTest.go(DroolsTest.java:31) at com.sample.BoxTest.test0(BoxTest.java:21)
--- On Thu, 3/17/11, Edson Tirelli <ed.tirelli(a)gmail.com> wrote:
From: Edson Tirelli <ed.tirelli(a)gmail.com>
Subject: Re: [rules-users] Basic doubt regarding Drools Fusion - @expires
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Thursday, March 17, 2011, 10:47 AM
To be honest, I believe so, but didn't profiled it extensively. I used fireUntilHalt() in my Webinar yesterday on a live demo and it worked nicely.
Edson
2011/3/17 Greg Barton <greg_barton(a)yahoo.com>
Has the performance problem with fireUntilHalt been fixed in 5.2?
--- On Thu, 3/17/11, Makewise - Vitor Rui Mendonça <Vitor.Mendonca(a)brisa.pt> wrote:
From: Makewise - Vitor Rui Mendonça <Vitor.Mendonca(a)brisa.pt>
Subject: Re: [rules-users] Basic doubt regarding Drools Fusion - @expires
To: "'Rules Users List'" <rules-users(a)lists.jboss.org>
Date: Thursday, March 17, 2011, 7:01 AM
Hi Thomas, thanks for the info!
I googled it quite a bit and I think it’s a path to be explored, albeit I’ve saw several messages on the mailing list regarding performance issues
when using fireUntilHalt.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
-----Inline Attachment Follows-----
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 9 months
Basic doubt regarding Drools Fusion - @expires
by Makewise - Vitor Rui Mendonça
Hi all!
I’ve got a really basic doubt… I’ve read several documentation regarding it but I think I need some advice here…
Imagine that I have an event:
declare A
@role( event )
@expires( 1h )
end
On my Java code, I call “fireAllRules()” method every time that I put an event into the working memory.
My doubt: When does event A expires?
a) One hour after it was inserted (time-based and without the “fireAllRules()” method call) or
b) by calling “fireAllRules()” method (event-based)
T.I.A.
Vítor Mendonça Moreira
Analista / Programador
Direcção de Investigação e Desenvolvimento
Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq.
2500 - 206 - Caldas da Rainha
Tel: (+351) 262 832 196
Fax: (+351) 262 186 455
Web: www.makewise.pt<http://www.makewise.pt>
Uma empresa: Grupo Sousa Pedro<http://www.sousapedro.com>
[cid:image002.jpg@01CBE3EF.C9596900]
________________________________
Declaração:
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador,sem os reproduzir.
Disclaimer:
The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy.
________________________________
13 years, 9 months
Re: [rules-users] drools design question
by Esteban Aliverti
You could also use drools (maybe a decision table) to select the different
drl files.
Best regards,
El mar 16, 2011 8:24 p.m., "marunam" <sutavis(a)gmail.com> escribió:
Hi,
We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.
Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls.
Is this approach recommended? Do you have any suggestions?
Thanks
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-questio...
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
13 years, 9 months
Custom dates with @date-effective and @date-expires
by Faisal Shafique
Hi,
Can I use any arbitrary date for the drools execution so that correct rules are fired based on not current date but any arbitrary date? This is in the context of @date-effective and @date-expires metadata that can be specified as part of a rule. Drools expert documentation seems to imply that this metadata uses "current date" though I am not clear what current date (system date?) means.
Thanks
Faisal Shafique
13 years, 9 months
Problem with Drools debuggin in Eclipse Reg:
by Murali Venugopal
Hi,
I'm encountering a strange problem with debugging an Drools application
in Eclipse Platform. I couldn't find any help in the internet. Also, i
can't find any previous post in this mailing list. Please try to help me.
My Platform details are below:
OS: Fedora 13
Eclipse: Galileo
Java: JDK 1.6 Update 21
Drools version: 5.1.1
Snapshot of the Error message:
*Console Output:*
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports
initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
*Event Details:*
**
*Message:*
An internal error occurred during: "Launching DroolsTest (4)".
*Exception Stack Trace:*
java.lang.IncompatibleClassChangeError: Expected static method
org.drools.eclipse.launching.DroolsVMDebugger.renderCommandLine([Ljava/lang/String;)Ljava/lang/String;
at
org.drools.eclipse.launching.DroolsVMDebugger.run(DroolsVMDebugger.java:182)
at
org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:101)
at
org.drools.eclipse.launching.DroolsLaunchConfigurationDelegate.launch(DroolsLaunchConfigurationDelegate.java:30)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Thanks in advance.
Regards,
_ _ _ _ |.
| | ||_|| (_||| \/
Get your world in your inbox!
Mail, widgets, documents, spreadsheets, organizer and much more with your Sifymail WIYI id!
Log on to http://www.sify.com
********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin(a)sifycorp.com
13 years, 9 months
Open file leak in Drools Compiler
by Chris Selwyn
I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish.
My deployable is an EJB that uses a StatelessKnowledgeSession to run
some rules that I get from a KnowledgeAgent that has a Changeset with a
.drl in it.
Therefore, I have placed the drools compiler into the deployable and it
all appears to work.
Glassfish has a clever little mechanism that, when you unload a
deployable that had some open streams, it tells you all about it (and
kindly closes them).
Glassfish is reporting that InputStreams are being left open that were
opened in the isPackage() method of
org.drools.commons.jci.compilers.EclipseJavaCompiler.
That method has the following code in it:-
final InputStream is =
pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName));
if (is != null) {
return false;
}
So, when "is" is not null (i.e. open), it is forgotten about and not closed.
Isn't this a potential file handle leak?
Chris Selwyn
13 years, 9 months
Drools server link to Guvnor repository
by Sébastien Raickman
Hi all,
I would like to connect to drools-server with HTTPClient with the following
config:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://drools.org/schema/drools-spring
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-containe..."><drools:execution-node
id="node1" /> <drools:kbase id="kbase1"
node="node1"/>
<drools:kagent id="kagent1"
kbase="kbase1">
<drools:resources>
<drools:resource type="CHANGE_SET" source="classpath:changeset.xml"
/>
</drools:resources>
</drools:kagent>
<drools:ksession id="ksession1"
type="stateless" kbase="kbase1" node="node1"/>
</beans>
where my changeset.xml is adding a snapshot deployed with Guvnor.
But I am not able to trig the rule with the following client:
BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();
command.setLookup("ksession1");
InsertObjectCommand insertObjectCommand = new InsertObjectCommand("TEST");
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
command.getCommands().add(insertObjectCommand);
command.getCommands().add(fireAllRulesCommand);
String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setHost("host", 8080);
PostMethod postMethod = new
PostMethod("/drools-5.1.1-server/kservice/rest/execute");
postMethod.setRequestEntity(new StringRequestEntity(xml, null, null));
try {
httpClient.executeMethod(postMethod);
int code = postMethod.getStatusCode();
System.out.println(code);
String rep = postMethod.getResponseBodyAsString();
System.out.println(rep);
} catch(Exception e) {...}
Do someone have any idea how to achieve this?
Thanks
Sebastien
13 years, 9 months
[Urgent] Error in ontext assist in DSLR Editor
by hamza bakkali
Hi All,
I have been using drools 4 for couple of months now and I am starting to get
the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2
(Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor:
Context Assist + space + enter removes/replaces the whole line, not only the
place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context
menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit
ctrl space, id1 shows in the list. I hit enter the whole line disappear, and
I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
13 years, 9 months
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
by John Peterson
I'm working in Eclipse only right now, but not using DSL for this particular situation (yet). I've manage to make the error go away by removing the package name from drools.package, however, when I attempt to run the code that builds the application to run the rule, it fails to resolve the Object (Fact) used in the rule.
Copying the generated DRL to a .drl file works fine.
>Date: Wed, 16 Mar 2011 18:20:33 +0100
>From: Vincent Legendre <vincent.legendre(a)eurodecision.com>
>Subject: Re: [rules-users] Problems with Guided Rule Editor in Eclipse
>To: Rules Users List <rules-users(a)lists.jboss.org>
>Message-ID: <4D80F161.3080403(a)eurodecision.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>I was pretty sure to have seen something about sample BRL from Guvnor appears in error in eclipse.
>I can find some on JIRA, but never the same problem I have ... May be on another forum, but not JIRA ...
>
>Anyway, my problem is using DSL in BRL opened with eclipse plugin Guided Editor. Seems that the transformation to DRL is incomplete for DSL
>sentences, and action part cannot add DSL sentences. I will try with the last version and see if it is still there, and then post a clear new JIRA...
>
>But, re-reading your post, may be your problem is different ... As far I can remember, BRL with no DSL in it works ok ... try to copy your generated DRL >in a new DRL file to see what happens
13 years, 9 months
drools design question
by marunam
Hi,
We are developing an insurance application and we have decided to use drool
rules for our business rules
Now, we could have global business rules(applies to all states), specific to
state, specific to factor X, specific to factor Y etc. This way we are
expecting many drl files.
Now, when the application runs, we would know the values for state, factor
X, factor Y etc. and using these values we would determine(using database)
which drl files to load dynamically and just run the rules in those drls.
Is this approach recommended? Do you have any suggestions?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-questio...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 9 months