I define my facts in DLR with the declare clause.
The method need the values of the facts to insert it into the knwoledge
base.
You can try this:

[my kbase is injected by spring]

StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
FactType factType = kbase.getFactType("my.package(defined in the DLR)",
"name_of_the_fact");
Object kFact = null;
try {
        kFact = factType.newInstance();
} catch (InstantiationException e) {
        throw new ApplicationException(e);
} catch (IllegalAccessException e) {
        throw new ApplicationException(e);
}
        factType.set(kFact, "fact_property_name(in_DLR)" , 
"fact_property_value(in
DLR)");
}

FactHandle factHandler = ksession.insert(kFact);
int numRulesFired = ksession.fireAllRules(100);

I hope this help you.



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-How-to-call-Drools-as-a-remote-rules-executor-tp4027157p4027166.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to