Re: [rules-users] rules-users Digest, Vol 39, Issue 62
by Nilima R
Hi,
Could you please explain the use of XML and word docs uploaded , some
examples ,can I refer these files in the rules which I write in Guvnor .
Hi,
When you upload files to Guvnor XML and .properties files are stored
under XML, properties and everything else for example Word files or PDF
files go to Other assets, documentation.
Toni
Nilima R wrote:
>
> Can you please explain the use of "*XML,properties*" and "*Other
> assets ,documentation*" links available in Guvnor.
>
>
>
> Thanks,
Nilima
From:
rules-users-request(a)lists.jboss.org
To:
rules-users(a)lists.jboss.org
Date:
02/23/2010 02:11 PM
Subject:
rules-users Digest, Vol 39, Issue 62
Sent by:
rules-users-bounces(a)lists.jboss.org
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Dynamicc Declarative model in Guvnor (Nilima R)
2. Comparing Date with || OR operator (dhari)
3. Drools Guvnor (Nilima R)
4. Re: AGE problem (djb)
5. Re: Drools Guvnor (Toni Rikkola)
6. Re: AGE problem (Wolfgang Laun)
7. Natural Language (Amit Kumar)
8. Re: AGE problem (Pavel Tavoda)
----------------------------------------------------------------------
Message: 1
Date: Tue, 23 Feb 2010 11:11:26 +0530
From: Nilima R <nilima.r(a)tcs.com>
Subject: [rules-users] Dynamicc Declarative model in Guvnor
To: rules-users(a)lists.jboss.org
Message-ID:
<OFFE53C447.246EB602-ON652576D3.001EE694-652576D3.001F42AA(a)tcs.com>
Content-Type: text/plain; charset="us-ascii"
Hi All,
Can we have a dynamic declarative model build in Drools Guvnor.
For example if I have certain tables in database say employee, company,
address ,can we have a drop down for these tables so that end user can
select any one one and based on that selection model in Guvnor is
created.
At present we specify the names of the model say employee and then add
fields into it. say employee ID etc.
Many Thanks,
Nilima
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100223/ffe4d37...
------------------------------
Message: 2
Date: Mon, 22 Feb 2010 22:15:08 -0800 (PST)
From: dhari <sdhari(a)hotmail.com>
Subject: [rules-users] Comparing Date with || OR operator
To: rules-users(a)lists.jboss.org
Message-ID: <1266905708400-347656.post(a)n3.nabble.com>
Content-Type: text/plain; charset="utf-8"
The following code generates NPE in ReteTuple.java
rule
when
Membership ( $regDate : regDate)
Segment ( startDate < $regDate || startDate > endDate )
then
System.err.print(?Invalid start date?);
end
I am new in Drools and don?t know much about DRL scripting. It works fine
I
use && operator instead.
--
View this message in context:
http://n3.nabble.com/Comparing-Date-with-OR-operator-tp347656p347656.html
Sent from the Drools - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100222/dc6db21...
------------------------------
Message: 3
Date: Tue, 23 Feb 2010 11:48:19 +0530
From: Nilima R <nilima.r(a)tcs.com>
Subject: [rules-users] Drools Guvnor
To: rules-users(a)lists.jboss.org
Message-ID:
<OF0A3F231B.87AA84AC-ON652576D3.00226E0A-652576D3.0022A312(a)tcs.com>
Content-Type: text/plain; charset="us-ascii"
Can you please explain the use of "XML,properties" and "Other assets
,documentation" links available in Guvnor.
Thanks,
Nilima
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100223/52b2be4...
------------------------------
Message: 4
Date: Mon, 22 Feb 2010 23:07:55 -0800 (PST)
From: djb <dbrownell83(a)hotmail.com>
Subject: Re: [rules-users] AGE problem
To: rules-users(a)lists.jboss.org
Message-ID: <1266908875778-354847.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
I think though that the majority of uses for a rules engine is in a
business
context, where they don't use astronomical time.
If the doctor's orders are:
"You cannot get out of bed for 2 months"
This means 59 days if he told you February 1st, and it means 62 days if he
told you July 1st.
So at least for me, I am going to have to work out a plan that involves
GregorianCalendar.
--
View this message in context:
http://n3.nabble.com/AGE-problem-tp215215p354847.html
Sent from the Drools - User mailing list archive at Nabble.com.
------------------------------
Message: 5
Date: Tue, 23 Feb 2010 09:07:21 +0200
From: Toni Rikkola <trikkola(a)redhat.com>
Subject: Re: [rules-users] Drools Guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <4B837EA9.1070806(a)redhat.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi,
Could you explain the use of XML and word docs uploaded , some examples
,can I refer these files in the rules which i write in Guvnor .
Hi,
When you upload files to Guvnor XML and .properties files are stored
under XML, properties and everything else for example Word files or PDF
files go to Other assets, documentation.
Toni
Nilima R wrote:
>
> Can you please explain the use of "*XML,properties*" and "*Other
> assets ,documentation*" links available in Guvnor.
>
>
>
> Thanks,
> Nilima
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
------------------------------
Message: 6
Date: Tue, 23 Feb 2010 08:50:38 +0100
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] AGE problem
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<17de7ee81002222350h62ae932an3058353f68204e7f(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Tue, Feb 23, 2010 at 8:07 AM, djb <dbrownell83(a)hotmail.com> wrote:
>
> I think though that the majority of uses for a rules engine is in a
> business
> context, where they don't use astronomical time.
>
> If the doctor's orders are:
> "You cannot get out of bed for 2 months"
>
> This means 59 days if he told you February 1st, and it means 62 days if
he
> told you July 1st.
>
>
This is a particularly bad example, because doctors can't say that - at
least not one I'd trust ;-)
I'm arguing that you cannot expect a computer program to relieve you from
the burden of defining what you mean by a "duration of one year" (or
month).
Some legal rules require a person to have a certain age, and it is (for
humans)
more convenient to decide this on a person's birthday YMD plus an
increment
in the Y number. If your application requires you to use an increment in
the year
component of the YMDhms representation of a point in time, then you are
indeed stuck with Calendar and the resulting overhead. (Memoizing
the results of YMDhms +/- n years might speed things up, for the usual
price.)
But many applications would be satisfied with using a fixed duration for
a year in terms of 365 or 365.25 or some such value. If, for instance, you
have a library, and you must decide to move a book into deep storage
"if it has not been requested for more than a year" you might calculate
this (faster) by adding 356*24*60*60 to the clock value of the last
return.
-W
So at least for me, I am going to have to work out a plan that involves
> GregorianCalendar.
>
> --
> View this message in context:
> http://n3.nabble.com/AGE-problem-tp215215p354847.html
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100223/3459eff...
------------------------------
Message: 7
Date: Tue, 23 Feb 2010 00:21:38 -0800
From: Amit Kumar <amitkumar(a)gmail.com>
Subject: [rules-users] Natural Language
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<33ab2d6e1002230021k249523efsfa8620157b0538f3(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi All,
As you might have understood with my so many questions :) I am looking at
the capabilities of Drools and our team is looking at a comparitive
analysis
between Drools and ILOG
One of the feature which is greatly desired is natural language editor. So
I
am planning to create my own DSL creator "Poor man's version" which will
introspect the class and generate some DSLs for our need.
An old Blog
http://blog.athico.com/2007/03/standards-based-approach-to-natural.html
points
to an interesting article. Does anybody knows where this item is in the
roadmap.
Another suggestion I had was on the Roles and Permissions for the users.
There is a option in drools to permit access for a user to a package and
category. It would be good to add Status to the mix so that the novide
user
is prevented from moving rules to production. Small change.. big gain :)
Does anybody has a pointer to a demo of drools showing its capabilities.
Or
a comparitive analysis with ILOG.
We are able to show lot of good use for the tool.. but the data model we
have is causing us big headaches in writing easily understandable rules.
The scenario is that we have a "lot" of attributes of a fact. And as part
of
model extension lot of attributes are constantly added to the fact.
To make this easier so that we do not have to update the model - we have
put
a (key value pair) for the attributes.
So the model structure is
MainFact
mainAttr1 String
mainAttr2 String
List additionalAttrs<AdditionalAttributes> = new
ArrayList<AdditionalAttributes>();
AdditionalAttributes
attrName String
attrValue String
So now in guided editor or DSl editor it becomes a nightmare to write a
rule.. and our rule writers will beat us up if we ask them to write a rule
like
aa: AdditionalAttributes (attrName == "var1", val : attrValue)
a: MainFact (mainAttr1 == "mainVal", additionalAttrs contains aa)
Any easy solution for this :)
Thanks,
Amit
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100223/76ede08...
------------------------------
Message: 8
Date: Tue, 23 Feb 2010 09:30:32 +0100
From: Pavel Tavoda <pavel.tavoda(a)gmail.com>
Subject: Re: [rules-users] AGE problem
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e3e2e4b61002230030n28669a78l72d4dffa68c4b765(a)mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Try to do this in bank application. People come 1 hour after they date
expired and try to charge them for sooner withdrawal because you
calculate with 365.25 not 365 days. You will be kicked, believe me.
Pavel
2010/2/23 Wolfgang Laun <wolfgang.laun(a)gmail.com>:
> On Tue, Feb 23, 2010 at 8:07 AM, djb <dbrownell83(a)hotmail.com> wrote:
>>
>> I think though that the majority of uses for a rules engine is in a
>> business
>> context, where they don't use astronomical time.
>>
>> If the doctor's orders are:
>> "You cannot get out of bed for 2 months"
>>
>> This means 59 days if he told you February 1st, and it means 62 days if
he
>> told you July 1st.
>>
>
> This is a particularly bad example, because doctors can't say that - at
> least not one I'd trust ;-)
>
> I'm arguing that you cannot expect a computer program to relieve you
from
> the burden of defining what you mean by a "duration of one year" (or
month).
> Some legal rules require a person to have a certain age, and it is (for
> humans)
> more convenient to decide this on a person's birthday YMD plus an
increment
> in the Y number. If? your application requires you to use an increment
in
> the year
> component of the YMDhms representation of a point in time, then you are
> indeed stuck with Calendar and the resulting overhead. (Memoizing
> the results of YMDhms +/- n years might speed things up, for the usual
> price.)
>
> But many applications would be satisfied with using a fixed duration for
> a year in terms of 365 or 365.25 or some such value. If, for instance,
you
> have a? library, and you must decide to move a book into deep storage
> "if it has? not been requested for more than a year" you might calculate
> this (faster) by adding 356*24*60*60 to the clock value of the last
return.
>
> -W
>
>> So at least for me, I am going to have to work out a plan that involves
>> GregorianCalendar.
>>
>> --
>> View this message in context:
>> http://n3.nabble.com/AGE-problem-tp215215p354847.html
>> 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
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 39, Issue 62
*******************************************
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 9 months
Natural Language
by Amit Kumar
Hi All,
As you might have understood with my so many questions :) I am looking at
the capabilities of Drools and our team is looking at a comparitive analysis
between Drools and ILOG
One of the feature which is greatly desired is natural language editor. So I
am planning to create my own DSL creator "Poor man's version" which will
introspect the class and generate some DSLs for our need.
An old Blog
http://blog.athico.com/2007/03/standards-based-approach-to-natural.html points
to an interesting article. Does anybody knows where this item is in the
roadmap.
Another suggestion I had was on the Roles and Permissions for the users.
There is a option in drools to permit access for a user to a package and
category. It would be good to add Status to the mix so that the novide user
is prevented from moving rules to production. Small change.. big gain :)
Does anybody has a pointer to a demo of drools showing its capabilities. Or
a comparitive analysis with ILOG.
We are able to show lot of good use for the tool.. but the data model we
have is causing us big headaches in writing easily understandable rules.
The scenario is that we have a "lot" of attributes of a fact. And as part of
model extension lot of attributes are constantly added to the fact.
To make this easier so that we do not have to update the model - we have put
a (key value pair) for the attributes.
So the model structure is
MainFact
mainAttr1 String
mainAttr2 String
List additionalAttrs<AdditionalAttributes> = new
ArrayList<AdditionalAttributes>();
AdditionalAttributes
attrName String
attrValue String
So now in guided editor or DSl editor it becomes a nightmare to write a
rule.. and our rule writers will beat us up if we ask them to write a rule
like
aa: AdditionalAttributes (attrName == "var1", val : attrValue)
a: MainFact (mainAttr1 == "mainVal", additionalAttrs contains aa)
Any easy solution for this :)
Thanks,
Amit
14 years, 9 months
Drools Guvnor
by Nilima R
Can you please explain the use of "XML,properties" and "Other assets
,documentation" links available in Guvnor.
Thanks,
Nilima
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 9 months
Dynamicc Declarative model in Guvnor
by Nilima R
Hi All,
Can we have a dynamic declarative model build in Drools Guvnor.
For example if I have certain tables in database say employee, company,
address ,can we have a drop down for these tables so that end user can
select any one one and based on that selection model in Guvnor is
created.
At present we specify the names of the model say employee and then add
fields into it. say employee ID etc.
Many Thanks,
Nilima
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 9 months
Drools Ant task packages not read by KnowledgeAgent
by Gerret Hansper
Hi all,
for deploying our rules we usually create packages in Guvnor
and then deploy the .pkg binaries to our application where we access them
via a change set file, e.g. as a classpath or url resource.
We have also used the Drools Ant task to create packages directly from
the rule sources in Eclipse, cause it would be convenient for testing and
development purposes to be able to just drop that file in place of the one
created from Guvnor.
However it seems that the KnowledgeAgent can't read the pkg format produced
from the Ant task, we get an Exception as follows:
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources
(KnowledgeAgentImpl.java:418)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet
(KnowledgeAgentImpl.java:120)
...
Caused by: java.lang.ClassCastException: org.drools.reteoo.ReteooRuleBase
at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources
(KnowledgeAgentImpl.java:413)
We are using the same drools-core.jar for building and running so I don't think
this is a simple class version mismatch.
Has anybody got a similar scenario working? Any clue what we might be doing
wrong? (We are using Drools 5.0.1.)
Thanks,
Gerret
14 years, 9 months
Trying to build Drools trunk / getting build failure
by Chuck Irvine
I'm trying to build Drools from the trunk. I updated from svn about 10
minutes ago.
My build command was:
>mvn -Declipse -Ddocumentation clean install
-DlocalEclipseDrop=C:\tmp\drools\eclipse
The result of my build is given below.
I have two questions:
1. I'm a little confused about "-DlocalEclipseDrop=C:\tmp\drools\eclipse".
Is C:\tmp\drools\eclipse supposed to point to where I have eclipse
installed.
2. Does the fact that 2 tests errored out mean that my build produced
nothing useful?
Tests run: 184, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.203 sec
> Running org.drools.integrationtests.ProcessEventTest
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.211 sec
>
> Results :
>
> Tests in error:
>
> testUnmarshallingPerformance(org.drools.integrationtests.LargeRuleBaseSerializationTest)
>
> testUnmarshallWithCompressionPerformance(org.drools.integrationtests.LargeRuleBaseSerializationTest)
>
> Tests run: 1306, Failures: 0, Errors: 2, Skipped: 1
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] There are test failures.
>
> Please refer to
> C:\Users\Chuck\workspace\drools-trunk\drools-compiler\target\surefire-reports
> for the individual test results.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 9 minutes 14 seconds
> [INFO] Finished at: Sun Feb 21 15:35:42 CST 2010
> [INFO] Final Memory: 27M/49M
> [INFO]
> ------------------------------------------------------------------------
>
14 years, 9 months
How many KnowledgeBases?
by Laird Nelson
Forgive me for what I suspect is an elementary question. That said, I did
not see it explained in newcomer-friendly language in the documentation, if
at all. And I'm a newcomer!
I'm working on a system for--among other things--pricing things. Drools
Expert is a great fit for this.
The system also has to do other things that have nothing to do with pricing
(let's say shipping, to keep it simple). There are places where Drools
Expert is a great fit for this as well.
In both cases, let's assume I might insert a given product into the engine,
turn the crank, and collect my results. But the kinds of results I'm
looking for--and the kinds of calculations I would expect to be
performed--are quite different in each case.
So, let's assume that--naively speaking here--when I insert the product and
{handwave handwave} I "know" I'm doing pricing work, then I only need
pricing-related rules to fire (I don't need the, say,
product-color-determining rules to fire, or the
can-the-product-be-shipped-to-Abu-Dhabi rules to fire, or the
how-many-people-liked-this-product rules to fire, etc.).
And when I insert the product and {handwave handwave} I "know" I'm
doing--whatever--shipping work, then I don't need the pricing rules to even
be considered.
I found this (http://n3.nabble.com/Grouping-rules-td55531.html#a55531) as
perhaps one way of creating different sets of rules to be evaluated in
different contexts. This smelled very arcane to me for this purpose,
but...? perhaps it's the way to go?
Another is obviously to create *n* KnowledgeBases, each with its own set of
rules, where *n* is the number of contexts or activities or types of
activities that I'm performing. Then I'd look up the (pre-created)
KnowledgeBase
appropriate for the particular calculation I need performed. That seems
like solving the problem with a crowbar, a length of iron pipe and a
blowtorch. Ick.
Is there an accepted/preferred way to handle this sort of thing?
Agenda-groups seem...well, perhaps they'd work, but it seems awfully arcane
for something that I was hoping would be a little more end-user friendly.
Quoting the Expert manual:
When Should You Use A Rule Engine?
> [...]
> Domain experts often possess a wealth of knowledge about business rules and
> processes. They typically are nontechnical, but can be very logical. Rules
> can allow them to express the logic in their own terms. Of course, they
> still have to think critically and be capable of logical thinking.
>
My domain users would almost certainly not think in terms of agenda groups.
Perhaps I could hide this in a DSL or something, but it seems to me there
must be some facility built into Drools for separating collections of rules
into channels, or groups, or partitions, or.... Is there?
Best,
Laird
14 years, 9 months
Proper order for resource scanners and notifiers?
by ljnelson
Another newcomer question.
I have studied the javadocs, such as they are, for KnowledgeAgentFactory.
It seems to suggest, though not explicitly state, that one should invoke
some combination of ResourceChangeNotifier and ResourceChangeScanner to
cause the KnowledgeAgent to become aware of new rule bases.
Then it says that both services must be started, even though both services
are presumably not aware of each other.
And none of the sample code actually seems to hook the notifier up to the
scanner.
Then, it also looks like the KnowledgeAgent (Impl) itself wires these two
things up. But it seems to do it backwards (to my way of thinking): the
scanner is added to the notifier?
Somewhere around here is where my eyes start to glaze over. :-D
What is the proper sequence for setting up a knowledge agent so that the
file system is scanned, say, every 30 seconds? The KnowledgeAgentFactory
documentation looks like it *wants* to explain this, but doesn't get all the
way there.
Just want to make sure I'm doing everything right.
Thanks,
Laird
--
View this message in context: http://n3.nabble.com/Proper-order-for-resource-scanners-and-notifiers-tp2...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Disable rules at runtime to make sure they get executed only once
by Malinda Kaushalye
Hi All,
I need to write a set of rules that each get executed only ONCE. However, the conditions are met at different stage of execution as events are coming thru a stream. Therefore I need to disable each rule at different stages.
I was looking for some mechanism to disable a rule after it gets executed. Something like this.
rule "myExecuteOnlyOnceRule"
when
//some condition tat evaluate events
then
this.rule.disable() / disable(drools.getRule())
end
Let me know if you know such a function or a workaround for this issue.
Cheers,
Malinda
14 years, 9 months
Log messages are in not in the expected order
by Malinda Kaushalye
Hi All,
Im writing an event driven application where I need to log
1. When a particular event get triggered.
2. When a particular event pattern (condition) is matched.
Events are fired both in the Java code as well as within the drools rule RHS.
Event patterns are matched in the drools LHS.
The issue is the logged message of firing an event is recorded after the LHS evaluation is matched. This happens when the event is fired within the Java code.
e.g. Let's assume there is a precondition (e1 && e2) of a rule. The event e1 is fired by the Java code and event e2 is fired by the RHS of a rule.
In that case the record sequence is
- e2 fired
- (e1 & e2) evaluated
- e1 fired.
The above seems wrong isn't it? It should be
- e1 fired
- e2 fired
- (e1 & e2) evaluated
I use log4j for logging. But this is the case even when I tried System.out.println
Any clue?
Cheers,
Malinda
14 years, 9 months