Hello,
I am calling static "error" function in ValidationHelper class from drool
rules. My rules are going to be executed in spring based web application. Is
this call to an "error" function thread safe?
public class ValidationHelper {
public static void error (RuleContext kcontext, Object... context) {
KnowledgeRuntime knowledgeRuntime = drools.getKnowledgeRuntime();
ValidationReport validationReport = (ValidationReport)
knowledgeRuntime
.getGlobal(ValidationConstants.VALIDATION_REPORT_GLOBAL);
ReportFactory reportFactory = (ReportFactory)
knowledgeRuntime
.getGlobal(ValidationConstants.REPORT_FACTORY_GLOBAL);
validationReport.addMessage(reportFactory.createMessage(
Message.Type.ERROR, messageKey, context));
}
}
import org.drools.runtime.rule.RuleContext;
import function ValidationHelper.error;
...
rule test
when
#condition
then
error(drools)
Please advise
Thanks
--
View this message in context:
http://drools.46999.n3.nabble.com/calling-static-error-function-thread-sa...
Sent from the Drools: User forum mailing list archive at
Nabble.com.