Search in sources :

Example 1 with ModelElementType

use of org.camunda.bpm.model.xml.type.ModelElementType in project camunda-dmn-model by camunda.

the class ExtensionElementsImpl method addExtensionElement.

public ModelElementInstance addExtensionElement(String namespaceUri, String localName) {
    ModelElementType extensionElementType = modelInstance.registerGenericType(namespaceUri, localName);
    ModelElementInstance extensionElement = extensionElementType.newInstance(modelInstance);
    addChildElement(extensionElement);
    return extensionElement;
}
Also used : ModelElementType(org.camunda.bpm.model.xml.type.ModelElementType) ModelElementInstance(org.camunda.bpm.model.xml.instance.ModelElementInstance)

Example 2 with ModelElementType

use of org.camunda.bpm.model.xml.type.ModelElementType in project camunda-xml-model by camunda.

the class ModelUtil method calculateAllBaseTypes.

/**
 * Calculate a collection of all base types for the given type
 */
public static Collection<ModelElementType> calculateAllBaseTypes(ModelElementType type) {
    List<ModelElementType> baseTypes = new ArrayList<ModelElementType>();
    ModelElementTypeImpl typeImpl = (ModelElementTypeImpl) type;
    typeImpl.resolveBaseTypes(baseTypes);
    return baseTypes;
}
Also used : ModelElementType(org.camunda.bpm.model.xml.type.ModelElementType) ModelElementTypeImpl(org.camunda.bpm.model.xml.impl.type.ModelElementTypeImpl)

Example 3 with ModelElementType

use of org.camunda.bpm.model.xml.type.ModelElementType in project camunda-xml-model by camunda.

the class AttributeAssert method hasOwningElementType.

public AttributeAssert hasOwningElementType(ModelElementType owningElementType) {
    isNotNull();
    ModelElementType actualOwningElementType = actual.getOwningElementType();
    if (!owningElementType.equals(actualOwningElementType)) {
        failWithMessage("Expected attribute <%s> to have owning element type <%s> but was <%s>", attributeName, owningElementType, actualOwningElementType);
    }
    return this;
}
Also used : ModelElementType(org.camunda.bpm.model.xml.type.ModelElementType)

Example 4 with ModelElementType

use of org.camunda.bpm.model.xml.type.ModelElementType in project camunda-xml-model by camunda.

the class ChildElementAssert method hasParentElementType.

public ChildElementAssert hasParentElementType(ModelElementType parentElementType) {
    isNotNull();
    ModelElementType actualParentElementType = actual.getParentElementType();
    if (!parentElementType.equals(actualParentElementType)) {
        failWithMessage("Expected child element <%s> to have parent element type <%s> but has <%s>", typeClass, parentElementType.getTypeName(), actualParentElementType.getTypeName());
    }
    return this;
}
Also used : ModelElementType(org.camunda.bpm.model.xml.type.ModelElementType)

Example 5 with ModelElementType

use of org.camunda.bpm.model.xml.type.ModelElementType in project camunda-xml-model by camunda.

the class ModelElementTypeAssert method getTypeNames.

private Collection<String> getTypeNames(Collection<ModelElementType> elementTypes) {
    List<String> typeNames = new ArrayList<String>();
    QName qName;
    for (ModelElementType elementType : elementTypes) {
        qName = new QName(elementType.getTypeNamespace(), elementType.getTypeName());
        typeNames.add(qName.toString());
    }
    return typeNames;
}
Also used : ModelElementType(org.camunda.bpm.model.xml.type.ModelElementType) QName(org.camunda.bpm.model.xml.impl.util.QName) ArrayList(java.util.ArrayList)

Aggregations

ModelElementType (org.camunda.bpm.model.xml.type.ModelElementType)34 Test (org.junit.Test)11 ArrayList (java.util.ArrayList)9 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)8 Model (org.camunda.bpm.model.xml.Model)3 TestModelTest (org.camunda.bpm.model.xml.testmodel.TestModelTest)3 ModelException (org.camunda.bpm.model.xml.ModelException)2 ModelInstanceImpl (org.camunda.bpm.model.xml.impl.ModelInstanceImpl)2 ModelElementTypeImpl (org.camunda.bpm.model.xml.impl.type.ModelElementTypeImpl)2 DomElement (org.camunda.bpm.model.xml.instance.DomElement)2 Before (org.junit.Before)2 PlanItemDefinition (org.camunda.bpm.model.cmmn.instance.PlanItemDefinition)1 CamundaString (org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)1 ModelBuildOperation (org.camunda.bpm.model.xml.impl.ModelBuildOperation)1 QName (org.camunda.bpm.model.xml.impl.util.QName)1 AnimalTest (org.camunda.bpm.model.xml.testmodel.instance.AnimalTest)1 Attribute (org.camunda.bpm.model.xml.type.attribute.Attribute)1 Reference (org.camunda.bpm.model.xml.type.reference.Reference)1