Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.BoundaryEvent


     
      activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowSignalEventActivityBehavior(throwEvent, signal, eventSubscriptionDeclaration));
     
    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
     
      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boolean interrupting = boundaryEvent.isCancelActivity();
      activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity));
     
      activity.setProperty("type", "boundarySignal");
       
      EventSubscriptionDeclaration eventSubscriptionDeclaration = new EventSubscriptionDeclaration(signalDefinition.getSignalRef(), "signal");
View Full Code Here


        createErrorStartEventDefinition(modelErrorEvent, activity, catchingScope);
      }
     
    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
     
      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boolean interrupting = true; // non-interrupting not yet supported
      activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity));
      ActivityImpl parentActivity = scope.findActivity(boundaryEvent.getAttachedToRefId());
      createBoundaryErrorEventDefinition(modelErrorEvent, interrupting, parentActivity, activity);
     
    }
  }
View Full Code Here

     
      activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowCompensationEventActivityBehavior((ThrowEvent) bpmnParse.getCurrentFlowElement(), compensateEventDefinition));
     
    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
    
      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boolean interrupting = boundaryEvent.isCancelActivity();
     
      activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity));
      activity.setProperty("type", "compensationBoundaryCatch");
     
    } else {
View Full Code Here

    // Only one boundary event of type 'compensate' can be attached to the same element, so we store the count temporarily here
    HashMap<String, Integer> compensateBoundaryEventsCounts = new HashMap<String, Integer>();
   
    for (int i=0; i<boundaryEvents.size(); i++) {
     
      BoundaryEvent boundaryEvent = boundaryEvents.get(i);

      if (boundaryEvent.getEventDefinitions() != null
          && !boundaryEvent.getEventDefinitions().isEmpty()) {

        EventDefinition eventDefinition = boundaryEvent.getEventDefinitions().get(0);
        if (!(eventDefinition instanceof TimerEventDefinition)
            && !(eventDefinition instanceof ErrorEventDefinition)
            && !(eventDefinition instanceof SignalEventDefinition)
            && !(eventDefinition instanceof CancelEventDefinition)
            && !(eventDefinition instanceof MessageEventDefinition)
            && !(eventDefinition instanceof CompensateEventDefinition)) {

          addError(errors, Problems.BOUNDARY_EVENT_INVALID_EVENT_DEFINITION, process,
              boundaryEvent, "Invalid or unsupported event definition");
         
        }
       
        if (eventDefinition instanceof CancelEventDefinition) {
         
          FlowElement attachedToFlowElement = bpmnModel.getFlowElement(boundaryEvent.getAttachedToRefId());
          if (!(attachedToFlowElement instanceof Transaction)) {
            addError(errors, Problems.BOUNDARY_EVENT_CANCEL_ONLY_ON_TRANSACTION, process, boundaryEvent,
                "boundary event with cancelEventDefinition only supported on transaction subprocesses");
          } else {
            if (!cancelBoundaryEventsCounts.containsKey(attachedToFlowElement.getId())) {
              cancelBoundaryEventsCounts.put(attachedToFlowElement.getId(), new Integer(0));
            }
            cancelBoundaryEventsCounts.put(attachedToFlowElement.getId(), new Integer(cancelBoundaryEventsCounts.get(attachedToFlowElement.getId()) + 1));
          }
         
        } else if (eventDefinition instanceof CompensateEventDefinition) {

          if (!compensateBoundaryEventsCounts.containsKey(boundaryEvent.getAttachedToRefId())) {
            compensateBoundaryEventsCounts.put(boundaryEvent.getAttachedToRefId(), new Integer(0));
          }
          compensateBoundaryEventsCounts.put(boundaryEvent.getAttachedToRefId(), compensateBoundaryEventsCounts.get(boundaryEvent.getAttachedToRefId()) + 1);
         
        } else if (eventDefinition instanceof MessageEventDefinition) {
         
          // Check if other message boundary events with same message id
          for (int j=0; j < boundaryEvents.size(); j++) {
            if (j != i) {
              BoundaryEvent otherBoundaryEvent = boundaryEvents.get(j);
              if (otherBoundaryEvent.getAttachedToRefId() != null && otherBoundaryEvent.getAttachedToRefId().equals(boundaryEvent.getAttachedToRefId())) {
                if (otherBoundaryEvent.getEventDefinitions() != null && !otherBoundaryEvent
                                        .getEventDefinitions().isEmpty()) {
                  EventDefinition otherEventDefinition = otherBoundaryEvent.getEventDefinitions().get(0);
                  if (otherEventDefinition instanceof MessageEventDefinition) {
                    MessageEventDefinition currentMessageEventDefinition = (MessageEventDefinition) eventDefinition;
                    MessageEventDefinition otherMessageEventDefinition = (MessageEventDefinition) otherEventDefinition;
                    if (otherMessageEventDefinition.getMessageRef() != null
                        && otherMessageEventDefinition.getMessageRef().equals(currentMessageEventDefinition.getMessageRef())) {
View Full Code Here

      }
     
     
      String signalRef = null;
      if(bo instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) bo;
        if(boundaryEvent.getEventDefinitions().get(0) != null) {
          SignalEventDefinition signalDefinition = (SignalEventDefinition) boundaryEvent.getEventDefinitions().get(0);
          if(StringUtils.isNotEmpty(signalDefinition.getSignalRef())) {
            signalRef = signalDefinition.getSignalRef();
          }
        }
      }
View Full Code Here

      if (bo == null)
        return;
     
      String errorCode = null;
      if(bo instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) bo;
        if(boundaryEvent.getEventDefinitions().get(0) != null) {
          ErrorEventDefinition errorDefinition = (ErrorEventDefinition) boundaryEvent.getEventDefinitions().get(0);
          if(errorDefinition.getErrorCode() != null) {
            errorCode = errorDefinition.getErrorCode();
          }
        }
      }
View Full Code Here

    if (pe != null) {
      Object bo = getBusinessObject(pe);
      if (bo == null)
        return;
     
      BoundaryEvent boundaryEvent = (BoundaryEvent) bo;
     
      boolean cancelActivity = ((BoundaryEvent) bo).isCancelActivity();
      if (cancelActivity == false) {
        cancelActivityCombo.select(1);
      } else {
        cancelActivityCombo.select(0);
      }
     
      if(boundaryEvent.getEventDefinitions().get(0) != null) {
        TimerEventDefinition timerDefinition = (TimerEventDefinition) boundaryEvent.getEventDefinitions().get(0);
        if (StringUtils.isNotEmpty(timerDefinition.getTimeDuration())) {
          String timeDuration = timerDefinition.getTimeDuration();
          timeDurationText.setText(timeDuration == null ? "" : timeDuration);
        } else {
          timeDurationText.setText("");
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElementMap().get("boundaryEvent1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof BoundaryEvent);
    assertEquals("boundaryEvent1", flowElement.getId());
    BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
    assertNotNull(boundaryEvent.getAttachedToRef());
    assertEquals("subprocess1", boundaryEvent.getAttachedToRef().getId());
    assertEquals(1, boundaryEvent.getEventDefinitions().size());
    assertTrue(boundaryEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition);
  }
View Full Code Here

    assertTrue(flowElement instanceof SubProcess);
    assertEquals("outerSubProcess", flowElement.getId());
    SubProcess outerSubProcess = (SubProcess) flowElement;
    List<BoundaryEvent> eventList = outerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    BoundaryEvent boundaryEvent = eventList.get(0);
    assertEquals("outerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement subElement = outerSubProcess.getFlowElement("innerSubProcess");
    assertNotNull(subElement);
    assertTrue(subElement instanceof SubProcess);
    assertEquals("innerSubProcess", subElement.getId());
    SubProcess innerSubProcess = (SubProcess) subElement;
    eventList = innerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("innerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
    assertNotNull(taskElement);
    assertTrue(taskElement instanceof UserTask);
    UserTask userTask = (UserTask) taskElement;
    assertEquals("usertask", userTask.getId());
    eventList = userTask.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("taskBoundaryEvent", boundaryEvent.getId());
  }
View Full Code Here

      sequenceFlow.setName("");
    }

    ContainerShape targetContainer = null;
    if (source instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) source;
      if (boundaryEvent.getAttachedToRef() != null) {
        Activity attachedActivity = boundaryEvent.getAttachedToRef();
        targetContainer = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(attachedActivity);
      }
    } else {
      targetContainer = (ContainerShape) context.getSourcePictogramElement();
    }
View Full Code Here

TOP

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