use of org.activiti.api.process.runtime.connector.Connector in project Activiti by Activiti.
the class DefaultServiceTaskBehaviorTest method hasConnectorBeanShouldReturnTrueIfABeanOfConnectorTypeIsFound.
@Test
public void hasConnectorBeanShouldReturnTrueIfABeanOfConnectorTypeIsFound() {
// given
String connectorName = "connector";
DelegateExecution execution = ConnectorRuntimeApiTestHelper.buildExecution(connectorName);
given(context.containsBean(connectorName)).willReturn(true);
given(context.getBean(connectorName)).willReturn(mock(Connector.class));
// when
boolean hasConnectorBean = behavior.hasConnectorBean(execution);
// then
assertThat(hasConnectorBean).isTrue();
}
use of org.activiti.api.process.runtime.connector.Connector in project Activiti by Activiti.
the class DefaultServiceTaskBehavior method execute.
/**
* We have two different implementation strategy that can be executed
* in according if we have a connector action definition match or not.
*/
@Override
public void execute(DelegateExecution execution) {
Connector connector = getConnector(getImplementation(execution));
IntegrationContext integrationContext = connector.apply(integrationContextBuilder.from(execution));
execution.setVariables(outboundVariablesProvider.calculateOutPutVariables(buildMappingExecutionContext(execution), integrationContext.getOutBoundVariables()));
leave(execution);
}
Aggregations