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

The following examples show how to use org.camunda.bpm.model.bpmn.instance.Signal. 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: SignalImpl.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(Signal.class, BPMN_ELEMENT_SIGNAL)
    .namespaceUri(BPMN20_NS)
    .extendsType(RootElement.class)
    .instanceProvider(new ModelTypeInstanceProvider<Signal>() {
      public Signal newInstance(ModelTypeInstanceContext instanceContext) {
        return new SignalImpl(instanceContext);
      }
    });

  nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME)
    .build();

  structureRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_STRUCTURE_REF)
    .qNameAttributeReference(ItemDefinition.class)
    .build();

  typeBuilder.build();
}
 
Example #4
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 #5
Source File: SignalImpl.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(Signal.class, BPMN_ELEMENT_SIGNAL)
    .namespaceUri(BPMN20_NS)
    .extendsType(RootElement.class)
    .instanceProvider(new ModelTypeInstanceProvider<Signal>() {
      public Signal newInstance(ModelTypeInstanceContext instanceContext) {
        return new SignalImpl(instanceContext);
      }
    });

  nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME)
    .build();

  structureRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_STRUCTURE_REF)
    .qNameAttributeReference(ItemDefinition.class)
    .build();

  typeBuilder.build();
}
 
Example #6
Source File: SignalEventDefinitionImpl.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
public Signal getSignal() {
  return signalRefAttribute.getReferenceTargetElement(this);
}
 
Example #7
Source File: SignalEventDefinitionImpl.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
public void setSignal(Signal signal) {
  signalRefAttribute.setReferenceTargetElement(this, signal);
}
 
Example #8
Source File: SignalEventDefinitionImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public Signal getSignal() {
  return signalRefAttribute.getReferenceTargetElement(this);
}
 
Example #9
Source File: SignalEventDefinitionImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void setSignal(Signal signal) {
  signalRefAttribute.setReferenceTargetElement(this, signal);
}