use of org.activiti.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior in project Activiti by Activiti.
the class DefaultActivityBehaviorFactory method createServiceTaskDelegateExpressionActivityBehavior.
public ServiceTaskDelegateExpressionActivityBehavior createServiceTaskDelegateExpressionActivityBehavior(ServiceTask serviceTask) {
Expression delegateExpression = expressionManager.createExpression(serviceTask.getImplementation());
Expression skipExpression;
if (StringUtils.isNotEmpty(serviceTask.getSkipExpression())) {
skipExpression = expressionManager.createExpression(serviceTask.getSkipExpression());
} else {
skipExpression = null;
}
return new ServiceTaskDelegateExpressionActivityBehavior(serviceTask.getId(), delegateExpression, skipExpression, createFieldDeclarations(serviceTask.getFieldExtensions()));
}
use of org.activiti.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior in project Activiti by Activiti.
the class ServiceTaskParseHandlerTest method executeParseShouldUseDefaultBehaviorWhenNoInformationIsProvided.
@Test
public void executeParseShouldUseDefaultBehaviorWhenNoInformationIsProvided() throws Exception {
// given
ServiceTask serviceTask = new ServiceTask();
ServiceTaskDelegateExpressionActivityBehavior defaultBehavior = mock(ServiceTaskDelegateExpressionActivityBehavior.class);
given(activityBehaviorFactory.createDefaultServiceTaskBehavior(serviceTask)).willReturn(defaultBehavior);
// when
serviceTaskParseHandler.executeParse(bpmnParse, serviceTask);
// then
assertThat(serviceTask.getBehavior()).isEqualTo(defaultBehavior);
}
Aggregations