Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.BoundaryEvent


        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.NONE, association.getAssociationDirection());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here


        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("associationOne.json"), "").getContents().get(0));
        Process process = getRootProcess(definitions);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.ONE, association.getAssociationDirection());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("associationBoth.json"), "").getContents().get(0));
        Process process = getRootProcess(definitions);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.BOTH, association.getAssociationDirection());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

                nodeProperties.put("node.type", "ExclusiveGateway");
            } else if (flowElement instanceof ParallelGateway) {

                nodeProperties.put("node.type", "ParallelGateway");
            } else if (flowElement instanceof BoundaryEvent) {
                BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }

                nodeProperties.put("node.type", "BoundaryEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateCatchEvent) {
                IntermediateCatchEvent boundaryEvent = (IntermediateCatchEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateCatchEvent:"+eventDef);
            } else if (flowElement instanceof IntermediateThrowEvent) {
                IntermediateThrowEvent boundaryEvent = (IntermediateThrowEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "IntermediateThrowEvent:"+eventDef);
            } else if (flowElement instanceof StartEvent) {
                StartEvent boundaryEvent = (StartEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
                nodeProperties.put("node.type", "StartEvent:"+eventDef);
            } else if (flowElement instanceof EndEvent) {
                EndEvent boundaryEvent = (EndEvent) flowElement;
                List<EventDefinition> defs = boundaryEvent.getEventDefinitions();
                String eventDef = "";

                if (defs != null && defs.size() > 0) {
                    eventDef = getEventDefinitionAsString(defs.get(0));
                }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.BOUNDARY_EVENT: {
            BoundaryEvent boundaryEvent = (BoundaryEvent) theEObject;
            T result = caseBoundaryEvent(boundaryEvent);
            if (result == null)
                result = caseCatchEvent(boundaryEvent);
            if (result == null)
                result = caseEvent(boundaryEvent);
View Full Code Here

          ((FlowNode) flowElement).getIncoming().add(flowTargetMap.get(flowElement.getId()));
        }
      }
     
      if (flowElement instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
        Activity activity = retrieveAttachedRefObject(boundaryEvent.getAttachedToRef().getId(), process.getFlowElements());
       
        if (activity == null) {
          LOGGER.warn("Boundary event " + boundaryEvent.getId() + " is not attached to any activity");
        } else {
          boundaryEvent.setAttachedToRef(activity);
          activity.getBoundaryEventRefs().add(boundaryEvent);
        }
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        postProcessElements(process, subProcess.getFlowElements(), flowSourceMap, flowTargetMap);
View Full Code Here

    processInstanceImpl.getContextInstance().setTransientVariableMap(transientVariables);
   
    if(nodeId==null){
      Event event=(Event)tokenEntity.getFlowNode();
      if(event instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)event;
        Activity activity =boundaryEvent.getAttachedToRef();
        boolean isCancelActivity=boundaryEvent.isCancelActivity();
        if(isCancelActivity){
          //如果是终止事件 则结束进入节点的时候的散发的所有子令牌 然后将父令牌 移动到超时节点往下进行
          tokenEntity.signalKillChildMoveParentToken(boundaryEvent,activity);
        }
        else{
          //如果不是终止事件 则默认方法驱动令牌
          tokenEntity.signal();
        }
       
      }
      if(event instanceof CatchEvent){
        tokenEntity.signal();
      }
     
    }
    else{
      BaseElement baseElement=processDefinition.getDefinitions().getElement(nodeId);
      if(baseElement instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)baseElement;
        Activity activity =boundaryEvent.getAttachedToRef();
       
        //String nodeTokenId = this.getId();
        // 创建分支令牌并添加到集合中
        boolean isCancelActivity=boundaryEvent.isCancelActivity();
        if(isCancelActivity){
         
          //设置超时节点
          //nodeChildExecutionContext.setTimeOutNode(nodeToken.getFlowNode());
          //ExecutionContext executionContext=ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(tokenEntity);
          tokenEntity.signalKillChildMoveParentToken(boundaryEvent,activity);
          //boundaryEvent.leave(executionContext);
        }
        else{
          TokenEntity nodeToken=((FlowNodeImpl)tokenEntity.getFlowNode()).createForkedToken(tokenEntity, boundaryEvent.getId()).token;
         
          ExecutionContext nodeChildExecutionContext = ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(nodeToken);
          //设置超时节点
          nodeChildExecutionContext.setTimeOutNode(activity);
          boundaryEvent.leave(nodeChildExecutionContext);
          //this.forkedTokenEnter(nodeChildExecutionContext);
        }
       
       
      }
View Full Code Here

    return lines;
  }

  private String boundaryEventToSVG(BPMNShape bpmnShape, BaseElement bpmnElement) {
 
      BoundaryEvent boundaryEvent=(BoundaryEvent)getBaseElement(bpmnShape.getBpmnElement());
     
      for (EventDefinition eventDefinition : boundaryEvent.getEventDefinitions()) {
        if(eventDefinition instanceof TimerEventDefinition){
          if(boundaryEvent.isCancelActivity()){
            return CommonNodeToSVG(bpmnShape, new SvgIntermediateTimerEventTo());
          }
          else{
            return CommonNodeToSVG(bpmnShape, new SvgIntermediateTimeEventCancelTo());
          }
         
        }
        if(eventDefinition instanceof ErrorEventDefinition){
          if(boundaryEvent.isCancelActivity()){
            return CommonNodeToSVG(bpmnShape, new SvgIntermediateErrorEventTo());
          }
          else{
            return CommonNodeToSVG(bpmnShape, new SvgIntermediateErrorEventCancelTo());
          }
View Full Code Here

  public static void fillBpmnTypes(Map<Class<? extends BaseElement>, Class<? extends BaseBpmnJsonConverter>> convertersToJsonMap) {
    convertersToJsonMap.put(BoundaryEvent.class, BoundaryEventJsonConverter.class);
  }
 
  protected String getStencilId(FlowElement flowElement) {
    BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
    List<EventDefinition> eventDefinitions = boundaryEvent.getEventDefinitions();
    if (eventDefinitions.size() != 1) {
      // return timer event as default;
      return STENCIL_EVENT_BOUNDARY_TIMER;
    }
   
View Full Code Here

      return STENCIL_EVENT_BOUNDARY_TIMER;
    }
  }

  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
    ArrayNode dockersArrayNode = objectMapper.createArrayNode();
    ObjectNode dockNode = objectMapper.createObjectNode();
   
   
    BPMNShape graphicInfo = BpmnModelUtil.getBpmnShape(model, boundaryEvent.getId());;
    BPMNShape parentGraphicInfo = BpmnModelUtil.getBpmnShape(model,boundaryEvent.getAttachedToRef().getId());
    dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getBounds().getX() + graphicInfo.getBounds().getWidth() - parentGraphicInfo.getBounds().getX());
    dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getBounds().getY() - parentGraphicInfo.getBounds().getY());
    dockersArrayNode.add(dockNode);
    flowElementNode.put("dockers", dockersArrayNode);
   
    if (boundaryEvent.isCancelActivity() == false) {
      propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, PROPERTY_VALUE_NO);
    }
   
    addEventProperties(boundaryEvent, propertiesNode);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.BoundaryEvent

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.