AttributeMap flowAttributes = getFlowAttributes(location.getAttributes());
return flowResourceFactory.createResource(location.getPath(), flowAttributes, location.getId());
}
private AttributeMap getFlowAttributes(Set attributes) {
MutableAttributeMap flowAttributes = null;
if (flowBuilderServices.getDevelopment()) {
flowAttributes = new LocalAttributeMap(1 + attributes.size(), 1);
flowAttributes.put("development", Boolean.TRUE);
}
if (!attributes.isEmpty()) {
if (flowAttributes == null) {
flowAttributes = new LocalAttributeMap(attributes.size(), 1);
}
for (Iterator it = attributes.iterator(); it.hasNext();) {
FlowElementAttribute attribute = (FlowElementAttribute) it.next();
flowAttributes.put(attribute.getName(), getConvertedValue(attribute));
}
}
return flowAttributes;
}