Re: [rules-users] Compiling .drl files inside of a JUnit test
by Ron Kneusel
Mark Proctor wrote:
>You don't have your DRLs in the correct location, our DRLs mirror the path of the class that is loading them via getClass().getResourceAsStream():
>http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler...
>It just does a loadClass on the classLoader, as long as your classes are in the classpath it will find them.
So, when the compiler is compiling the rules file, it will "inherit" the classpath from Eclipse? Or it should? To me, the key is your phrase "as long as your classes are in the classpath". As far as Eclipse is concerned they are, but what classpath is used by the compiler of the .drl file?
There is an entire complex directory structure to the project and the unit tests are in one directory which is far removed from the source for the classes yet when other unit tests run, they see everything as expected, which my test class extending TestCase also sees, but not the compiler compiling the .drl file.
Apologies for being so slow with this but I'm learning Java and Drools at the same time, not an ideal situation. Thanks for the help!
Ron
_________________________________________________________________
Use video conversation to talk face-to-face with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM...
17 years, 10 months
Reusing predicates
by Kris Nuttycombe
Hi, all,
I have a set of rules where the LHS is essentially the same except for
a couple of additional conditions in each case. What is the best way
to factor out these common predicates? Should I simply create an
intermediate fact based upon the common set of conditions and then
reason with that fact, or is there a way of reusing them without
adding another fact to the mix?
Thanks,
Kris
17 years, 10 months
Problems with looping
by thomas kukofka
Hi, I used no-loop true but it still loops!!
Thomas
Hi
you must use "no-loop true" and the rule will be executed one for one
InputObject.
2008/8/1 thomas kukofka <thomaskukofka at
web.de<https://lists.jboss.org/mailman/listinfo/rules-users>
>:
> Hello,
>
> I have and less loop (the rule should only executed one for one
InputObject)
> in the follwing rule although I use "no-loop":
>
> rule "rulename"
> dialect "java"
> no-loop
> when
> io: InputObject (type == InputObject.Type.Typename)
> then
> io.setStringPropertyValue(InputObject.PROPERTYVALUE,
"somestring");
> update(oo);
>
> end
>
> I've read that I have to overwrite hashcode and equals, can this be the
> reason? If yes, do you have an example how to overwrite these methods?
>
> Thomas
17 years, 10 months
(no subject)
by thomas kukofka
Hi, I used no-loop true but it still loops!!
Thomas
Hi
you must use "no-loop true" and the rule will be executed one for one
InputObject.
2008/8/1 thomas kukofka <thomaskukofka at
web.de<https://lists.jboss.org/mailman/listinfo/rules-users>
>:
> Hello,
>
> I have and less loop (the rule should only executed one for one
InputObject)
> in the follwing rule although I use "no-loop":
>
> rule "rulename"
> dialect "java"
> no-loop
> when
> io: InputObject (type == InputObject.Type.Typename)
> then
> io.setStringPropertyValue(InputObject.PROPERTYVALUE,
"somestring");
> update(oo);
>
> end
>
> I've read that I have to overwrite hashcode and equals, can this be the
> reason? If yes, do you have an example how to overwrite these methods?
>
> Thomas
**
17 years, 10 months
Problems with looping
by thomas kukofka
Hello,
I have and less loop (the rule should only executed one for one InputObject)
in the follwing rule although I use "no-loop":
rule "rulename"
dialect "java"
no-loop
when
io: InputObject (type == InputObject.Type.Typename)
then
io.setStringPropertyValue(InputObject.PROPERTYVALUE, "somestring");
update(oo);
end
I've read that I have to overwrite hashcode and equals, can this be the
reason? If yes, do you have an example how to overwrite these methods?
Thomas
17 years, 10 months