java - does drools drl validation be done for Object rather pojo instances -


in drools examples have seen pojo instance being passed facts drools environment, can drools environment take objects instead of pojo ??

more info being added per comments:

object object= new objectmapper().readvalue(json,  class.forname("com.enrichmentservice.esrootdoc")); 

can above object instance(object) provided drl , drools on own downcast object instance com.enrichmentservice.thread72.esrootdoc instance need call getter methods believe called on esrootdoc(a pojo class being created @ run time) , not object instance.

yes, absolutely. drools checks actual class , interface hierarchy of facts provided.

for instance, if 1 has rule:

rule x when     person()     ... 

the following 2 code snippets provide identical results:

person p = new person(); ksession.insert(p); ksession.fireallrules(); 

object p = new person();  ksession.insert(p); ksession.fireallrules(); 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -