use of org.activiti.engine.impl.bpmn.data.SimpleStructureDefinition in project Activiti by Activiti.
the class WSDLImporter method createDefaultStructures.
private void createDefaultStructures(Element rootTypes) {
NodeList complexTypes = rootTypes.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "complexType");
for (int i = 0; i < complexTypes.getLength(); i++) {
Element element = (Element) complexTypes.item(i);
String structureName = this.namespace + element.getAttribute("name");
SimpleStructureDefinition structure = new SimpleStructureDefinition(structureName);
this.structures.put(structure.getId(), structure);
}
}
use of org.activiti.engine.impl.bpmn.data.SimpleStructureDefinition in project Activiti by Activiti.
the class WSDLImporterTest method assertStructure.
private void assertStructure(StructureDefinition structure, String structureId, String[] parameters, Class<?>[] classes) {
SimpleStructureDefinition simpleStructure = (SimpleStructureDefinition) structure;
assertEquals(structureId, simpleStructure.getId());
for (int i = 0; i < simpleStructure.getFieldSize(); i++) {
assertEquals(parameters[i], simpleStructure.getFieldNameAt(i));
assertEquals(classes[i], simpleStructure.getFieldTypeAt(i));
}
}
use of org.activiti.engine.impl.bpmn.data.SimpleStructureDefinition in project Activiti by Activiti.
the class CxfWSDLImporter method importStructure.
protected void importStructure(Mapping mapping) {
QName qname = mapping.getElement();
final JType type = mapping.getType().getTypeClass();
if (type.isPrimitive()) {
final Class<?> primitiveClass = ReflectUtil.loadClass(type.boxify().fullName());
final StructureDefinition structure = new PrimitiveStructureDefinition(this.namespace + qname.getLocalPart(), primitiveClass);
this.structures.put(structure.getId(), structure);
} else if (type instanceof JDefinedClass) {
JDefinedClass theClass = (JDefinedClass) type;
SimpleStructureDefinition structure = new SimpleStructureDefinition(this.namespace + qname.getLocalPart());
this.structures.put(structure.getId(), structure);
importFields(theClass, structure);
} else {
final Class<?> referencedClass = ReflectUtil.loadClass(type.fullName());
final StructureDefinition structure = new PrimitiveStructureDefinition(this.namespace + qname.getLocalPart(), referencedClass);
this.structures.put(structure.getId(), structure);
}
}
use of org.activiti.engine.impl.bpmn.data.SimpleStructureDefinition in project Activiti by Activiti.
the class WSDLImporter method importStructure.
private void importStructure(Mapping mapping) {
QName qname = mapping.getElement();
JDefinedClass theClass = (JDefinedClass) mapping.getType().getTypeClass();
SimpleStructureDefinition structure = (SimpleStructureDefinition) this.structures.get(this.namespace + qname.getLocalPart());
Map<String, JFieldVar> fields = theClass.fields();
int index = 0;
for (Entry<String, JFieldVar> entry : fields.entrySet()) {
Class<?> fieldClass = ReflectUtil.loadClass(entry.getValue().type().boxify().fullName());
structure.setFieldName(index, entry.getKey(), fieldClass);
index++;
}
}
Aggregations