Search in sources :

Example 6 with DomDocument

use of org.camunda.bpm.model.xml.instance.DomDocument in project camunda-xml-model by camunda.

the class ModelElementTypeImpl method newInstance.

public ModelElementInstance newInstance(ModelInstance modelInstance) {
    ModelInstanceImpl modelInstanceImpl = (ModelInstanceImpl) modelInstance;
    DomDocument document = modelInstanceImpl.getDocument();
    DomElement domElement = document.createElement(typeNamespace, typeName);
    return newInstance(modelInstanceImpl, domElement);
}
Also used : DomElement(org.camunda.bpm.model.xml.instance.DomElement) ModelInstanceImpl(org.camunda.bpm.model.xml.impl.ModelInstanceImpl) DomDocument(org.camunda.bpm.model.xml.instance.DomDocument)

Example 7 with DomDocument

use of org.camunda.bpm.model.xml.instance.DomDocument in project camunda-xml-model by camunda.

the class ModelElementTypeImpl method getInstances.

public Collection<ModelElementInstance> getInstances(ModelInstance modelInstance) {
    ModelInstanceImpl modelInstanceImpl = (ModelInstanceImpl) modelInstance;
    DomDocument document = modelInstanceImpl.getDocument();
    List<DomElement> elements = getElementsByNameNs(document, typeNamespace);
    List<ModelElementInstance> resultList = new ArrayList<ModelElementInstance>();
    for (DomElement element : elements) {
        resultList.add(ModelUtil.getModelElement(element, modelInstanceImpl, this));
    }
    return resultList;
}
Also used : DomElement(org.camunda.bpm.model.xml.instance.DomElement) ModelElementInstance(org.camunda.bpm.model.xml.instance.ModelElementInstance) ArrayList(java.util.ArrayList) ModelInstanceImpl(org.camunda.bpm.model.xml.impl.ModelInstanceImpl) DomDocument(org.camunda.bpm.model.xml.instance.DomDocument)

Aggregations

DomDocument (org.camunda.bpm.model.xml.instance.DomDocument)7 DomElement (org.camunda.bpm.model.xml.instance.DomElement)5 ArrayList (java.util.ArrayList)4 ModelException (org.camunda.bpm.model.xml.ModelException)3 ModelInstanceImpl (org.camunda.bpm.model.xml.impl.ModelInstanceImpl)2 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)1 After (org.junit.After)1