use of org.ballerinalang.siddhi.core.executor.VariableExpressionExecutor in project ballerina by ballerina-lang.
the class ExpressionBuilder method buildStreamVariableExecutor.
private void buildStreamVariableExecutor(Variable variable, int streamEventChainIndex, ExpressionVisitor expressionVisitor, Attribute.Type type) {
String id = variable.getAttributeName();
if (variable.getStreamId() != null) {
id = variable.getStreamId() + "." + id;
}
expressionVisitor.beginVisitStreamVariable(id, variable.getStreamId(), variable.getAttributeName(), type);
if (!variableExpressionExecutorMap.containsKey(id)) {
ExpressionExecutor variableExpressionExecutor = ExpressionParser.parseExpression(variable, matchingMetaInfoHolder.getMetaStateEvent(), streamEventChainIndex, tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
variableExpressionExecutorMap.put(id, variableExpressionExecutor);
}
expressionVisitor.endVisitStreamVariable(id, variable.getStreamId(), variable.getAttributeName(), type);
}
use of org.ballerinalang.siddhi.core.executor.VariableExpressionExecutor in project ballerina by ballerina-lang.
the class InMemoryTable method compileUpdateSet.
@Override
public CompiledUpdateSet compileUpdateSet(UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, String queryName) {
Map<Integer, ExpressionExecutor> expressionExecutorMap = new HashMap<>();
for (UpdateSet.SetAttribute setAttribute : updateSet.getSetAttributeList()) {
ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression(setAttribute.getAssignmentExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
int attributePosition = tableDefinition.getAttributePosition(setAttribute.getTableVariable().getAttributeName());
expressionExecutorMap.put(attributePosition, expressionExecutor);
}
return new InMemoryCompiledUpdateSet(expressionExecutorMap);
}
Aggregations