use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.
the class BpmnModelUtil method createSignalThrowEvent.
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));
signalThrowEvent.setEventDefinitions(signalEventDefinitions);
return signalThrowEvent;
}
use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.
the class EndEventJsonConverter method getStencilId.
protected String getStencilId(BaseElement baseElement) {
EndEvent endEvent = (EndEvent) baseElement;
List<EventDefinition> eventDefinitions = endEvent.getEventDefinitions();
if (eventDefinitions.size() != 1) {
return STENCIL_EVENT_END_NONE;
}
EventDefinition eventDefinition = eventDefinitions.get(0);
if (eventDefinition instanceof ErrorEventDefinition) {
return STENCIL_EVENT_END_ERROR;
} else if (eventDefinition instanceof CancelEventDefinition) {
return STENCIL_EVENT_END_CANCEL;
} else if (eventDefinition instanceof TerminateEventDefinition) {
return STENCIL_EVENT_END_TERMINATE;
} else {
return STENCIL_EVENT_END_NONE;
}
}
use of org.activiti.bpmn.model.EventDefinition in project Activiti by Activiti.
the class ThrowEventJsonConverter method getStencilId.
protected String getStencilId(BaseElement baseElement) {
ThrowEvent throwEvent = (ThrowEvent) baseElement;
List<EventDefinition> eventDefinitions = throwEvent.getEventDefinitions();
if (eventDefinitions.size() != 1) {
// return none event as default;
return STENCIL_EVENT_THROW_NONE;
}
EventDefinition eventDefinition = eventDefinitions.get(0);
if (eventDefinition instanceof SignalEventDefinition) {
return STENCIL_EVENT_THROW_SIGNAL;
} else {
return STENCIL_EVENT_THROW_NONE;
}
}
Aggregations