use of org.mvel2.templates.CompiledTemplate in project drools by kiegroup.
the class AccumulateTemplateTest method getInvokerTemplateRegistry.
private TemplateRegistry getInvokerTemplateRegistry() {
TemplateRegistry invokerRegistry = new SimpleTemplateRegistry();
CompiledTemplate compiled = TemplateCompiler.compileTemplate(JavaRuleBuilderHelper.class.getResourceAsStream("javaInvokers.mvel"), (Map<String, Class<? extends Node>>) null);
TemplateRuntime.execute(compiled, null, invokerRegistry);
return invokerRegistry;
}
use of org.mvel2.templates.CompiledTemplate in project drools by kiegroup.
the class AccumulateTemplateTest method getRuleTemplateRegistry.
private TemplateRegistry getRuleTemplateRegistry() {
TemplateRegistry ruleRegistry = new SimpleTemplateRegistry();
CompiledTemplate compiled = TemplateCompiler.compileTemplate(JavaRuleBuilderHelper.class.getResourceAsStream("javaRule.mvel"), (Map<String, Class<? extends Node>>) null);
TemplateRuntime.execute(compiled, null, ruleRegistry);
return ruleRegistry;
}
use of org.mvel2.templates.CompiledTemplate in project drools by kiegroup.
the class PMML4Helper method applyTemplate.
public void applyTemplate(String templateName, Object context, TemplateRegistry registry, Map vars, StringBuilder builder) {
CompiledTemplate template = registry.getNamedTemplate(templateName);
String result = (String) TemplateRuntime.execute(template, context, vars, registry);
builder.append(result);
}
use of org.mvel2.templates.CompiledTemplate in project drools by kiegroup.
the class PMML4Helper method applyTemplate.
public void applyTemplate(String templateName, Object context, TemplateRegistry registry, Map vars, StringBuilder builder) {
CompiledTemplate template = registry.getNamedTemplate(templateName);
String result = (String) TemplateRuntime.execute(template, context, vars, registry);
builder.append(result);
}
use of org.mvel2.templates.CompiledTemplate in project drools by kiegroup.
the class Miningmodel method addMiningTemplateToRegistry.
@Override
protected void addMiningTemplateToRegistry(TemplateRegistry registry) {
InputStream inputStream = Scorecard.class.getResourceAsStream(MINING_POJO_TEMPLATE);
if (inputStream != null) {
CompiledTemplate ct = TemplateCompiler.compileTemplate(inputStream);
registry.addNamedTemplate(getMiningPojoTemplateName(), ct);
}
}
Aggregations