Search in sources :

Example 1 with ExecutionListenerParser

use of org.activiti.bpmn.converter.child.ExecutionListenerParser in project Activiti by Activiti.

the class ExtensionElementsParser method parse.

public void parse(XMLStreamReader xtr, List<SubProcess> activeSubProcessList, Process activeProcess, BpmnModel model) throws Exception {
    BaseElement parentElement = null;
    if (!activeSubProcessList.isEmpty()) {
        parentElement = activeSubProcessList.get(activeSubProcessList.size() - 1);
    } else {
        parentElement = activeProcess;
    }
    boolean readyWithChildElements = false;
    while (readyWithChildElements == false && xtr.hasNext()) {
        xtr.next();
        if (xtr.isStartElement()) {
            if (ELEMENT_EXECUTION_LISTENER.equals(xtr.getLocalName())) {
                new ExecutionListenerParser().parseChildElement(xtr, parentElement, model);
            } else if (ELEMENT_EVENT_LISTENER.equals(xtr.getLocalName())) {
                new ActivitiEventListenerParser().parseChildElement(xtr, parentElement, model);
            } else if (ELEMENT_POTENTIAL_STARTER.equals(xtr.getLocalName())) {
                new PotentialStarterParser().parse(xtr, activeProcess);
            } else {
                ExtensionElement extensionElement = BpmnXMLUtil.parseExtensionElement(xtr);
                parentElement.addExtensionElement(extensionElement);
            }
        } else if (xtr.isEndElement()) {
            if (ELEMENT_EXTENSIONS.equals(xtr.getLocalName())) {
                readyWithChildElements = true;
            }
        }
    }
}
Also used : BaseElement(org.activiti.bpmn.model.BaseElement) ExecutionListenerParser(org.activiti.bpmn.converter.child.ExecutionListenerParser) ActivitiEventListenerParser(org.activiti.bpmn.converter.child.ActivitiEventListenerParser) ExtensionElement(org.activiti.bpmn.model.ExtensionElement)

Aggregations

ActivitiEventListenerParser (org.activiti.bpmn.converter.child.ActivitiEventListenerParser)1 ExecutionListenerParser (org.activiti.bpmn.converter.child.ExecutionListenerParser)1 BaseElement (org.activiti.bpmn.model.BaseElement)1 ExtensionElement (org.activiti.bpmn.model.ExtensionElement)1