org.camunda.bpm.model.bpmn.instance.SignalEventDefinition Java Examples

The following examples show how to use org.camunda.bpm.model.bpmn.instance.SignalEventDefinition. 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: BpmnProcessModelCustomizer.java    From wecube-platform with Apache License 2.0 6 votes vote down vote up
protected void validateSignalEventDefinitions(BpmnModelInstance procModelInstance) {
    Collection<SignalEventDefinition> signalEventDefinitions = procModelInstance
            .getModelElementsByType(SignalEventDefinition.class);
    for (SignalEventDefinition sed : signalEventDefinitions) {
        log.debug("validate signal event definition, id={},signalRef={}", sed.getId(),
                sed.getAttributeValueNs(NS_BPMN, "signalRef"));

        Signal sig = sed.getSignal();
        if (sig == null) {
            log.warn("invalid signal defined, id={},signalRef={}", sed.getId(),
                    sed.getAttributeValueNs(NS_BPMN, "signalRef"));
            throw new BpmnCustomizationException("invalid signal definition");
        } else {
            log.debug("signal id={}, name={}", sig.getId(), sig.getName());
        }
    }
}
 
Example #2
Source File: SignalEventDefinitionImpl.java    From camunda-bpmn-model with Apache License 2.0 6 votes vote down vote up
public static void registerType(ModelBuilder modelBuilder) {
  ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(SignalEventDefinition.class, BPMN_ELEMENT_SIGNAL_EVENT_DEFINITION)
    .namespaceUri(BPMN20_NS)
    .extendsType(EventDefinition.class)
    .instanceProvider(new ModelTypeInstanceProvider<SignalEventDefinition>() {
      public SignalEventDefinition newInstance(ModelTypeInstanceContext instanceContext) {
        return new SignalEventDefinitionImpl(instanceContext);
      }
    });

  signalRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_SIGNAL_REF)
    .qNameAttributeReference(Signal.class)
    .build();

  /** Camunda Attributes */
  camundaAsyncAttribute = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_ASYNC)
    .namespace(CAMUNDA_NS)
    .defaultValue(false)
    .build();

  typeBuilder.build();
}
 
Example #3
Source File: SignalEventDefinitionImpl.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public static void registerType(ModelBuilder modelBuilder) {
  ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(SignalEventDefinition.class, BPMN_ELEMENT_SIGNAL_EVENT_DEFINITION)
    .namespaceUri(BPMN20_NS)
    .extendsType(EventDefinition.class)
    .instanceProvider(new ModelTypeInstanceProvider<SignalEventDefinition>() {
      public SignalEventDefinition newInstance(ModelTypeInstanceContext instanceContext) {
        return new SignalEventDefinitionImpl(instanceContext);
      }
    });

  signalRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_SIGNAL_REF)
    .qNameAttributeReference(Signal.class)
    .build();

  /** Camunda Attributes */
  camundaAsyncAttribute = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_ASYNC)
    .namespace(CAMUNDA_NS)
    .defaultValue(false)
    .build();

  typeBuilder.build();
}
 
Example #4
Source File: SignalEventDefinitionBuilder.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
public SignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element) {
  super(modelInstance, element, SignalEventDefinitionBuilder.class);
}
 
Example #5
Source File: AbstractSignalEventDefinitionBuilder.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
protected AbstractSignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element, Class<?> selfType) {
  super(modelInstance, element, selfType);
}
 
Example #6
Source File: SignalEventDefinitionBuilder.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public SignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element) {
  super(modelInstance, element, SignalEventDefinitionBuilder.class);
}
 
Example #7
Source File: AbstractSignalEventDefinitionBuilder.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected AbstractSignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element, Class<?> selfType) {
  super(modelInstance, element, selfType);
}
 
Example #8
Source File: AbstractCatchEventBuilder.java    From camunda-bpmn-model with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an event definition for the given signal name. If already a signal
 * with this name exists it will be used, otherwise a new signal is created.
 *
 * @param signalName the name of the signal
 * @return the builder object
 */
public B signal(String signalName) {
  SignalEventDefinition signalEventDefinition = createSignalEventDefinition(signalName);
  element.getEventDefinitions().add(signalEventDefinition);

  return myself;
}
 
Example #9
Source File: AbstractThrowEventBuilder.java    From camunda-bpmn-model with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an event definition for the given signal name. If already a signal
 * with this name exists it will be used, otherwise a new signal is created.
 *
 * @param signalName the name of the signal
 * @return the builder object
 */
public B signal(String signalName) {
  SignalEventDefinition signalEventDefinition = createSignalEventDefinition(signalName);
  element.getEventDefinitions().add(signalEventDefinition);

  return myself;
}
 
Example #10
Source File: AbstractCatchEventBuilder.java    From camunda-bpm-platform with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an event definition for the given signal name. If already a signal
 * with this name exists it will be used, otherwise a new signal is created.
 *
 * @param signalName the name of the signal
 * @return the builder object
 */
public B signal(String signalName) {
  SignalEventDefinition signalEventDefinition = createSignalEventDefinition(signalName);
  element.getEventDefinitions().add(signalEventDefinition);

  return myself;
}
 
Example #11
Source File: AbstractThrowEventBuilder.java    From camunda-bpm-platform with Apache License 2.0 3 votes vote down vote up
/**
 * Sets an event definition for the given signal name. If already a signal
 * with this name exists it will be used, otherwise a new signal is created.
 *
 * @param signalName the name of the signal
 * @return the builder object
 */
public B signal(String signalName) {
  SignalEventDefinition signalEventDefinition = createSignalEventDefinition(signalName);
  element.getEventDefinitions().add(signalEventDefinition);

  return myself;
}