Java Code Examples for org.activiti.bpmn.model.BoundaryEvent#setBehavior()

The following examples show how to use org.activiti.bpmn.model.BoundaryEvent#setBehavior() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SignalEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, SignalEventDefinition signalDefinition) {

    Signal signal = null;
    if (bpmnParse.getBpmnModel().containsSignalId(signalDefinition.getSignalRef())) {
      signal = bpmnParse.getBpmnModel().getSignal(signalDefinition.getSignalRef());
    }

    if (bpmnParse.getCurrentFlowElement() instanceof IntermediateCatchEvent) {
      IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) bpmnParse.getCurrentFlowElement();
      intermediateCatchEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateCatchSignalEventActivityBehavior(intermediateCatchEvent, signalDefinition, signal));

    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundarySignalEventActivityBehavior(boundaryEvent, signalDefinition, signal, boundaryEvent.isCancelActivity()));
    }
  }
 
Example 2
Source File: MessageEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, MessageEventDefinition messageDefinition) {
  BpmnModel bpmnModel = bpmnParse.getBpmnModel();
  String messageRef = messageDefinition.getMessageRef();
  if (bpmnModel.containsMessageId(messageRef)) {
    Message message = bpmnModel.getMessage(messageRef);
    messageDefinition.setMessageRef(message.getName());
    messageDefinition.setExtensionElements(message.getExtensionElements());
  }

  if (bpmnParse.getCurrentFlowElement() instanceof IntermediateCatchEvent) {
    IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) bpmnParse.getCurrentFlowElement();
    intermediateCatchEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateCatchMessageEventActivityBehavior(intermediateCatchEvent, messageDefinition));

  } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
    BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
    boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryMessageEventActivityBehavior(boundaryEvent, messageDefinition, boundaryEvent.isCancelActivity()));
  }

  else {
    // What to do here?
  }

}
 
Example 3
Source File: CancelEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, CancelEventDefinition cancelEventDefinition) {
  if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
    BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
    boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryCancelEventActivityBehavior(cancelEventDefinition));
  }

}
 
Example 4
Source File: ErrorEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, ErrorEventDefinition eventDefinition) {
  if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
    BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
    boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, true));
  }
}
 
Example 5
Source File: CompensateEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, CompensateEventDefinition eventDefinition) {

    if (bpmnParse.getCurrentFlowElement() instanceof ThrowEvent) {
      ThrowEvent throwEvent = (ThrowEvent) bpmnParse.getCurrentFlowElement();
      throwEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowCompensationEventActivityBehavior(
          throwEvent, eventDefinition));

    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryCompensateEventActivityBehavior(boundaryEvent, 
          eventDefinition, boundaryEvent.isCancelActivity()));

    } else {

      // What to do?

    }

  }
 
Example 6
Source File: TimerEventDefinitionParseHandler.java    From activiti6-boot2 with Apache License 2.0 3 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, TimerEventDefinition timerEventDefinition) {

    if (bpmnParse.getCurrentFlowElement() instanceof IntermediateCatchEvent) {

      IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) bpmnParse.getCurrentFlowElement();
      intermediateCatchEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateCatchTimerEventActivityBehavior(intermediateCatchEvent, timerEventDefinition));

    } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {

      BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();
      boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryTimerEventActivityBehavior(boundaryEvent, timerEventDefinition, boundaryEvent.isCancelActivity()));
    }
  }