use of org.activiti.bpmn.model.CustomProperty in project Activiti by Activiti.
the class UserTaskXMLConverter method writeExtensionChildElements.
@Override
protected boolean writeExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
UserTask userTask = (UserTask) element;
didWriteExtensionStartElement = writeFormProperties(userTask, didWriteExtensionStartElement, xtw);
didWriteExtensionStartElement = writeCustomIdentities(element, didWriteExtensionStartElement, xtw);
if (!userTask.getCustomProperties().isEmpty()) {
for (CustomProperty customProperty : userTask.getCustomProperties()) {
if (StringUtils.isEmpty(customProperty.getSimpleValue())) {
continue;
}
if (didWriteExtensionStartElement == false) {
xtw.writeStartElement(ELEMENT_EXTENSIONS);
didWriteExtensionStartElement = true;
}
xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, customProperty.getName(), ACTIVITI_EXTENSIONS_NAMESPACE);
xtw.writeCData(customProperty.getSimpleValue());
xtw.writeEndElement();
}
}
return didWriteExtensionStartElement;
}
use of org.activiti.bpmn.model.CustomProperty in project Activiti by Activiti.
the class ServiceTaskXMLConverter method writeExtensionChildElements.
@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.writeCData(customProperty.getSimpleValue());
xtw.writeEndElement();
xtw.writeEndElement();
}
} else {
didWriteExtensionStartElement = FieldExtensionExport.writeFieldExtensions(serviceTask.getFieldExtensions(), didWriteExtensionStartElement, xtw);
}
return didWriteExtensionStartElement;
}
Aggregations