ServiceTaskXMLConverter extends BaseBpmnXMLConverter { @Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { ServiceTask serviceTask = (ServiceTask) element; if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_CLASS, serviceTask.getImplementation(), xtw); } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_EXPRESSION, serviceTask.getImplementation(), xtw); } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_DELEGATEEXPRESSION, serviceTask.getImplementation(), xtw); } else { writeDefaultAttribute(ATTRIBUTE_TASK_IMPLEMENTATION, serviceTask.getImplementation(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getResultVariableName())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_RESULTVARIABLE, serviceTask.getResultVariableName(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getType())) { writeQualifiedAttribute(ATTRIBUTE_TYPE, serviceTask.getType(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getExtensionId())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_EXTENSIONID, serviceTask.getExtensionId(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getSkipExpression())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_SKIP_EXPRESSION, serviceTask.getSkipExpression(), xtw); } }  Class<? extends BaseElement> getBpmnElementType();  }
@Test public void convertServiceTaskElementToXMLShouldWriteTheImplementionAttribute() throws Exception { given(serviceTask.getImplementation()).willReturn("myConnectorImplementation"); converter.writeAdditionalAttributes(serviceTask, bpmnModel, writer); verify(writer).writeAttribute(eq(ATTRIBUTE_TASK_IMPLEMENTATION), eq("myConnectorImplementation")); }