Java源码示例:org.camunda.bpm.model.bpmn.instance.SignalEventDefinition
示例1
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());
}
}
}
示例2
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();
}
示例3
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();
}
示例4
public SignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element) {
super(modelInstance, element, SignalEventDefinitionBuilder.class);
}
示例5
protected AbstractSignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element, Class<?> selfType) {
super(modelInstance, element, selfType);
}
示例6
public SignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element) {
super(modelInstance, element, SignalEventDefinitionBuilder.class);
}
示例7
protected AbstractSignalEventDefinitionBuilder(BpmnModelInstance modelInstance, SignalEventDefinition element, Class<?> selfType) {
super(modelInstance, element, selfType);
}
示例8
/**
* 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;
}
示例9
/**
* 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;
}
示例10
/**
* 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;
}
示例11
/**
* 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;
}