Search in sources :

Example 1 with ClassStructureDefinition

use of org.activiti.engine.impl.bpmn.data.ClassStructureDefinition in project Activiti by Activiti.

the class BpmnParse method createItemDefinitions.

protected void createItemDefinitions() {
    for (org.activiti.bpmn.model.ItemDefinition itemDefinitionElement : bpmnModel.getItemDefinitions().values()) {
        StructureDefinition structure = null;
        try {
            // it is a class
            Class<?> classStructure = ReflectUtil.loadClass(itemDefinitionElement.getStructureRef());
            structure = new ClassStructureDefinition(classStructure);
        } catch (ActivitiException e) {
            // it is a reference to a different structure
            structure = this.structures.get(itemDefinitionElement.getStructureRef());
        }
        ItemDefinition itemDefinition = new ItemDefinition(itemDefinitionElement.getId(), structure);
        if (StringUtils.isNotEmpty(itemDefinitionElement.getItemKind())) {
            itemDefinition.setItemKind(ItemKind.valueOf(itemDefinitionElement.getItemKind()));
        }
        itemDefinitions.put(itemDefinition.getId(), itemDefinition);
    }
}
Also used : ClassStructureDefinition(org.activiti.engine.impl.bpmn.data.ClassStructureDefinition) StructureDefinition(org.activiti.engine.impl.bpmn.data.StructureDefinition) ClassStructureDefinition(org.activiti.engine.impl.bpmn.data.ClassStructureDefinition) ActivitiException(org.activiti.engine.ActivitiException) ItemDefinition(org.activiti.engine.impl.bpmn.data.ItemDefinition)

Aggregations

ActivitiException (org.activiti.engine.ActivitiException)1 ClassStructureDefinition (org.activiti.engine.impl.bpmn.data.ClassStructureDefinition)1 ItemDefinition (org.activiti.engine.impl.bpmn.data.ItemDefinition)1 StructureDefinition (org.activiti.engine.impl.bpmn.data.StructureDefinition)1