MappingAwareCallActivityBehavior extends CallActivityBehavior { @Override protected Map<String, Object> calculateInboundVariables(DelegateExecution execution, ProcessDefinition processDefinition) { Map<String, Object> inputVariables = variablesCalculator.calculateInputVariables(execution); return processVariablesInitiator.calculateVariablesFromExtensionFile(processDefinition, inputVariables); } MappingAwareCallActivityBehavior(String processDefinitionKey,
                                            List<MapExceptionEntry> mapExceptions,
                                            VariablesCalculator variablesCalculator,
                                            ProcessVariablesInitiator processVariablesInitiator);  MappingAwareCallActivityBehavior(Expression processDefinitionExpression,
                                            List<MapExceptionEntry> mapExceptions,
                                            VariablesCalculator variablesCalculator,
                                            ProcessVariablesInitiator processVariablesInitiator);   }
@Test public void calculateInboundVariablesShouldTakeIntoAccountMappingProviderAndProcessVariablesInitiator() { DelegateExecution execution = buildExecution(); ProcessDefinition processDefinition = mock(ProcessDefinition.class); Map<String, Object> providerVariables = singletonMap("var1", "v1"); given(mappingProvider.calculateInputVariables(execution)).willReturn(providerVariables); HashMap<String, Object> initiatorVariables = new HashMap<>(providerVariables); initiatorVariables.put("var2", "default"); given(processVariablesInitiator.calculateVariablesFromExtensionFile(processDefinition, providerVariables)) .willReturn(initiatorVariables); Map<String, Object> inboundVariables = behavior.calculateInboundVariables(execution, processDefinition); assertThat(inboundVariables).isEqualTo(initiatorVariables); }