Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.SequenceFlow


                if(root instanceof Process) {
                    Process process = (Process) root;
                    List<FlowElement> flowElements = process.getFlowElements();
                    for(FlowElement fe : flowElements) {
                        if(fe instanceof SequenceFlow) {
                            SequenceFlow sf = (SequenceFlow) fe;
                            if(sequenceFlowMapping.containsKey(sf.getId())) {
                                sf.setSourceRef(getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("sourceRef")));
                                sf.setTargetRef(getFlowNode(def, sequenceFlowMapping.get(sf.getId()).get("targetRef")));
                            } else {
                                _logger.error("Could not find mapping for sequenceFlow: " + sf.getId());
                            }
                        }
                    }
                }
            }
View Full Code Here


                                shape.setBpmnElement(flowElement);
                                shape.setBounds(b);
                                plane.getPlaneElement().add(shape);
                            }
                        } else if (flowElement instanceof SequenceFlow) {
                            SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
                            BPMNEdge edge = diFactory.createBPMNEdge();
                            edge.setBpmnElement(flowElement);
                            DcFactory dcFactory = DcFactory.eINSTANCE;
                            Point point = dcFactory.createPoint();
                            if(sequenceFlow.getSourceRef() != null) {
                                Bounds sourceBounds = _bounds.get(sequenceFlow.getSourceRef().getId());
                                point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
                                point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
                            }
                            edge.getWaypoint().add(point);
//                List<Point> dockers = _dockers.get(sequenceFlow.getId());
//                for (int i = 1; i < dockers.size() - 1; i++) {
//                  edge.getWaypoint().add(dockers.get(i));
//                }
                            point = dcFactory.createPoint();
                            if(sequenceFlow.getTargetRef() != null) {
                                Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId());
                                point.setX(targetBounds.getX() + (targetBounds.getWidth()/2));
                                point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
                            }
                            edge.getWaypoint().add(point);
                            plane.getPlaneElement().add(edge);
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.SEQUENCE_FLOW: {
            SequenceFlow sequenceFlow = (SequenceFlow) theEObject;
            T result = caseSequenceFlow(sequenceFlow);
            if (result == null)
                result = caseFlowElement(sequenceFlow);
            if (result == null)
                result = caseBaseElement(sequenceFlow);
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setDefault(SequenceFlow newDefault) {
        SequenceFlow oldDefault = default_;
        default_ = newDefault;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.EXCLUSIVE_GATEWAY__DEFAULT, oldDefault, default_));
    }
View Full Code Here

    List<TaskCommand> taskCommands = new ArrayList<TaskCommand>();
    for (FlowElement flowElement : flowElements) {
      if (flowElement instanceof StartEvent) {
        if (((StartEvent) flowElement).getOutgoing().size() == 1) {
          SequenceFlow sequenceFlow = (((StartEvent) flowElement).getOutgoing()).get(0);
          if (sequenceFlow.getTargetRef() instanceof UserTask) {
            UserTask userTask = (UserTask) sequenceFlow.getTargetRef();
            for (ExtensionAttributeValue extensionAttributeValue : userTask.getExtensionValues()) {
              FeatureMap extensionElements = extensionAttributeValue.getValue();
              for (Entry entry : extensionElements) {
                if (entry.getValue() instanceof TaskCommand) {
                  TaskCommand taskCommand = (TaskCommand) entry.getValue();
View Full Code Here

  private void addAllSequenceFlows(Collection<FlowElement> flowElementList,
      Map<String, SequenceFlow> flowSourceMap, Map<String, SequenceFlow> flowTargetMap) {
   
    for (FlowElement flowElement : flowElementList) {
      if (flowElement instanceof SequenceFlow) {
        SequenceFlow flow = (SequenceFlow) flowElement;
        flowSourceMap.put(flow.getSourceRef().getId(), flow);
        flowTargetMap.put(flow.getTargetRef().getId(), flow);
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        addAllSequenceFlows(subProcess.getFlowElements(), flowSourceMap, flowTargetMap);
      }
    }
View Full Code Here

    String label = ((FlowElement) getBaseElement(bpmnEdge.getBpmnElement())).getName();
    // line.setLineType(LineType.ConditionalFlow);

    SvgLineTo line = new SvgLineTo();

    SequenceFlow sequenceFlow = (SequenceFlow) getBaseElement(bpmnEdge.getBpmnElement());

    line.setLineType(LineType.SequenceFlow);

    if (sequenceFlow.getConditionExpression() != null) {
      line.setLineType(LineType.ConditionalFlow);
    }

    if (sequenceFlow.getTargetRef() instanceof Activity) {
      Activity activity = (Activity) sequenceFlow.getTargetRef();
      if (activity.getDefault() != null && activity.getDefault().equals(sequenceFlow)) {
        line.setLineType(LineType.DefaultFlow);
      }
    }

    if (sequenceFlow.getTargetRef() instanceof Gateway) {
      if (sequenceFlow.getTargetRef() instanceof ComplexGateway) {
        ComplexGateway complexGateway = (ComplexGateway) sequenceFlow.getTargetRef();
        if (complexGateway.getDefault() != null && complexGateway.getDefault().equals(sequenceFlow)) {
          line.setLineType(LineType.DefaultFlow);
        }
        // ExclusiveGateway //InclusiveGateway
      }
      if (sequenceFlow.getTargetRef() instanceof ExclusiveGateway) {
        ExclusiveGateway exclusiveGateway = (ExclusiveGateway) sequenceFlow.getTargetRef();
        if (exclusiveGateway.getDefault() != null && exclusiveGateway.getDefault().equals(sequenceFlow)) {
          line.setLineType(LineType.DefaultFlow);
        }
        // ExclusiveGateway //InclusiveGateway
      }
      if (sequenceFlow.getTargetRef() instanceof InclusiveGateway) {
        InclusiveGateway inclusiveGateway = (InclusiveGateway) sequenceFlow.getTargetRef();
        if (inclusiveGateway.getDefault() != null && inclusiveGateway.getDefault().equals(sequenceFlow)) {
          line.setLineType(LineType.DefaultFlow);
        }
        // ExclusiveGateway //InclusiveGateway
      }
View Full Code Here

    // nothing to do
  }
 
  @Override
  protected FlowElement convertJsonToElement(JsonNode elementNode,JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    SequenceFlow flow = Bpmn2Factory.eINSTANCE.createSequenceFlow();// SequenceFlow();
    String conditionString = getPropertyValueAsString(PROPERTY_SEQUENCEFLOW_CONDITION, elementNode);
    if (conditionString != null && StringUtil.isNotEmpty(conditionString)) {
      FormalExpression formalExpression = Bpmn2Factory.eINSTANCE.createFormalExpression();
      //formalExpression.setId("aaaaa");
      formalExpression.setBody(conditionString);
      flow.setConditionExpression(formalExpression);
    }
    String orderId = getPropertyValueAsString(PROPERTY_SEQUENCEFLOW_ORDERID, elementNode);
    if (orderId != null && StringUtil.isNotEmpty(orderId)) {
      BpmnModelUtil.addExtensionAttribute(flow, FixFlowPackage.Literals.DOCUMENT_ROOT__ORDER_ID, orderId);
    }
View Full Code Here

   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setDefault(SequenceFlow newDefault) {
    SequenceFlow oldDefault = default_;
    default_ = newDefault;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.ACTIVITY__DEFAULT, oldDefault, default_));
  }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setDefault(SequenceFlow newDefault) {
        SequenceFlow oldDefault = default_;
        default_ = newDefault;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.COMPLEX_GATEWAY__DEFAULT, oldDefault, default_));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.SequenceFlow

Copyright © 2018 www.massapicom. 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.