Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.SignalEventDefinition


    assertTrue(flowElement instanceof IntermediateCatchEvent);
    assertEquals("catchsignal", flowElement.getId());
    IntermediateCatchEvent catchEvent = (IntermediateCatchEvent) flowElement;
    assertEquals(1, catchEvent.getEventDefinitions().size());
    assertTrue(catchEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition);
    SignalEventDefinition signalEvent = (SignalEventDefinition) catchEvent.getEventDefinitions().get(0);
    assertEquals("testSignal", signalEvent.getSignalRef());
   
    flowElement = model.getMainProcess().getFlowElement("subprocess");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess", flowElement.getId());
View Full Code Here


    ErrorEventDefinition errorEvent = (ErrorEventDefinition)extractEventDefinition(errorElement);
    assertTrue(errorElement.isCancelActivity()); //always true
    assertEquals("errorRef", errorEvent.getErrorCode());
   
    BoundaryEvent signalElement = (BoundaryEvent)model.getMainProcess().getFlowElement("signalEvent");
    SignalEventDefinition signalEvent = (SignalEventDefinition)extractEventDefinition(signalElement);
    assertFalse(signalElement.isCancelActivity());
    assertEquals("signalRef", signalEvent.getSignalRef());
   
    BoundaryEvent messageElement = (BoundaryEvent)model.getMainProcess().getFlowElement("messageEvent");
    MessageEventDefinition messageEvent = (MessageEventDefinition)extractEventDefinition(messageElement);
    assertFalse(messageElement.isCancelActivity());
    assertEquals("messageRef", messageEvent.getMessageRef());
View Full Code Here

    assertEquals("PT5M", ted.getTimeDuration());
   
    FlowElement signalElement = model.getMainProcess().getFlowElement("signal_evt");
    EventDefinition signalEvent = extractEventDefinition(signalElement);
    assertTrue(signalEvent instanceof SignalEventDefinition);
    SignalEventDefinition sed = (SignalEventDefinition)signalEvent;
    assertEquals("signal_ref", sed.getSignalRef());
   
    FlowElement messageElement = model.getMainProcess().getFlowElement("message_evt");
    EventDefinition messageEvent = extractEventDefinition(messageElement);
    assertTrue(messageEvent instanceof MessageEventDefinition);
    MessageEventDefinition med = (MessageEventDefinition)messageEvent;
View Full Code Here

  }

  public static ThrowEvent createSignalThrowEvent(
      WorkflowDefinitionConversion conversion,
      Signal approvalFinishedSignal) {
    SignalEventDefinition signalEventDefinition = new SignalEventDefinition();
    signalEventDefinition.setSignalRef(approvalFinishedSignal.getId());
    List<EventDefinition> signalEventDefinitions = new ArrayList<EventDefinition>();
    signalEventDefinitions.add(signalEventDefinition);

    ThrowEvent signalThrowEvent = new ThrowEvent();
    signalThrowEvent.setId(conversion.getUniqueNumberedId(SIGNAL_THROWEVENT_PREFIX));
View Full Code Here

    BoundaryEvent signalBoundaryEvent = new BoundaryEvent();
    signalBoundaryEvent.setId(conversion.getUniqueNumberedId(SIGNAL_BOUNDARY_EVENT));
    signalBoundaryEvent.setCancelActivity(cancelActivity);
    signalBoundaryEvent.setAttachedToRef(activity);

    SignalEventDefinition boundarySignalEventDefinition = new SignalEventDefinition();
    boundarySignalEventDefinition.setSignalRef(signal.getId());
    signalBoundaryEvent.addEventDefinition(boundarySignalEventDefinition);

    return signalBoundaryEvent;
  }
View Full Code Here

  protected ThrowEvent createSignalThrow(WorkflowDefinitionConversion conversion, Signal signal) {
    ThrowEvent signalThrowEvent = new ThrowEvent();
    signalThrowEvent.setId(conversion.getUniqueNumberedId(ConversionConstants.EVENT_ID_PREFIX));
   
    SignalEventDefinition signalThrowEventDefinition = new SignalEventDefinition();
    signalThrowEventDefinition.setSignalRef(signal.getId());
    signalThrowEvent.addEventDefinition(signalThrowEventDefinition);
   
    addFlowElement(conversion, signalThrowEvent);
   
    return signalThrowEvent;
View Full Code Here

    boundarySignalCatch.setAttachedToRef(feedbackTask);
    boundarySignalCatch.setAttachedToRefId(feedbackTask.getId());
    boundarySignalCatch.setCancelActivity(true);
    addFlowElement(conversion, boundarySignalCatch);
   
    SignalEventDefinition signalCatchEventDefinition = new SignalEventDefinition();
    signalCatchEventDefinition.setSignalRef(signal.getId());
    boundarySignalCatch.addEventDefinition(signalCatchEventDefinition);
    return boundarySignalCatch;
  }
View Full Code Here

          }
          propertiesNode.put(PROPERTY_MESSAGEREF, messageRef);
        }
       
      } else if (eventDefinition instanceof SignalEventDefinition) {
        SignalEventDefinition signalDefinition = (SignalEventDefinition) eventDefinition;
        if (StringUtils.isNotEmpty(signalDefinition.getSignalRef())) {
          propertiesNode.put(PROPERTY_SIGNALREF, signalDefinition.getSignalRef());
        }
       
      } else if (eventDefinition instanceof TimerEventDefinition) {
        TimerEventDefinition timerDefinition = (TimerEventDefinition) eventDefinition;
        if (StringUtils.isNotEmpty(timerDefinition.getTimeDuration())) {
View Full Code Here

 
  protected void convertJsonToSignalDefinition(JsonNode objectNode, Event event) {
    String signalRef = getPropertyValueAsString(PROPERTY_SIGNALREF, objectNode);
   
    if (StringUtils.isNotEmpty(signalRef)) {
      SignalEventDefinition eventDefinition = new SignalEventDefinition();
      eventDefinition.setSignalRef(signalRef);
      event.getEventDefinitions().add(eventDefinition);
    }
  }
View Full Code Here

  }
 
  public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
    if (parentElement instanceof Event == false) return;
   
    SignalEventDefinition eventDefinition = new SignalEventDefinition();
    BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
    eventDefinition.setSignalRef(xtr.getAttributeValue(null, ATTRIBUTE_SIGNAL_REF));
    if (StringUtils.isNotEmpty(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_ASYNCHRONOUS))) {
      eventDefinition.setAsync(Boolean.parseBoolean(xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_ASYNCHRONOUS)));
    }
   
    BpmnXMLUtil.parseChildElements(ELEMENT_EVENT_SIGNALDEFINITION, eventDefinition, xtr, model);
   
    ((Event) parentElement).getEventDefinitions().add(eventDefinition);
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.SignalEventDefinition

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.