Hi All,
I have declared type (rules are given below), and I want to access it
through kbase.getFactType(...) see below.
===== Rule =============
package sample1
import java.util.Date
declare Person
name : String
dateOfBirth : Date
address : String
end
============ Code =================
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newFileResource("src/ruleset1.drl"),
ResourceType.DRL );
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
// get the declared FactType
FactType personType = kbase.getFactType( "sample1", "Person"
);
============================================
But personType returned by kbase.getFactType(..) is null. Could anyone
know can give me a hand?
--Srinath
--
============================
Srinath Perera, Ph.D.
WSO2 Inc.
http://wso2.com
Blog:
http://srinathsview.blogspot.com/