Re: [rules-dev] Dealing with null pointer exceptions thrown by parsing rules
by David Sinclair
Doh! Thanks Greg, i didn't realize it was on dev.
Yes, there should be joins if there are multiple Facts. I am used to people
here just asserting one object and reasoning over it; because you know,
rule engines aren't good at handling many facts ;)
On Tue, Feb 24, 2009 at 1:34 PM, Greg Barton <greg_barton(a)yahoo.com> wrote:
> David, please don't take this to be picking on you, but the rule you wrote
> wasn't quite correct. :)
>
> when
> $f : Fact()
> Detail(fact == $f, name == "END_SET", value == true)
> Detail(fact == $f, name == "SET", value = 1)
> Detail(fact == $f, name == "PLAYER1_SCORE", $score1 : value)
> Detail(fact == $f, name == "PLAYER2_SCORE', value < $score1)
> then
> ...
> end
>
> Match the Details to their parent Fact. I just want to make sure the newb
> doesn't get a combinatorial explosion and run screaming. :)
>
> And, not picking on both of you, but this should be on rules-users and not
> rules-dev.
>
> --- On Tue, 2/24/09, David Sinclair <dsinclair(a)chariotsolutions.com>
> wrote:
>
> > From: David Sinclair <dsinclair(a)chariotsolutions.com>
> > Subject: Re: [rules-dev] Dealing with null pointer exceptions thrown by
> parsing rules
> > To: "Rules Dev List" <rules-dev(a)lists.jboss.org>
> > Date: Tuesday, February 24, 2009, 12:13 PM
> > Alex, please don't take this to be picking on you; this
> > is more a post to
> > everyone whom reads these forums.
> >
> > You are not writing procedural, object-oriented, or
> > functional code. You are
> > writing rules to look for patterns of objects. If
> > everything is done in an
> > eval you are losing the majority of the benefits of using a
> > rule engine, e.g
> > node sharing, indexing, etc. Flesh out your object model.
> > Assert all of your
> > objects into Working Memory. This will allow you to reason
> > over anything
> > without using evals.
> >
> > OK -- rant off --
> >
> > Alex, you may want to try and refactor your model to be
> > more "rules
> > friendly". That way your could write rules more like
> > the following.
> >
> > when
> > $f : Fact()
> > Detail(name == "END_SET", value == true)
> > Detail(name == "SET", value = 1)
> > Detail(name == "PLAYER1_SCORE", $score1 :
> > value)
> > Detail(name == "PLAYER2_SCORE', value <
> > $score1)
> >
> > On Tue, Feb 24, 2009 at 12:39 PM, Zevenbergen, Alex <
> > azevenbergen(a)paddypower.com> wrote:
> >
> > > Thanks for replying.
> > >
> > >
> > >
> > > rule "Player 1 wins first set "
> > >
> > > when
> > >
> > > $f : Fact()
> > >
> > > eval
> > ($f.getDetails().get("END_SET").toString() ==
> > "true" &&
> > Integer.valueOf($f.getDetails().get("SET").toString())
> > > == 1 &&
> > Integer.valueOf($f.getDetails().get("PLAYER1_SCORE").toString())
> > >
> > >
> > Integer.valueOf($f.getDetails().get("PLAYER2_SCORE").toString()))
> > >
> > > then
> > >
> > > //then settle selection;
> > >
> > > end
> > >
> > >
> > >
> > >
> > >
> > > this rules runs perfectly as long as the hashmap
> > contained in the ‘fact’
> > > object has all the required keys and their values are
> > not null. For the time
> > > being I have just changed any null values to a value
> > of ‘DEFAULT’ but it
> > > would be preferable to be able to look for
> > f.getDetails().get("END_SET") (for
> > > example) knowing that the engine that sent it might
> > not be in an end_set
> > > state so may not have added that key.
> > >
> > >
> > >
> > > That example is very basic but as I create more rules
> > for more sports it
> > > could become very cumbersome to have to ensure that
> > every key referenced in
> > > the rules is in the hashmap each time!
> > >
> > >
> > >
> > > Alex
> > > ------------------------------
> > >
> > > *From:* rules-dev-bounces(a)lists.jboss.org [mailto:
> > > rules-dev-bounces(a)lists.jboss.org] *On Behalf Of
> > *David Sinclair
> > > *Sent:* 24 February 2009 17:27
> > > *To:* Rules Dev List
> > > *Subject:* Re: [rules-dev] Dealing with null pointer
> > exceptions thrown by
> > > parsing rules
> > >
> > >
> > >
> > > I understand what you are saying Alex, but could you
> > post an example rule
> > > to see exactly how you are doing it? It may be that
> > you could simply rewrite
> > > the rule so you don't get the NPE.
> > >
> > > On Tue, Feb 24, 2009 at 4:24 AM, Zevenbergen, Alex
> > <
> > > azevenbergen(a)paddypower.com> wrote:
> > >
> > > Hi all,
> > >
> > >
> > >
> > > I have started writing my rules packages and so have
> > had a decent amount of
> > > success. However all my rules are based on value pairs
> > from a hashmap object
> > > that is contained within my fact object. This approach
> > works fine if the
> > > parameter the rule is looking for is in the map and
> > has a value.
> > >
> > >
> > >
> > > But I will need to be able to pass null values to the
> > rules (and expect
> > > them to just not fire any rule that looks for that
> > param), however this
> > > always throws a null pointer exception.
> > >
> > >
> > >
> > > So my question is: Is there any mechanism to deal with
> > this in drools.
> > >
> > >
> > >
> > > Simply setting all nulls to a default value isn’t
> > preferable in this
> > > situation as the app is going to be used by several
> > different sources and
> > > has to be able to take in many different types of
> > info.
> > >
> > >
> > >
> > > Thanking you,
> > >
> > >
> > >
> > > Alex
> > >
> > >
> > >
> > ________________________________________________________________________
> > > Privileged, confidential and/or copyright information
> > may be contained in
> > > this communication. This e-mail and any files
> > transmitted with it are
> > > confidential and intended solely for the use of the
> > individual or entity to
> > > whom they are addressed. If you are not the intended
> > addressee, you may not
> > > copy, forward, disclose or otherwise use this e-mail
> > or any part of it in
> > > any way whatsoever. To do so is prohibited and may be
> > unlawful. If you have
> > > received this email in error
> > > please notify the sender immediately.
> > >
> > > Paddy Power PLC may monitor the content of e-mail sent
> > and received for the
> > > purpose of ensuring compliance with its policies and
> > procedures.
> > >
> > > Paddy Power plc, Airton House, Airton Road, Tallaght,
> > Dublin 24 Registered
> > > in Ireland: 16956
> > >
> > ________________________________________________________________________
> > >
> > >
> > > _______________________________________________
> > > rules-dev mailing list
> > > rules-dev(a)lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-dev
> > >
> > >
> > >
> > >
> > ________________________________________________________________________
> > > Privileged, confidential and/or copyright information
> > may be contained in
> > > this communication. This e-mail and any files
> > transmitted with it are
> > > confidential and intended solely for the use of the
> > individual or entity to
> > > whom they are addressed. If you are not the intended
> > addressee, you may not
> > > copy, forward, disclose or otherwise use this e-mail
> > or any part of it in
> > > any way whatsoever. To do so is prohibited and may be
> > unlawful. If you have
> > > received this email in error
> > > please notify the sender immediately.
> > >
> > > Paddy Power PLC may monitor the content of e-mail sent
> > and received for the
> > > purpose of ensuring compliance with its policies and
> > procedures.
> > >
> > > Paddy Power plc, Airton House, Airton Road, Tallaght,
> > Dublin 24 Registered
> > > in Ireland: 16956
> > >
> > ________________________________________________________________________
> > >
> > > _______________________________________________
> > > rules-dev mailing list
> > > rules-dev(a)lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-dev
> > >
> > >
> > _______________________________________________
> > rules-dev mailing list
> > rules-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
15 years, 9 months
Unable to access a property of a query parameter in the query constraint (Drools 4.0.7)
by Przemysław Różycki
Hello,
I found some confusing thing while constructing queries.
Let's assume I have a simple model with 2 classes:
public static class Product {
private BigInteger productId;
public Product(int id) {
productId = BigInteger.valueOf((long)id);
}
public void setProductId(BigInteger productId) {
this.productId = productId;
}
public BigInteger getProductId() {
return productId;
}
}
public static class Relation {
private BigInteger productAID;
private Product productB;
public void setProductAID(BigInteger productAID) {
this.productAID = productAID;
}
public BigInteger getProductAID() {
return productAID;
}
public void setProductB(Product productB) {
this.productB = productB;
}
public Product getProductB() {
return productB;
}
}
It's not very sophisticated.
And I have a query:
query "Query_1" (Product $p)
$r : Relation( productAID == $p.productId )
end
The problem is, that, when I want to build a DRL with the query I've got
an error:
org.drools.rule.InvalidRulePackage: Not possible to directly access the
property 'productId' of declaration '$p' since it is not a pattern :
[Rule name=Query_1, agendaGroup=MAIN, salience=0, no-loop=false]
Unable to create restriction '[QualifiedIndentifierRestr: ==
$p.productId ]' for field 'productAID' in the rule 'Query_1' : [Rule
name=Query_1, agendaGroup=MAIN, salience=0, no-loop=false]
The question is: why?
Of course, all types are imported, etc.
Moreover, when I modify the query as a following:
query "Query_1" (Product $p)
$p1 : Product ( ) from $p
$r : Relation( productAID == $p1.productId )
end
then everything works fine.
Is it a desirable behaviour?
I hope the description above is enough to understand the problem, but if
anyone needed full Java source and DRLs, please, let me know.
Best regards,
--
Przemysław Różycki
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl
15 years, 9 months
Truth maintenance
by Andreas Volz
Hi,
I have a question concerning the truth maintenance mechanism in Drools:
Is it possible to exclude some preconditions from truth maintenance?
We want to implement a rule flow by using an attribute of a special
fact (ProcessPhaseController.phase).
We have some phases that we want to traverse. In each phase only some
of our rules should be activated.
Therefore all of our rules test for a certain phase; e.g.:
when
ProcessPhaseController(phase == ProcessPhase.EXEC)
...
When no rule of the current phase is activated, a special rule changes
the phase to the next one and the rules of the next phase are evaluated.
The problem now is that we have some rules with logical inserts. So
each time the phase is changed, all of these inserts are retracted.
To prevent this I would like to exclude the condition
"ProcessPhaseController(phase == ProcessPhase.EXEC)" from truth
maintenance. Is this possible?
Thanks in advance!
Cheers,
Andreas
--
Andreas Volz
Consultant
mailto:andreas.volz@valtech.de
Mobile: +49 173 5955343
Valtech GmbH
Zweigstraße 10
80336 München
Germany
Phone: +49 89 893242-0
Fax: +49 89 893242-31
http://www.valtech.de
Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672
15 years, 9 months
Re: Declarative Model Editor in Guvnor
by J Michael Dean
I create a new fact in Guvnor. I cannot directly edit the code, as
far as I can tell, and can only see the guided editor.
Next, I use the Guvnor plugin in Eclipse to check the asset out, and I
edit it in Eclipse. I then use the Guvnor .. commit command in the
guvnor plugin.
Then when I access Guvnor through the browser, the changes from
Eclipse are certainly there, but I no longer see a guided editor, but
rather, can directly edit the text.
This is all within the same package, just moving back and forth
between Guvnor and Eclipse.
There may be some switch on the Guvnor interface that I am completely
missing that would enable me to move back and forth between free text
editing and guided editing.
- Mike
no that doesn't sound correct ? can what you mean by import into
guvnor - you mean using the guvnor plugin ? or re-importing it by
creating a new package?
On Sun, Feb 22, 2009 at 5:02 AM, J Michael Dean <mdean77(a)comcast.net>
wrote:
> When I declare a very simple object in Guvnor and validate, save,
> build,
> etc. and then try to edit it, I get the guided editor. However, if
> I import
> that model to the IDE and edit it there, and commit it back, then in
> Guvnor
> I subsequently can edit the text directly. I cannot find a way to
> edit the
> text directly unless I go through this step of import to the IDE,
> and once I
> have handled it in the IDE, it appears I can no longer edit it with
> the
> guided editor in Guvnor.
>
> Is this the correct behavior?
15 years, 9 months
Re: [rules-users] Large Rule base failing? StackOverlowError
by Christie, Blair
My apologies for not being more specific.
The version of drools is 4.07 and the size is of the serialized file.
It is 2megs.
We do not currently have about 200 rules.
Cheers,
Blair
Message: 2
Date: Fri, 20 Feb 2009 22:16:40 +0000
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: Re: [rules-users] Large Rule base failing? StackOverlowError
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <499F2BC8.5050708(a)codehaus.org>
Content-Type: text/plain; charset="iso-8859-1"
Christie, Blair wrote:
>
> We are having a problem reading in large serialized files. We get a
> StackOverflow exception when the rules get to be 2m.
>
> Is there a way to overcome this without increasing the stack size?
>
What version of Drools?
You have 2 million rules? Just to be clear, was it working with 1.9
million rules? heh I'm intigued on what sort of app you are doing, could
you do a write up? I'm sure people would love to know about people using
a really large number of rules.
The limitation you reaching is a limitation of the standard
serialisation algorithm of the JDK, we would have to create a custom
marshaller to improve this further, which we may do in the future.
Unless someone from the community wants to do this? :)
Mark
>
>
> Blair Christie
>
> * *
>
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 9 months
BRL help.
by Diablo_UK
I'm relatively new to the world of Drools, so I apologize up front for what
might be silly questions.
I've written a couple of DRLs (rules) and got these working via a little bit
of java code hacked together by yours truely but really want to try to start
using the BRL editor within eclipse. This will hopefully demo to our
clients just how easy it will be to write rules.....
...well, it would be, if I could get them to work!
Unfortunately, I can't seem to get the rule to run. Now either this is my
java code (possibly) or the BRL is incorrect. The first thing I've noticed
is the generated DRL has '>' characters in certain places:
rule "package_mandatory_fields"
dialect "java"
ruleflow-group "PackageMetadata"
salience 100
when
>package : Package( description == "null" || product == "null" || provider
== "null" || versionMajor == "0" )
then
Log : "Package retracted"
>package.setProduct( "ABC" );
>update( package );
>retract( package );
end
I don't get any errors during compilation, so maybe this is a red-herring?
This is the code I am using to read the BRL file (please, this is prototype,
hence the hardcoded values!)
private static void buildFromBrl(PackageBuilder builder) throws Exception
{
//for now, hardcoded. Read BRL into a string then add to builder.
String curDir = System.getProperty("user.dir");
String fileName = curDir +
"\\src\\main\\rules\\package_mandatory_fields.brl";
File file = new File(fileName);
String fileAsString = FileUtils.readFileToString(file);
BRLPersistence read = BRXMLPersistence.getInstance();
BRLPersistence write = BRDRLPersistence.getInstance();
String outputDRL = write.marshal(read.unmarshal(fileAsString));
builder.addPackageFromDrl(new StringReader(outputDRL));
}
Does any of this make sense? Any help would be most appreciated at this
stage as I'm beginning to rip my hair out now!
--
View this message in context: http://www.nabble.com/BRL-help.-tp22102294p22102294.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 9 months
RE: rules-users Digest, Vol 27, Issue 59
by Kumar, Ravendra
Guvnor has a problem with IE 7 please keep this also in mind.
I am running it on google chrome successfully but not on IE7
Thanks
Ravendra
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of
rules-users-request(a)lists.jboss.org
Sent: 20 February 2009 16:59
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 27, Issue 59
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. Re: Problem with viewing the Business Rule Assets under the
Rules Package in Drools Guvnor (Toni Rikkola)
2. Re: Problem using KnowledgeAgent (Mark Proctor)
----------------------------------------------------------------------
Message: 1
Date: Fri, 20 Feb 2009 09:58:44 +0200
From: Toni Rikkola <trikkola(a)redhat.com>
Subject: Re: [rules-users] Problem with viewing the Business Rule
Assets under the Rules Package in Drools Guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <499E62B4.4010005(a)redhat.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi,
Do you have any user permissions set? It is possible that something is
not permitting you to see it. In that case this might be a bug, because
there is a way to get around it.
In the next Drools release the asset should also be visible in archives
after you have archived the package.
Toni Rikkola
guyt1122(a)aim.com wrote:
> Hello,
>
> I have noticed a strange behavior with the Drools Guvnor where I can
> not see any of my web guided decision table from the Rules Package
> "Business Rule Asset" view. I can navigate to this decision table
> using the "Assets View" and when I click on the "more info" button the
> addition information on the left hand side of the decision table
> clearly shows that the asset belongs to the expected package that I
> can not see it from. I have tried to archive the decision table and
> it does not show up in the archives. I have tried changing the
> package name on the asset and then I tried to navigate to the asset
> from the other package, I still can not see it. Note, the package
> somehow gets disconnects from the package after a restart the app
> server. The other strange behavior is that I can make changes to the
> decision table and then rebuild the packages and the changes show in
> the package source. I just can not see the decision table by from the
> package...
>
> Note, I have configured JackRabbit to store the repository in a
> database along with a journal node for clustering.
>
> Environment Details:
> + App Server - JBoss 4.0.3.sp1
> + Drools 5.0M5
> + Database - Microsoft Sql Server
> + JackRabbit Repo - Configured to use a Jndi data source configured in
> JBoss.
>
> Any advise would be appreciated.
>
> Thanks,
> -GuyT1122
>
>
------------------------------------------------------------------------
> *A Good Credit Score is 700 or Above. See yours in just 2 easy steps!
>
<http://pr.atwola.com/promoclk/100126575x1218822736x1201267884/aol?redir
=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%2
6hmpgID%3D62%26bcd%3DfebemailfooterNO62>*
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
------------------------------
Message: 2
Date: Fri, 20 Feb 2009 15:58:55 +0000
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: Re: [rules-users] Problem using KnowledgeAgent
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <499ED33F.5090003(a)codehaus.org>
Content-Type: text/plain; charset="iso-8859-1"
Seaver, Daniel (GE Healthcare) wrote:
> Thanks for the clarification, Mark.
>
> I followed your links to get the latest of the greatest. Happy to see
> all those blue circles in the build history. I downloaded:
>
> drools-5.0.0.SNAPSHOT-eclipse-all.zip
> drools-5.0.0.SNAPSHOT-guvnor.zip
>
> Then I updated eclipse with the contents of ...eclips-all.zip, Started
> eclipse and created a new runtime (which I put in my
> jboss/server/default/lib folder and verified that the ones I had
> installed there before were changed). I replaced the M5 version of
> guvnor with the new one, and restarted everything.
>
> That should be all I need to do, right? Been at this for a while, so I
> may be having a mental lapse.
>
> Anyways, several projects that I could build before the upgrade don't
> build anymore. The build process hangs in Guvnor, as well as in
Eclipse.
>
> This is the last output I get in the server's log when trying to
> compile the package I'm using for our test:
>
> 21:27:25,132 INFO [STDOUT] DEBUG 19-02 21:27:25,132
> (_SelectorManager.java:<init>:27_) Loading selectors
>
> 21:27:25,195 INFO [STDOUT] DEBUG 19-02 21:27:25,195
> (_ContentManager.java:<init>:45_) Loading content properties
>
> The last thing I see in Eclipse when I try a complete clean on our
> primary application is:
>
> Building Workspace - Building all...: Invoking "Drools Builder' on
> '/cbo-ejb'.
>
> The status shows 46% complete and just hangs there.
>
> I think it's time for a cocktail and a nice long sleep. I'll check in
> tomorrow before rolling back to M5.
can you look in the error logs? I was really hoping to CR1 over the
weekend. But we need to be sure these issues are gone.
>
> Dan
>
>
------------------------------------------------------------------------
> *From:* Mark Proctor [mailto:mproctor@codehaus.org]
> *Sent:* Thursday, February 19, 2009 3:25 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Problem using KnowledgeAgent
>
> On the left side you see a list of red and blue circles, red indicates
> that build was a failure and blue a success:
> https://hudson.jboss.org/hudson/job/drools/
>
> The last successful build has it's artifacts at:
>
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/
trunk/target/
>
> As you can see the last build was successful so now you can get all
> the binaries from above.
>
> Mark
> Edson Tirelli wrote:
>>
>> The tests are fixed and committed to revision #25353.
>>
>> []s
>> Edson
>>
>> 2009/2/19 Mark Proctor <mproctor(a)codehaus.org
>> <mailto:mproctor@codehaus.org>>
>>
>> Dan Seaver wrote:
>>> Yes, the exception occurs on both the filesystem and Guvnor, and
it happens
>>> whether I set the value to true or false.
>>>
>> I found the issue and reviewed the agent code and this has been
>> fixed in trunk. Edson si just fixing two failing tests, but as
>> soon as the build turns blue again grab the latest artifact
>> builds and give it a try:
>> https://hudson.jboss.org/hudson/job/drools/
>>
>> Mark
>>
>>> Michael Neale wrote:
>>>
>>>> So from the filesystem it won't pick up changes? (does it throw
the
>>>> same exception).
>>>>
>>>>
>>>> On Thu, Feb 19, 2009 at 5:34 AM, Dan Seaver <dan.seaver(a)ge.com>
<mailto:dan.seaver@ge.com> wrote:
>>>>
>>>>> Mark,
>>>>> I have some more information for you. The exception occurs
when I issue:
>>>>>
>>>>> agent.monitorResourceChangeEvents(true|false)
>>>>>
>>>>> If I comment out that code, I don't get the exception, but I
don't get
>>>>> changes either. I tried it with both the Guvnor repository and
with a
>>>>> deployed package on the file system.
>>>>>
>>>>> I won't have time to create the test you requested until the
weekend. Let
>>>>> me
>>>>> know if you still want it.
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>> Mark Proctor wrote:
>>>>>
>>>>>> Dan Seaver wrote:
>>>>>>
>>>>>>> I setup a KnowledgeAgent using the example code in the
JavaDoc for
>>>>>>> KnowledgeAgentFactory to access a compiled package in
Guvnor. The
>>>>>>> package
>>>>>>> runs fine, but changes to the package are not picked up. I
believe this
>>>>>>> is
>>>>>>> due to the ChangeSet notification thread being interrupted.
But why?
>>>>>>>
>>>>>>>
>>>>>> Hmm that's not good. I have the following unit test:
>>>>>>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/
test/java/org/drools/agent/KnowledgeAgentTest.java
>>>>>>
>>>>>> Could you provide an update for new tests for detecting url
changes?
>>>>>> When making the test you might find it easier to look at the
previous
>>>>>> ruleagent tests:
>>>>>>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/test
/java/org/drools/agent/URLScannerTest.java
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>>> Also, I'm getting some messages about failing to read schema
document.
>>>>>>> I
>>>>>>> think it is caused by the xml for the ChangeSet, but I'm
using the
>>>>>>> example
>>>>>>> from the JavaDocs.
>>>>>>>
>>>>>>>
>>>>>> We haven't provided an XSD yet, so it'll provide schema
validation
>>>>>> issues, those can be ignored.
>>>>>>
>>>>>>> Here's a snippet from the log:
>>>>>>>
>>>>>>> [2009:02:48 23:02:905:info] KnowledegAgent has started
listening for
>>>>>>> ChangeSet notifications
>>>>>>> [2009:02:48 23:02:905:info] KnowledgAgent created, with
configuration:
>>>>>>> monitorChangeSetEvents=true scanResources=true
scanDirectories=true
>>>>>>> [2009:02:48 23:02:905:exception
>>>>>>> java.lang.RuntimeException: KnowledgeAgent ChangeSet
notification
>>>>>>> thread
>>>>>>> has
>>>>>>> been interrupted
>>>>>>> at
>>>>>>>
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.r
un(KnowledgeAgentImpl.java:465)
>>>>>>> at java.lang.Thread.run(Unknown Source)
>>>>>>> Caused by: java.lang.InterruptedException
>>>>>>> at
>>>>>>>
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.re
portInterruptAfterWait(Unknown
>>>>>>> Source)
>>>>>>> at
>>>>>>>
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.aw
ait(Unknown
>>>>>>> Source)
>>>>>>> at
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>>>>>>> at
>>>>>>>
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.r
un(KnowledgeAgentImpl.java:463)
>>>>>>> ... 1 more
>>>>>>> [2009:02:48 23:02:937:info] KnowledegAgent has stopped
listening for
>>>>>>> ChangeSet notifications
>>>>>>> (null: 1, 207): schema_reference.4: Failed to read schema
document
>>>>>>> 'drools-change-set-5.0.xsd', because 1) could not find the
document; 2)
>>>>>>> the
>>>>>>> document could not be read; 3) the root element of the
document is not
>>>>>>> <xsd:schema>.
>>>>>>> (null: 1, 207): cvc-elt.1: Cannot find the declaration of
element
>>>>>>> 'change-set'.
>>>>>>> (null: 1, 216): schema_reference.4: Failed to read schema
document
>>>>>>> 'drools-change-set-5.0.xsd', because 1) could not find the
document; 2)
>>>>>>> the
>>>>>>> document could not be read; 3) the root element of the
document is not
>>>>>>> <xsd:schema>.
>>>>>>> (null: 1, 343): schema_reference.4: Failed to read schema
document
>>>>>>> 'drools-change-set-5.0.xsd', because 1) could not find the
document; 2)
>>>>>>> the
>>>>>>> document could not be read; 3) the root element of the
document is not
>>>>>>> <xsd:schema>.
>>>>>>> [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> rules-users mailing list
>>>>>> rules-users(a)lists.jboss.org
<mailto:rules-users@lists.jboss.org>
>>>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
http://www.nabble.com/Problem-using-KnowledgeAgent-tp22073944p22085204.h
tml
>>>>> Sent from the drools - user mailing list archive at
Nabble.com.
>>>>>
>>>>> _______________________________________________
>>>>> rules-users mailing list
>>>>> rules-users(a)lists.jboss.org
<mailto:rules-users@lists.jboss.org>
>>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>>
>>>>>
>>>> --
>>>> Michael D Neale
>>>> home: www.michaelneale.net <http://www.michaelneale.net>
>>>> blog: michaelneale.blogspot.com
<http://michaelneale.blogspot.com>
>>>> _______________________________________________
>>>> rules-users mailing list
>>>> rules-users(a)lists.jboss.org
<mailto:rules-users@lists.jboss.org>
>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>>
>>>>
>>>>
>>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org <mailto:rules-users@lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>>
>> --
>> Edson Tirelli
>> JBoss Drools Core Development
>> JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.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
>
15 years, 9 months
Declarative Model Editor in Guvnor
by J Michael Dean
When I declare a very simple object in Guvnor and validate, save,
build, etc. and then try to edit it, I get the guided editor.
However, if I import that model to the IDE and edit it there, and
commit it back, then in Guvnor I subsequently can edit the text
directly. I cannot find a way to edit the text directly unless I go
through this step of import to the IDE, and once I have handled it in
the IDE, it appears I can no longer edit it with the guided editor in
Guvnor.
Is this the correct behavior?
I also have found that if I try to declare two facts in the same model
using the guided editor, I get the failure to create accessors error
that I previously reported. My workaround has been to only put one
object in a respective model object - they of course get merged in the
package.
15 years, 9 months
Extending objects in declared facts
by J Michael Dean
When a fact is declared with propertyChangeSupport in Guvnor, such as
following:
declare Hemodynamics
@propertyChangeSupport
systolicBP: Integer
diastolicBP: Integer
centralVenousP: Integer
wedgeP: Integer
status: Boolean
alive: Boolean
end
then the following warning shows up in JBoss console:
Warning: Method addPropertyChangeListener not found on the class
class makeModelTest.Hemodynamics so Drools will be unable to process
JavaBean PropertyChangeEvents on the asserted Object
I implement property changes in a model object so would like to be
able to say something like:
declare Hemodynamics extends ModelObject
@propertyChangeSupport
systolicBP: Integer
diastolicBP: Integer
centralVenousP: Integer
wedgeP: Integer
status: Boolean
alive: Boolean
end
The documentation refers to using Guvnor and declarative facts to
extend an object that already exists, but not clear that this can
actually be done.
15 years, 9 months