Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.SequenceFlow


     * <!-- 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.INCLUSIVE_GATEWAY__DEFAULT, oldDefault, default_));
    }
View Full Code Here


    Process process = getOrCreateProcess(getInternalParticipant());
    process.getLaneSets().add(laneSet);
  }

  public SequenceFlow createSequenceFlow(FlowNode source, FlowNode target) {
    SequenceFlow sequenceFlow = FACTORY.createSequenceFlow();
//    sequenceFlow.setId(EcoreUtil.generateUUID());
    ModelUtil.setID(sequenceFlow,resource);

    addFlowElement(source, sequenceFlow);
    sequenceFlow.setSourceRef(source);
    sequenceFlow.setTargetRef(target);
    return sequenceFlow;
  }
View Full Code Here

    return Graphiti.getGaService().manageColor(diagram, colorConstant);
  }
 
  private static void setDefaultSequenceFlow(Connection connection) {
    IPeService peService = Graphiti.getPeService();
    SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);
    SequenceFlow defaultFlow = getDefaultFlow(flow.getSourceRef());
    boolean isDefault = defaultFlow == null ? false : defaultFlow.equals(flow);

    Tuple<ConnectionDecorator, ConnectionDecorator> decorators = getConnectionDecorators(connection);
    ConnectionDecorator def = decorators.getFirst();
    ConnectionDecorator cond = decorators.getSecond();
View Full Code Here

    }
  }

  private static void setConditionalSequenceFlow(Connection connection) {
    IPeService peService = Graphiti.getPeService();
    SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);

    Tuple<ConnectionDecorator, ConnectionDecorator> decorators = getConnectionDecorators(connection);
    ConnectionDecorator def = decorators.getFirst();
    ConnectionDecorator cond = decorators.getSecond();

    if (flow.getConditionExpression() != null && flow.getSourceRef() instanceof Activity && def == null) {
      ConnectionDecorator decorator = createConditionalConnectionDecorator(connection);
      GraphicsAlgorithm ga = decorator.getGraphicsAlgorithm();
      ga.setFilled(true);
      ga.setForeground(manageColor(connection, StyleUtil.CLASS_FOREGROUND));
      ga.setBackground(manageColor(connection, IColorConstant.WHITE));
    } else if (cond != null) {
      peService.deletePictogramElement(cond);
    }

    peService.setPropertyValue(connection, IS_CONDITIONAL_FLOW_PROPERTY,
        Boolean.toString(flow.getConditionExpression() != null));
  }
View Full Code Here

      return ImageProvider.IMG_16_SEQUENCE_FLOW;
    }

    @Override
    protected BaseElement createFlow(ModelHandler mh, FlowNode source, FlowNode target) {
      SequenceFlow flow = mh.createSequenceFlow(source, target);
      flow.setName("");
      return flow;
    }
View Full Code Here

      super(fp);
    }

    @Override
    public boolean canUpdate(IUpdateContext context) {
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
          SequenceFlow.class);
      boolean canUpdate = flow != null && isDefaultAttributeSupported(flow.getSourceRef());
      return canUpdate;
    }
View Full Code Here

      IPeService peService = Graphiti.getPeService();
      String property = peService.getPropertyValue(context.getPictogramElement(), IS_DEFAULT_FLOW_PROPERTY);
      if (property == null || !canUpdate(context)) {
        return Reason.createFalseReason();
      }
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
          SequenceFlow.class);
      SequenceFlow defaultFlow = getDefaultFlow(flow.getSourceRef());
      boolean isDefault = defaultFlow == null ? false : defaultFlow.equals(flow);
      boolean changed = isDefault != new Boolean(property);
      return changed ? Reason.createTrueReason() : Reason.createFalseReason();
    }
View Full Code Here

      super(fp);
    }

    @Override
    public boolean canUpdate(IUpdateContext context) {
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
          SequenceFlow.class);
      boolean canUpdate = flow != null && flow.getSourceRef() instanceof Activity;
      return canUpdate;
    }
View Full Code Here

      // framework, the connection line will be drawn as a red dotted line, so make sure
      // all properties have been correctly set to their initial values in the AddFeature!
      // see https://issues.jboss.org/browse/JBPM-3102
      IPeService peService = Graphiti.getPeService();
      Connection connection = (Connection) context.getPictogramElement();
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);
      String property = peService.getPropertyValue(connection, IS_CONDITIONAL_FLOW_PROPERTY);
      if (property == null || !canUpdate(context)) {
        return Reason.createFalseReason();
      }
      boolean changed = flow.getConditionExpression() != null != new Boolean(property);
      return changed ? Reason.createTrueReason() : Reason.createFalseReason();
    }
View Full Code Here

        assertTrue(process.getFlowElements().get(0) instanceof Task);
        Task task = (Task) process.getFlowElements().get(0);
        assertEquals("task1", task.getName());
        Task task2 = (Task) process.getFlowElements().get(1);
        assertEquals("task2", task2.getName());
        SequenceFlow flow = (SequenceFlow) process.getFlowElements().get(2);
        assertEquals("seqFlow", flow.getName());
        assertEquals(task, flow.getSourceRef());
        assertEquals(task2, flow.getTargetRef());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
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.