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();
}
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;
}
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;
}
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();
}
Aggregations