Examples of BPMNDiagram


Examples of org.eclipse.bpmn2.di.BPMNDiagram

            for (RootElement rootElement: def.getRootElements()) {
                if (rootElement instanceof Process) {
                    Process process = (Process) rootElement;
                    BpmnDiFactory diFactory = BpmnDiFactory.eINSTANCE;
                    BPMNDiagram diagram = diFactory.createBPMNDiagram();
                    BPMNPlane plane = diFactory.createBPMNPlane();
                    plane.setBpmnElement(process);
                    diagram.setPlane(plane);
                    for (FlowElement flowElement: process.getFlowElements()) {
                        if (flowElement instanceof FlowNode) {
                            Bounds b = _bounds.get(flowElement.getId());
                            if (b != null) {
                                BPMNShape shape = diFactory.createBPMNShape();
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

    private void createDiagram(Definitions def) {
      for (RootElement rootElement: def.getRootElements()) {
        if (rootElement instanceof Process) {
          Process process = (Process) rootElement;
            BpmnDiFactory factory = BpmnDiFactory.eINSTANCE;
            BPMNDiagram diagram = factory.createBPMNDiagram();
            BPMNPlane plane = factory.createBPMNPlane();
            plane.setBpmnElement(process);
            diagram.setPlane(plane);
          // first process flowNodes
            for (FlowElement flowElement: process.getFlowElements()) {
              if (flowElement instanceof FlowNode) {
                Bounds b = _bounds.get(flowElement.getId());
                if (b != null) {
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case BpmnDiPackage.BPMN_DIAGRAM: {
            BPMNDiagram bpmnDiagram = (BPMNDiagram) theEObject;
            T result = caseBPMNDiagram(bpmnDiagram);
            if (result == null)
                result = caseDiagram(bpmnDiagram);
            if (result == null)
                result = defaultCase(theEObject);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

    //加载一个空的definitions
   
    String nodeTempPath = ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration().getCopyTemplatePath();
    InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(nodeTempPath);
    Definitions bpmnModel = new FixFlowConverter().getDefinitions("temp", inputStream);
    BPMNDiagram bpmnDiagram=bpmnModel.getDiagrams().get(0);
    BPMNPlane bpmnPlane = bpmnDiagram.getPlane();
    Process process = (Process)bpmnModel.getRootElements().get(0);
    Map<String, JsonNode> shapeMap = new HashMap<String, JsonNode> ();
    Map<String, JsonNode> sourceRefMap = new HashMap<String, JsonNode>();
    Map<String, JsonNode> edgeMap = new HashMap<String, JsonNode>();
    Map<String, List<JsonNode>> sourceAndTargetMap = new HashMap<String, List<JsonNode>>();
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

    Diagram diagram = peService.getDiagramForShape(choreographyContainer);
    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
        ChoreographyActivity.class);

    BPMNDiagram dia = BusinessObjectUtil.getFirstElementOfType(diagram, BPMNDiagram.class);
    List<DiagramElement> diElements = dia.getPlane().getPlaneElement();
    for (int i = 0; i < currentParticipantContainers.size(); i++) {
      ContainerShape container = currentParticipantContainers.get(i);
      for (Connection c : peService.getOutgoingConnections(container)) {
        EObject parent = c.getEnd().eContainer();
        if (parent instanceof PictogramElement) {
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

    if (shape == null) {
      EList<EObject> businessObjects = Graphiti.getLinkService().getLinkForPictogramElement(getDiagram())
          .getBusinessObjects();
      for (EObject eObject : businessObjects) {
        if (eObject instanceof BPMNDiagram) {
          BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

          shape = BpmnDiFactory.eINSTANCE.createBPMNShape();
//          shape.setId(EcoreUtil.generateUUID());
          shape.setBpmnElement(elem);
          Bounds bounds = DcFactory.eINSTANCE.createBounds();
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

    if (edge == null) {
      EList<EObject> businessObjects = Graphiti.getLinkService().getLinkForPictogramElement(getDiagram())
          .getBusinessObjects();
      for (EObject eObject : businessObjects) {
        if (eObject instanceof BPMNDiagram) {
          BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

          edge = BpmnDiFactory.eINSTANCE.createBPMNEdge();
//          edge.setId(EcoreUtil.generateUUID());
          edge.setBpmnElement(conElement);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

        if (diagrams.size() == 0) {
          BPMNPlane plane = BpmnDiFactory.eINSTANCE.createBPMNPlane();
          plane.setBpmnElement(modelHandler.getOrCreateProcess(modelHandler.getInternalParticipant()));

          BPMNDiagram d = BpmnDiFactory.eINSTANCE.createBPMNDiagram();
          d.setPlane(plane);

          modelHandler.getDefinitions().getDiagrams().add(d);
          featureProvider.link(diagram, d);
        }

        // First: add all IDs to our ID mapping table
        for (BPMNDiagram d : diagrams) {
          TreeIterator<EObject> iter = d.eAllContents();
          while (iter.hasNext()) {
            ModelUtil.addID( iter.next() );
          }
        }
       
        for (BPMNDiagram d : diagrams) {
          featureProvider.link(diagram, d);
          BPMNPlane plane = d.getPlane();
          if (plane.getBpmnElement() == null) {
            plane.setBpmnElement(modelHandler.getOrCreateProcess(modelHandler.getInternalParticipant()));
          }
          List<DiagramElement> ownedElement = plane.getPlaneElement();
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNDiagram

        .getBusinessObjects();
    BPMNShape bpmnShape = null;

    for (EObject eObject : businessObjects) {
      if (eObject instanceof BPMNDiagram) {
        BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

        bpmnShape = BpmnDiFactory.eINSTANCE.createBPMNShape();
//        bpmnShape.setId(EcoreUtil.generateUUID());
        bpmnShape.setBpmnElement(elem);
        Bounds bounds = DcFactory.eINSTANCE.createBounds();
        bounds.setX(x);
        bounds.setY(y);
        bounds.setWidth(w);
        bounds.setHeight(h);
        bpmnShape.setBounds(bounds);

        List<DiagramElement> elements = bpmnDiagram.getPlane().getPlaneElement();
        elements.add(bpmnShape);
        ModelUtil.setID(shape);

        fp.link(shape, new Object[] { elem, bpmnShape });
        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.