1.      KnowledgeAgent ruleAgent = KnowledgeAgentFactory
                                .newKnowledgeAgent("/Guvnor.properties");

2.              System.out.println(ruleAgent.getKnowledgeBase().getFactType(
                                "org.sample", "NumberTest"));

3.              KnowledgeBase ruleBase = ruleAgent.getKnowledgeBase();

4.              System.out.println(ruleBase.getFactType("org.sample", 
"NumberTest"));

5.              FactType factType = ruleBase.getFactType("org.sample", 
"NumberTest");

6.              Object obj = factType.newInstance();

7.              factType.set(obj, "numberone", 2);

8.              factType.set(obj, "numbertwo", 1);

9.              StatefulKnowledgeSession workingMemory = ruleBase
                                .newStatefulKnowledgeSession();

10.             workingMemory.insert(obj);

11.             workingMemory.fireAllRules();

12.             System.out.println(factType.get(obj, "message"));


Issue in Line 6




--
View this message in context: 
http://drools.46999.n3.nabble.com/Could-not-execute-Rules-getting-NPE-tp4025731p4025734.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to