Search in sources :

Example 1 with BpmnPlane

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane in project camunda-bpmn-model by camunda.

the class BpmnPlaneImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(BpmnPlane.class, BPMNDI_ELEMENT_BPMN_PLANE).namespaceUri(BPMNDI_NS).extendsType(Plane.class).instanceProvider(new ModelTypeInstanceProvider<BpmnPlane>() {

        public BpmnPlane newInstance(ModelTypeInstanceContext instanceContext) {
            return new BpmnPlaneImpl(instanceContext);
        }
    });
    bpmnElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_BPMN_ELEMENT).qNameAttributeReference(BaseElement.class).build();
    typeBuilder.build();
}
Also used : BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) Plane(org.camunda.bpm.model.bpmn.instance.di.Plane) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with BpmnPlane

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane in project camunda-bpmn-model by camunda.

the class AbstractBaseElementBuilder method createEdge.

public BpmnEdge createEdge(BaseElement baseElement) {
    BpmnPlane bpmnPlane = findBpmnPlane();
    if (bpmnPlane != null) {
        BpmnEdge edge = createInstance(BpmnEdge.class);
        edge.setBpmnElement(baseElement);
        setWaypoints(edge);
        bpmnPlane.addChildElement(edge);
        return edge;
    }
    return null;
}
Also used : BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Example 3 with BpmnPlane

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane in project camunda-bpmn-model by camunda.

the class AbstractBaseElementBuilder method createBpmnShape.

public BpmnShape createBpmnShape(FlowNode node) {
    BpmnPlane bpmnPlane = findBpmnPlane();
    if (bpmnPlane != null) {
        BpmnShape bpmnShape = createInstance(BpmnShape.class);
        bpmnShape.setBpmnElement(node);
        Bounds nodeBounds = createInstance(Bounds.class);
        if (node instanceof SubProcess) {
            bpmnShape.setExpanded(true);
            nodeBounds.setWidth(350);
            nodeBounds.setHeight(200);
        } else if (node instanceof Activity) {
            nodeBounds.setWidth(100);
            nodeBounds.setHeight(80);
        } else if (node instanceof Event) {
            nodeBounds.setWidth(36);
            nodeBounds.setHeight(36);
        } else if (node instanceof Gateway) {
            nodeBounds.setWidth(50);
            nodeBounds.setHeight(50);
            if (node instanceof ExclusiveGateway) {
                bpmnShape.setMarkerVisible(true);
            }
        }
        nodeBounds.setX(0);
        nodeBounds.setY(0);
        bpmnShape.addChildElement(nodeBounds);
        bpmnPlane.addChildElement(bpmnShape);
        return bpmnShape;
    }
    return null;
}
Also used : BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) BpmnShape(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape) Bounds(org.camunda.bpm.model.bpmn.instance.dc.Bounds)

Example 4 with BpmnPlane

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane in project camunda-bpmn-model by camunda.

the class Bpmn method createProcess.

public static ProcessBuilder createProcess() {
    BpmnModelInstance modelInstance = INSTANCE.doCreateEmptyModel();
    Definitions definitions = modelInstance.newInstance(Definitions.class);
    definitions.setTargetNamespace(BPMN20_NS);
    definitions.getDomElement().registerNamespace("camunda", CAMUNDA_NS);
    modelInstance.setDefinitions(definitions);
    Process process = modelInstance.newInstance(Process.class);
    definitions.addChildElement(process);
    BpmnDiagram bpmnDiagram = modelInstance.newInstance(BpmnDiagram.class);
    BpmnPlane bpmnPlane = modelInstance.newInstance(BpmnPlane.class);
    bpmnPlane.setBpmnElement(process);
    bpmnDiagram.addChildElement(bpmnPlane);
    definitions.addChildElement(bpmnDiagram);
    return process.builder();
}
Also used : BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) Definitions(org.camunda.bpm.model.bpmn.instance.Definitions) Process(org.camunda.bpm.model.bpmn.instance.Process) BpmnDiagram(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnDiagram)

Aggregations

BpmnPlane (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane)4 Definitions (org.camunda.bpm.model.bpmn.instance.Definitions)1 Process (org.camunda.bpm.model.bpmn.instance.Process)1 BpmnDiagram (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnDiagram)1 BpmnEdge (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)1 BpmnShape (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape)1 Bounds (org.camunda.bpm.model.bpmn.instance.dc.Bounds)1 Plane (org.camunda.bpm.model.bpmn.instance.di.Plane)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1