Drools-Fusion : Inserting an Event in to an "entry-point" stream in the RHS of a rule?? Pls help
by Chetan Mahadev
Hi
Can we insert an Event in the RHS part of a rule to an entry-point?
basically i am trying to do this. Pls let me know if this is possible? if
not any alternative approaches? Any example would be useful pls
declare TransactionEvent
@role( event )
end
$tmp : TestClass()
$tmp.message == "TRUE"
then
TransactionEvent ev1 = new TransactionEvent (); // This should be
inserted in to an entry-pont "Temporal Reasoning" stream
ev1.setMessage("Temporal Reasoning")
insert (ev1) to entry-point "Temporal Reasoning"
end
rule "Temporal Reasoning"
$tmp : TransactionEvent ( message== "Temporal Reasoning") from entry-point
"Temporal Reasoning"
then
System.out.println("Rule fired due to entry point ");
end
Regds
Chetan
14 years, 7 months
Problem with Guvnor 5.1.1, <save> frequently does not save...
by David Shields
I have spent several days writing rules and tests for them in Guvnor, and
kept having strange results. A test would sometimes fail, repeatedly, and
then finally start working after I would delete and recreate some portion
of it, or change a value.
After two of us spent many hours trying to identify the extent of the
problem, we concluded the following:
1. The problem happens under both IE and Firefox.
2. The problem happens less frequently under Firefox if we install and
turn on a third-party plug-in which disables Firefox caching web pages.
3. Saving a new rule or test will allow us to work with it (edit - save -
test scenarios). However, frequently the rule or test will just disappear
once we log out.
4. A "Save" and "Check-in" will often work correctly if we cross our
fingers and do the following:
a. Save it once (the screen updates, and you can check the
version history)
b. Refresh the browser
c. Make the change again
d. Save it a second time
5. After doing a "Save" and "Check-in", you can immediately do a "view
source" and see your changes in place. However, if you then close the
test (or rule) and re-open it, you will often find that the change is
gone, and the test or rule looks like it did before you made the change.
A sample screenshot appears below. In this case, I created the test with
the "performedTime" set to 20-Sep-2008. I ran the test and it failed,
because the rule was checking for greater than or equal to 21-Sep-2008. I
then changed the date on the test to 21-Sep-2008, did a "save changes" and
a "Check-in", and then ran the scenario again.
As you can see below, the asserted object contains the date 20-Sep-2008,
even though the test clearly shows 21-Sep-2008.
Does anybody have any ideas on this? If I copy the above test into a new
test, it will often work the first time, but then it may disappear, once I
logout, even though it was saved and checked-in.
It almost seems like there is something wrong with the imbedded
repository, and / or the first running of the test created fact objects
that are persisting and being found the second time I ran the changed
test. ...
We are running the Final release of Drools Guvnor 5.1.1 found in
drools-5.1.1-guvnor.zip downloaded on 4-Sep-2010
We are running under Tomcat 6.0, with the recommended jar files replaced.
Thanks for your help!
--------------------------------------------------
David Shields
Division of Clinical Informatics
Department of Community and Family Medicine
Duke University Medical Center
Phone (864) 787-8551
14 years, 7 months
How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
14 years, 8 months
drools - packaging creates a full snapshot...why?
by jcrowe
I have been using drools for almost a year now and build several packages a
day. Things are starting to slow down a bit and I've started to wonder if
it is because of all the workspace copies and the jcr overhead of them. I
have implemented a deletion of old workspace copies but this made me wonder
why drools is doing (in RulesRepository):
this.session.getWorkspace().copy( source, newName );
its not like i need a copy, once the package is built, it doesn't seem to
'rebuild it' from this snapshot. I have no way of "recovering to" this
snapshot.
Anyone can help me with the reason behind the copy (perhaps why I shouldn't
just delete this copy? I'm sure there are side-effects of this I'm not
thinking of, etc., etc.,)
Any feedback is appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/drools-packaging-creates-a-full-snapsho...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 8 months
Common Practices for warning or debug rules/messages
by wendy
Hi,
I'm working on a system that has a large number of rules and we are
getting to the point where we think it would be useful to have some 'debug'
or 'warning' type rules (for lack of a better word). The warning rules
would be rules that would signal to us that something is wrong with the
underlying data and would require someone to go in and fix something. I was
wondering if there are some standard practice as to how to write, maintain,
format... these rules. I can think of a couple of ways to do this but I
would like the communities opinion. We would also like the ability to turn
on/off these debug or warning rules easily while the rest of the system
keeps on processing.
Thank you,
Wendy
--
View this message in context: http://drools.46999.n3.nabble.com/Common-Practices-for-warning-or-debug-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 8 months
Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
by Steven Waldren
Wolfgang,
The ActorType definition is here: https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/j...
The point of this rule (and the other rules in this package) is to "walk" through a very complex object graph and insert the objects into working memory.
I do not use the rule attribute "dialect". The drl in question is here: https://github.com/openhealthdata/CCR-Validator/blob/drools5.0/src/main/r...
I tried to create a simple project that caused the same error, but I create a Class with inner classes similar to ActorType and write a rule like the one in question, but it does not cause the error.
Thanks,
Steven
--
Steven E. Waldren, MD MS
Co-founder, Open Health Data
On Jun 29, 2011, at 2:49 AM, rules-users-request(a)lists.jboss.org wrote:
> Date: Wed, 29 Jun 2011 09:49:10 +0200
> From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
> Subject: Re: [rules-users] Drools 5.0 -> 5.2 Migration Issue
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <BANLkTin04ytQVP6T3tdR6j8ZjUKCO9Rvyw(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Please provide the type declaration for ActorType.Person, field gender and
> typicial examples how gender fields are used in other rules. Ideally, if you
> could reduce your rule set to this simple rule and one other rule, still
> causeing the same problem.
>
> Also, do you use "dialect 'mvel'"?
>
> -W
14 years, 8 months
Date arithmetic in when part
by rouvas@mm.di.uoa.gr
Hi list,
I feel this should be an elementary question but unfortunately I haven't
been able to find a solution.
I would like to perform date arithmetic in the when part of a rule.
For example, I would like to express something like:
rule "Date compare rule"
dialect "mvel"
when
a : A()
b : B( a.creationDate <= b.creationDate after 3 months)
then
...
end
Apart from using eval()'s is there any other way to express these types of
comparisons?
Thank you for your time,
-Stathis
14 years, 8 months