public virtual IBpmnEdge CreateBpmnEdge(ISequenceFlow sequenceFlow) { IBpmnPlane bpmnPlane = FindBpmnPlane(); if (bpmnPlane != null) { IBpmnEdge edge = CreateInstance <IBpmnEdge>(typeof(IBpmnEdge)); edge.BpmnElement = sequenceFlow; Waypoints = edge; bpmnPlane.AddChildElement(edge); return(edge); } return(null); }
public virtual IBpmnShape CreateBpmnShape(IFlowNode node) { IBpmnPlane bpmnPlane = FindBpmnPlane(); if (bpmnPlane != null) { IBpmnShape bpmnShape = CreateInstance <IBpmnShape>(typeof(IBpmnShape)); bpmnShape.BpmnElement = node; IBounds nodeBounds = CreateInstance <IBounds>(typeof(IBounds)); if (node is ISubProcess) { bpmnShape.Expanded = true; nodeBounds.SetWidth(350); nodeBounds.SetHeight(200); } else if (node is IActivity) { nodeBounds.SetWidth(100); nodeBounds.SetHeight(80); } else if (node is IEvent) { nodeBounds.SetWidth(36); nodeBounds.SetHeight(36); } else if (node is IGateway) { nodeBounds.SetWidth(50); nodeBounds.SetHeight(50); } nodeBounds.SetX(0); nodeBounds.SetY(0); bpmnShape.AddChildElement(nodeBounds); bpmnPlane.AddChildElement(bpmnShape); return(bpmnShape); } return(null); }