@Test public void should_substituteExpressions_when_expressionIsInInputMappingValue() throws Exception { DelegateExecution execution = initExpressionResolverTest("expression-in-mapping-input-value.json", "Process_expressionMappingInputValue"); Map<String, Object> inputVariables = variablesMappingProvider.calculateInputVariables(execution); assertThat(inputVariables).isNotEmpty(); assertThat(inputVariables.entrySet()).extracting(Map.Entry::getKey, Map.Entry::getValue) .containsOnly(tuple("process_constant_1", "constant_1_value"), tuple("process_constant_2", "constant_2_value"), tuple("task_input_variable_name_1", "variable_value_1"), tuple("task_input_variable_name_2", "variable_value_1")); }
public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (!extensions.hasMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (extensions.shouldMapAllInputs(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; }
ExtensionsVariablesMappingProvider implements VariablesCalculator { public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (!extensions.hasMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (extensions.shouldMapAllInputs(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; } }
ExtensionsVariablesMappingProvider implements VariablesCalculator { public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (!extensions.hasMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (extensions.shouldMapAllInputs(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; } ExtensionsVariablesMappingProvider(ProcessExtensionService processExtensionService,
                                    ExpressionResolver expressionResolver); }
ExtensionsVariablesMappingProvider implements VariablesCalculator { public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (!extensions.hasMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (extensions.shouldMapAllInputs(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; } ExtensionsVariablesMappingProvider(ProcessExtensionService processExtensionService,
                                    ExpressionResolver expressionResolver); Map<String, Object> calculateInputVariables(DelegateExecution execution); Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext,
                                                        Map<String, Object> availableVariables); }
ExtensionsVariablesMappingProvider implements VariablesCalculator { public Map<String, Object> calculateInputVariables(DelegateExecution execution) { Extension extensions = processExtensionService.getExtensionsForId(execution.getProcessDefinitionId()); Map<String, Object> constants = calculateConstants(execution, extensions); if (!extensions.hasMapping(execution.getCurrentActivityId())) { return constants; } Map<String, Object> inboundVariables; if (extensions.shouldMapAllInputs(execution.getCurrentActivityId())) { inboundVariables = execution.getVariables(); } else { inboundVariables = calculateInputVariables(execution, extensions); } inboundVariables = expressionResolver.resolveExpressionsMap(new VariableScopeExpressionEvaluator(execution), inboundVariables); inboundVariables.putAll(constants); return inboundVariables; } ExtensionsVariablesMappingProvider(ProcessExtensionService processExtensionService,
                                    ExpressionResolver expressionResolver); Map<String, Object> calculateInputVariables(DelegateExecution execution); Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext,
                                                        Map<String, Object> availableVariables);  }