public void execute(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory, ProcessContext context) throws Exception {
// must clone to avoid concurrency problems
DroolsMVELFactory factory = (DroolsMVELFactory) this.prototype.clone();
factory.addResolver("context", new SimpleValueResolver(context));
factory.addResolver("kcontext", new SimpleValueResolver(context));
if (variableNames != null) {
for (String variableName: variableNames) {
factory.addResolver(
variableName, new SimpleValueResolver(context.getVariable(variableName)));
}
}
factory.setContext( null,
knowledgeHelper,