}
@Override
protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception {
ValuedDataObject dataObject = null;
ItemDefinition itemSubjectRef = new ItemDefinition();
String structureRef = xtr.getAttributeValue(null, ATTRIBUTE_DATA_ITEM_REF);
if (StringUtils.isNotEmpty(structureRef) && structureRef.contains(":")) {
String dataType = structureRef.substring(structureRef.indexOf(':') + 1);
if (dataType.equals("string")) {
dataObject = new StringDataObject();
} else if (dataType.equals("int")) {
dataObject = new IntegerDataObject();
} else if (dataType.equals("long")) {
dataObject = new LongDataObject();
} else if (dataType.equals("double")) {
dataObject = new DoubleDataObject();
} else if (dataType.equals("boolean")) {
dataObject = new BooleanDataObject();
} else if (dataType.equals("datetime")) {
dataObject = new DateDataObject();
} else {
LOGGER.error("Error converting {}, invalid data type: " + dataType, xtr.getAttributeValue(null, ATTRIBUTE_DATA_NAME));
}
} else {
// use String as default type
dataObject = new StringDataObject();
structureRef = "xsd:string";
}
if (dataObject != null) {
dataObject.setId(xtr.getAttributeValue(null, ATTRIBUTE_DATA_ID));
dataObject.setName(xtr.getAttributeValue(null, ATTRIBUTE_DATA_NAME));
BpmnXMLUtil.addXMLLocation(dataObject, xtr);
itemSubjectRef.setStructureRef(structureRef);
dataObject.setItemSubjectRef(itemSubjectRef);
parseChildElements(getXMLElementName(), dataObject, model, xtr);
List<ExtensionElement> valuesElement = dataObject.getExtensionElements().get("value");