Re: [rules-users] How to pass variables to a drools rule file?
by FrankVhh
It is looking for com.sample.Qos. Try to add the import statement
test.java.Qos somewhere on top of your file.
Regards,
Frank
penny wrote
> Hi,there.I have a class in test.java file.It looks like:
> class Qos{
> boolean S;
> boolean W;
> Qos(){
> S = true;
> W = false;
> }
> public boolean getS(){
> return S;
> }
> public boolean getW(){
> return W;
> }
> }
>
> Now I want to use the Qos class in my rule file like this:
> rule "rule1"
> ruleflow-group "myRules"
> salience 4
> when
> //conditions
> $qos:Qos(S==true && W==true);
> then
> System.out.println("rule1");
> end
>
> But here is an error.
> [Error: could not access field: com.sample.Qos.S]
> [Near : {... S == true ....}]
> ^
> [Line: 1, Column: 1]
>
> How can I do?
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-pass-variables-to-a-drools-rule-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Runtime Exception null accessor
by Bojan Janisch
Hello Guys,
I've thought many hours about this problem, but don't know how to fix it. I've also searched the web, getting only some unfinished problems. Maybe someone here knows how to solve it:
Each time I'm running JDrools through my textfiles (I'm using it in textmining concepts), I get the same runtime exception:
25.02.2013 18:03:59 org.apache.uima.collection.impl.cpm.engine.CPMThreadGroup process
SCHWERWIEGEND: The CPM thread group caught the following unhandled error: java.lang.RuntimeException (Thread Name: Thread-5)
25.02.2013 18:03:59 de.fraunhofer.scai.bio.uima.core.deploy.StatusCallbackListenerImpl entityProcessComplete(151)
SCHWERWIEGEND: Exception occurred
java.lang.RuntimeException: Null accessor on node: a1_begin
at de.fraunhofer.scai.bio.uima.core.deploy.StatusCallbackListenerImpl.entityProcessComplete(StatusCallbackListenerImpl.java:151)
at org.apache.uima.collection.impl.cpm.engine.CPMThreadGroup.notifyListener(CPMThreadGroup.java:103)
at org.apache.uima.collection.impl.cpm.engine.CPMThreadGroup.uncaughtException(CPMThreadGroup.java:86)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1888)
For me it looks like an unhandeld race condition (but I'm not quite sure). Does someone have had this or a similar problem regarding null accessors at runtime?
Thanks for your help.
Bojan
11 years, 9 months
Rule IDE
by starfish15
Hello all,
Just want a confirmation of something quite miniscule. Though my teacher at
a very young age had tole me that "No Q can ever be a DUMB Q" ;)
The last time i had checked and had definitely known, that ECLIPSE was the
only IDE which had the RULE IDE plugin. Recently, someone challenged me on
this query and i was a bit flustered.
Hence kindly assist on this query.
Regards,
starfish
--
View this message in context: http://drools.46999.n3.nabble.com/Rule-IDE-tp4022564.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
DB2 and Guvnor
by IPatel
Hi All,
I am trying to configure Guvnor so that it can connect to DB2. I came across
a document online that shows the steps to do this..however i cannot find
that document anymore.
Does anyone have the link/reference/steps on how to do this??
Thank you
--
View this message in context: http://drools.46999.n3.nabble.com/DB2-and-Guvnor-tp4022522.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
Compiled rules differ KnowledgeAgent vs ResourceChangeScanner
by lhorton
Version 5.2.0.Final. I have a DRL file that is loaded into my server using a
change set and Spring configuration. The file loads without error, and I am
able to read the compiled package and print the rule names to confirm they
did load; however, only one of the rules fires. Then I copy (hot-deploy)
the same DRL file to its server-side directory, and the Resource change
Scanner picks it up and reloads it. After reload, all the expected rules
execute.
My guess is that the Spring/KnowledgeAgent compilation is different than the
one done via the resource change scanner. Has anyone else seen this
behavior? Any suggestions for further trouble shooting?
I can attach the change set, spring config and drl file if needed.
--
View this message in context: http://drools.46999.n3.nabble.com/Compiled-rules-differ-KnowledgeAgent-vs...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months
KnowledgeAgent: impossible to add a map for a null resource! skiping.
by anikulin
Hi
I've configurated KnowledgeAgent like this and it was working with PKG files
from guvnor, but when i changed path and type of recources to DRL when i
trying to run it on server i have such warning in logs and KnowledgeBase is
empty and no rules are fired:
KnowledgeAgent: impossible to add a map for a null resource! skiping.
KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase();
ResourceChangeScannerConfiguration sconf = ResourceFactory
.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval",
scannerInterval);
ResourceFactory.getResourceChangeScannerService().configure(sconf);
KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
kagent = KnowledgeAgentFactory.newKnowledgeAgent("changeSetAgent",
kbase, aconf);
kagent.applyChangeSet(ResourceFactory
.newClassPathResource("ChangeSet.xml"));
But this warn I have only with server deploying, when i run this program
just as standalone java program everythink is ok and rules are firing.
My ChangeSet.xml looks like this:
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'>
<add>
<resource
source='http://localhost:8083/drools-guvnor/rest/packages/magick/source'
type='DRL' basicAuthentication="enabled" username="admin"
password="admin" />
</add>
</change-set>
P.S. I have to change PKG type to DRL, cause drools ignore calendars clause
in compiled rules from guvnor.
Can you help me to solve this problem?
Thanks, Anton
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-impossible-to-add-a-map-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 9 months