[rules-users] java.lang.ClassCastException: [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package

Manasi manasi.a.damle at capgemini.com
Wed Jun 20 07:12:20 EDT 2012


Hi,

Thanks for your reply.
Now the mentioned error is not coming, but I am not able to fetch packages
stored in guvnor.

I have following updated code:

*KnowledgeAgent agent = 
KnowledgeAgentFactory.newKnowledgeAgent("/com/model/drools.properties");
KnowledgeBase ruleBase = agent.getKnowledgeBase();
	
StatefulKnowledgeSession workingMemory =
ruleBase.newStatefulKnowledgeSession();
StaffSO staff = new StaffSO();
staff.setDept("YO");
staff.setUser("User");
workingMemory.insert(staff);
System.out.println("number of facts " +
workingMemory.getFactHandles().size());
workingMemory.fireAllRules(new RuleNameEndsWithAgendaFilter("UI_Kunde"));
System.out.println("after fire rules ,number of facts " +
workingMemory.getFactHandles().size());
	
for(Iterator i=workingMemory.getObjects().iterator();i.hasNext();){	
System.out.println(((StaffSO)i.next()).getEditableFields());
}*

Thanks,
Manasi.

--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-Lorg-drools-rule-Package-cannot-be-cast-to-org-drools-rule-Package-tp4017821p4018090.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list