use of org.mvel2.integration.VariableResolver in project mvel by mikebrock.
the class OperativeAssign method getReducedValueAccelerated.
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
VariableResolver resolver = factory.getVariableResolver(varName);
resolver.setValue(ctx = MathProcessor.doOperations(resolver.getValue(), operation, knownInType, statement.getValue(ctx, thisValue, factory)));
return ctx;
}
use of org.mvel2.integration.VariableResolver in project mvel by mikebrock.
the class OperativeAssign method getReducedValue.
public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
VariableResolver resolver = factory.getVariableResolver(varName);
resolver.setValue(ctx = MathProcessor.doOperations(resolver.getValue(), operation, eval(expr, start, offset, ctx, factory)));
return ctx;
}
use of org.mvel2.integration.VariableResolver in project drools by kiegroup.
the class ActivationPropertyHandler method getProperty.
public Object getProperty(String name, Object obj, VariableResolverFactory variableFactory) {
AgendaItem item = (AgendaItem) obj;
if ("rule".equals(name)) {
return item.getRule();
} else if ("active".equals(name)) {
return item.isQueued();
} else if ("objects".equals(name)) {
return item.getObjects();
} else if ("factHandles".equals(name)) {
return item.getFactHandles();
} else if ("declarationIds".equals(name)) {
return item.getDeclarationIds();
} else if ("this".equals(name)) {
return item;
}
// FIXME hack as MVEL seems to be ignoring indexed variables
VariableResolver vr = variableFactory.getNextFactory().getVariableResolver(name);
if (vr != null) {
return vr.getValue();
}
Declaration declr = item.getTerminalNode().getSubRule().getOuterDeclarations().get(name);
if (declr != null) {
return declr.getValue(null, item.getTuple().get(declr).getObject());
} else {
return item.getRule().getMetaData(name);
}
}
Aggregations