<div dir="ltr"><div><div><div><div><div><div><div>Hi<br><br></div>I have such problem. I use Guvnor as a storage for rules, and now i want to add calendars declaration to some rule. I've done this and in my sources of these rules i can see:<br>
<br>rule "CalendarTest"<br> calendars "AUD Home Loans"<br> no-loop true<br> dialect "mvel"<br> when<br> <br> then<br> System.out.println("CALENDAR IS WORKING!!!");<br>
end<br><br></div>In my application I use KnowledgeAgent and such configuration to use rules from Guvnor:<br><br>KnowledgeBuilder builder = KnowledgeBuilderFactory<br> .newKnowledgeBuilder();<br> builder.add(ResourceFactory.newClassPathResource("ChangeSet.xml"),<br>
ResourceType.CHANGE_SET);<br> if (builder.hasErrors()) {<br> throw new RuntimeException(builder.getErrors().toString());<br> } // creating KnowledgeBase and Session<br> KnowledgeBase base = KnowledgeBaseFactory.newKnowledgeBase();<br>
base.addKnowledgePackages(builder.getKnowledgePackages());<br> StatefulKnowledgeSession session = base.newStatefulKnowledgeSession();<br><br></div>my ChangeSet.xml looks like this: <br><br><change-set xmlns='<a href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a>'<br>
xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>'<br> xs:schemaLocation='<a href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a> <a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>' ><br>
<add><br> <resource source=' <br><a href="http://localhost:8083/drools-guvnor/rest/packages/magick-model/source">http://localhost:8083/drools-guvnor/rest/packages/magick-model/source</a>' type='DRL' basicAuthentication="enabled" username="admin" password="admin"/><br>
</add><br></change-set><br><br></div>But the problem is when i invoke fureRules this rule with calendars clause also invokes, even if i don't set any calendar objects to session.<br><br></div>Can you help me what the problem is?<br>
<br></div>And if i just use local drl file, everything works fine<br><br></div>Thanks, Anton<br><div><div><div><div><br><div><br></div></div></div></div></div></div>