}
}
@Override
protected boolean writeExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
ServiceTask serviceTask = (ServiceTask) element;
if (!serviceTask.getCustomProperties().isEmpty()) {
for (CustomProperty customProperty : serviceTask.getCustomProperties()) {
if (StringUtils.isEmpty(customProperty.getSimpleValue())) {
continue;
}
if (didWriteExtensionStartElement == false) {
xtw.writeStartElement(ELEMENT_EXTENSIONS);
didWriteExtensionStartElement = true;
}
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD, ACTIVITI_EXTENSIONS_NAMESPACE);
xtw.writeAttribute(ATTRIBUTE_FIELD_NAME, customProperty.getName());
if ((customProperty.getSimpleValue().contains("${") || customProperty.getSimpleValue().contains("#{")) &&
customProperty.getSimpleValue().contains("}")) {
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ATTRIBUTE_FIELD_EXPRESSION, ACTIVITI_EXTENSIONS_NAMESPACE);
} else {
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD_STRING, ACTIVITI_EXTENSIONS_NAMESPACE);
}
xtw.writeCharacters(customProperty.getSimpleValue());
xtw.writeEndElement();
xtw.writeEndElement();
}
} else {
didWriteExtensionStartElement = FieldExtensionExport.writeFieldExtensions(serviceTask.getFieldExtensions(), didWriteExtensionStartElement, xtw);
}
return didWriteExtensionStartElement;
}