import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.spi.Activation;
import org.drools.spi.AgendaFilter;
.
.
.
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(
ResourceFactory.newClassPathResource(resourceIndicator),
ResourceType.XDRL
);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
.
.
.
public Object getSpecificRuleReport(
Object requestDTO,
Object responseDTO,
final String ruleAry[]
)
throws Exception
{
AgendaFilter agendafilter =
new StatefulKnowledgeSessionImpl.AgendaFilterWrapper(null)
{
public boolean accept(Activation activation)
{
boolean returnFlag = false;
int ruleArySize = ruleAry.length;
for (int cnt=0; cnt<ruleArySize; cnt++)
{
if (activation.getRule().getName().equals(ruleAry[cnt]))
returnFlag = false;
else
returnFlag = true;
}
return returnFlag;
}
};
try
{
ksession.insert(requestDTO);
ksession.insert(responseDTO);
ksession.fireAllRules(agendafilter);
}catch(Exception t)
{
_logger.error(t.getMessage()+"\n"+t);
}
return responseDTO;
}
Eclipse is showing that there is a method fireAllRules() which takes
AgendaFilter as a parameter
but I am getting error "The method fireAllRules(int) in the type
StatefulRuleSession is not applicable for the arguments (AgendaFilter)" at
'ksession.fireAllRules(agendafilter);'
I am trying to execute specific rules out of set of rules. Please help me to
fix this issue.
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Please-help-me-to-fix...
Sent from the Drools - User mailing list archive at
Nabble.com.