void updateLeftOperands(final Map<SLeftOperand, LeftOperandUpdateStatus> leftOperandUpdates, final long leftOperandContainerId, final String leftOperandContainerType, final SExpressionContext expressionContext) throws SOperationExecutionException { for (final Entry<SLeftOperand, LeftOperandUpdateStatus> update : leftOperandUpdates.entrySet()) { final SLeftOperand leftOperand = update.getKey(); final LeftOperandHandler leftOperandHandler = getLeftOperandHandler(leftOperand.getType()); if (update.getValue().shouldUpdate()) { leftOperandHandler.update(leftOperand, expressionContext.getInputValues(), expressionContext.getInputValues().get(leftOperand.getName()), leftOperandContainerId, leftOperandContainerType); } else { leftOperandHandler.delete(leftOperand, leftOperandContainerId, leftOperandContainerType); } } }
void updateLeftOperands(final Map<SLeftOperand, LeftOperandUpdateStatus> leftOperandUpdates, final long leftOperandContainerId, final String leftOperandContainerType, final SExpressionContext expressionContext) throws SOperationExecutionException { for (final Entry<SLeftOperand, LeftOperandUpdateStatus> update : leftOperandUpdates.entrySet()) { final SLeftOperand leftOperand = update.getKey(); final LeftOperandHandler leftOperandHandler = getLeftOperandHandler(leftOperand.getType()); if (update.getValue().shouldUpdate()) { leftOperandHandler.update(leftOperand, expressionContext.getInputValues(), expressionContext.getInputValues().get(leftOperand.getName()), leftOperandContainerId, leftOperandContainerType); } else { leftOperandHandler.delete(leftOperand, leftOperandContainerId, leftOperandContainerType); } } }
private LeftOperandUpdateStatus calculateRightOperandValue(final SOperation operation, final SExpressionContext expressionContext, boolean shouldPersistValue) throws SOperationExecutionException { final SLeftOperand leftOperand = operation.getLeftOperand(); final LeftOperandUpdateStatus currentUpdateStatus = new LeftOperandUpdateStatus(operation.getType()); if (currentUpdateStatus.shouldUpdate()) { final OperationExecutorStrategy operationExecutorStrategy = operationExecutorStrategyProvider.getOperationExecutorStrategy(operation); final Object rightOperandValue = evaluateRightOperandExpression(operation, expressionContext, operation.getRightOperand()); shouldPersistValue = persistRightOperandResolver .shouldPersistByValue(rightOperandValue, shouldPersistValue, operationExecutorStrategy.shouldPersistOnNullValue()); final Object value = operationExecutorStrategy.computeNewValueForLeftOperand(operation, rightOperandValue, expressionContext, shouldPersistValue); expressionContext.getInputValues().put(leftOperand.getName(), value); logOperation(TechnicalLogSeverity.DEBUG, operation, rightOperandValue, expressionContext); } return currentUpdateStatus; }
private LeftOperandUpdateStatus calculateRightOperandValue(final SOperation operation, final SExpressionContext expressionContext, boolean shouldPersistValue) throws SOperationExecutionException { final SLeftOperand leftOperand = operation.getLeftOperand(); final LeftOperandUpdateStatus currentUpdateStatus = new LeftOperandUpdateStatus(operation.getType()); if (currentUpdateStatus.shouldUpdate()) { final OperationExecutorStrategy operationExecutorStrategy = operationExecutorStrategyProvider.getOperationExecutorStrategy(operation); final Object rightOperandValue = evaluateRightOperandExpression(operation, expressionContext, operation.getRightOperand()); shouldPersistValue = persistRightOperandResolver .shouldPersistByValue(rightOperandValue, shouldPersistValue, operationExecutorStrategy.shouldPersistOnNullValue()); final Object value = operationExecutorStrategy.computeNewValueForLeftOperand(operation, rightOperandValue, expressionContext, shouldPersistValue); expressionContext.getInputValues().put(leftOperand.getName(), value); logOperation(TechnicalLogSeverity.DEBUG, operation, rightOperandValue, expressionContext); } return currentUpdateStatus; }