Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.SequenceFlow


  }
 
  private void processFlowElements(Collection<FlowElement> flowElementList, BaseElement parentScope) {
    for (FlowElement flowElement : flowElementList) {
      if (flowElement instanceof SequenceFlow) {
        SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
        FlowElement sourceElement = getFlowElementFromScope(sequenceFlow.getSourceRef(), parentScope);
        if (sourceElement != null) {
          sourceElement.addOutgoingFlow(sequenceFlow);
        }
      } else if (flowElement instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
View Full Code Here


    process.addFlowElement(startEvent);
    UserTask task = new UserTask();
    task.setId("reviewTask");
    task.setAssignee("kermit");
    process.addFlowElement(task);
    SequenceFlow flow1 = new SequenceFlow();
    flow1.setId("flow1");
    flow1.setSourceRef("startEvent1");
    flow1.setTargetRef("reviewTask");
    process.addFlowElement(flow1);
    EndEvent endEvent = new EndEvent();
    endEvent.setId("endEvent1");
    process.addFlowElement(endEvent);
   
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElement("flow1Condition");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1Condition", flowElement.getId());
    SequenceFlow flow = (SequenceFlow) flowElement;
    assertEquals("${number <= 1}", flow.getConditionExpression());
  }
View Full Code Here

    return ELEMENT_SEQUENCE_FLOW;
  }
 
  @Override
  protected BaseElement convertXMLToElement(XMLStreamReader xtr) throws Exception {
    SequenceFlow sequenceFlow = new SequenceFlow();
    sequenceFlow.setSourceRef(xtr.getAttributeValue(null, ATTRIBUTE_FLOW_SOURCE_REF));
    sequenceFlow.setTargetRef(xtr.getAttributeValue(null, ATTRIBUTE_FLOW_TARGET_REF));
    sequenceFlow.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
    sequenceFlow.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
   
    parseChildElements(getXMLElementName(), sequenceFlow, xtr);
   
    return sequenceFlow;
  }
View Full Code Here

    return sequenceFlow;
  }

  @Override
  protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception {
    SequenceFlow sequenceFlow = (SequenceFlow) element;
    writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, sequenceFlow.getSourceRef(), xtw);
    writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw);
  }
View Full Code Here

    writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw);
  }

  @Override
  protected void writeAdditionalChildElements(BaseElement element, XMLStreamWriter xtw) throws Exception {
    SequenceFlow sequenceFlow = (SequenceFlow) element;
    if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
      xtw.writeStartElement(ELEMENT_FLOW_CONDITION);
      xtw.writeAttribute(XSI_PREFIX, XSI_NAMESPACE, "type", "tFormalExpression");
      xtw.writeCData(sequenceFlow.getConditionExpression());
      xtw.writeEndElement();
    }
  }
View Full Code Here

    final List<Object> sequenceFlows = processNodes.get(SequenceFlow.class.getCanonicalName());

    if (sequenceFlows != null && !sequenceFlows.isEmpty()) {
      for (final Object object : sequenceFlows) {

        final SequenceFlow sequenceFlow = (SequenceFlow) object;
        if (StringUtils.isEmpty(sequenceFlow.getSourceRef())) {
          result.add(new ProcessValidationWorkerMarker(IMarker.SEVERITY_ERROR, String.format(NO_SOURCE_ACTIVITY_EXCEPTION_MESSAGE_PATTERN,
                  sequenceFlow.getName()), sequenceFlow.getId(), ValidationCode.VAL_005));
        }
        if (StringUtils.isEmpty(sequenceFlow.getTargetRef())) {
          result.add(new ProcessValidationWorkerMarker(IMarker.SEVERITY_ERROR, String.format(NO_TARGET_ACTIVITY_EXCEPTION_MESSAGE_PATTERN,
                  sequenceFlow.getName()), sequenceFlow.getId(), ValidationCode.VAL_006));
        }
      }
    }

    return result;
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElement("flow1Condition");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1Condition", flowElement.getId());
    SequenceFlow flow = (SequenceFlow) flowElement;
    assertEquals("${number <= 1}", flow.getConditionExpression());
  }
View Full Code Here

   
    if (subShapesMap.size() > 0) {
      List<String> removeSubFlowsList = new ArrayList<String>();
      for (FlowElement flowElement : bpmnModel.getMainProcess().getFlowElements()) {
        if (flowElement instanceof SequenceFlow) {
          SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
          if (subShapesMap.containsKey(sequenceFlow.getSourceRef())) {
            SubProcess subProcess = subShapesMap.get(sequenceFlow.getSourceRef());
            subProcess.addFlowElement(sequenceFlow);
            removeSubFlowsList.add(sequenceFlow.getId());
          }
        }
      }
      for (String flowId : removeSubFlowsList) {
        bpmnModel.getMainProcess().removeFlowElement(flowId);
View Full Code Here

 
  @Override
  public void convertToJson(FlowElement flowElement, ActivityProcessor processor,
      BpmnModel model, ArrayNode shapesArrayNode, double subProcessX, double subProcessY) {
   
    SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
    ObjectNode flowNode = BpmnJsonConverterUtil.createChildShape(sequenceFlow.getId(), STENCIL_SEQUENCE_FLOW, 172, 212, 128, 212);
    ArrayNode dockersArrayNode = objectMapper.createArrayNode();
    ObjectNode dockNode = objectMapper.createObjectNode();
    dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(sequenceFlow.getSourceRef()).width / 2.0);
    dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(sequenceFlow.getSourceRef()).height / 2.0);
    dockersArrayNode.add(dockNode);
   
    if (model.getFlowLocationGraphicInfo(sequenceFlow.getId()).size() > 2) {
      for (int i = 1; i < model.getFlowLocationGraphicInfo(sequenceFlow.getId()).size() - 1; i++) {
        GraphicInfo graphicInfo =  model.getFlowLocationGraphicInfo(sequenceFlow.getId()).get(i);
        dockNode = objectMapper.createObjectNode();
        dockNode.put(EDITOR_BOUNDS_X, graphicInfo.x);
        dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.y);
        dockersArrayNode.add(dockNode);
      }
    }
   
    dockNode = objectMapper.createObjectNode();
    dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(sequenceFlow.getTargetRef()).width / 2.0);
    dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(sequenceFlow.getTargetRef()).height / 2.0);
    dockersArrayNode.add(dockNode);
    flowNode.put("dockers", dockersArrayNode);
    ArrayNode outgoingArrayNode = objectMapper.createArrayNode();
    outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getTargetRef()));
    flowNode.put("outgoing", outgoingArrayNode);
    flowNode.put("target", BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getTargetRef()));
   
    ObjectNode propertiesNode = objectMapper.createObjectNode();
    propertiesNode.put(PROPERTY_OVERRIDE_ID, flowElement.getId());
    if (StringUtils.isNotEmpty(sequenceFlow.getName())) {
      propertiesNode.put(PROPERTY_NAME, sequenceFlow.getName());
    }
   
    if (StringUtils.isNotEmpty(sequenceFlow.getDocumentation())) {
      propertiesNode.put(PROPERTY_DOCUMENTATION, sequenceFlow.getDocumentation());
    }
   
    if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
      propertiesNode.put(PROPERTY_SEQUENCEFLOW_CONDITION, sequenceFlow.getConditionExpression());
    }
   
    flowNode.put(EDITOR_SHAPE_PROPERTIES, propertiesNode);
   
    shapesArrayNode.add(flowNode);
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.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.