use of org.activiti.bpmn.model.ThrowEvent 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.ThrowEvent in project Activiti by Activiti.
the class FeedbackStepDefinitionConverter method createSignalThrow.
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;
}
use of org.activiti.bpmn.model.ThrowEvent in project Activiti by Activiti.
the class ThrowEventJsonConverter method convertJsonToElement.
protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
ThrowEvent throwEvent = new ThrowEvent();
String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode);
if (STENCIL_EVENT_THROW_SIGNAL.equals(stencilId)) {
convertJsonToSignalDefinition(elementNode, throwEvent);
}
return throwEvent;
}
use of org.activiti.bpmn.model.ThrowEvent in project Activiti by Activiti.
the class ThrowEventJsonConverter method convertElementToJson.
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) {
ThrowEvent throwEvent = (ThrowEvent) baseElement;
addEventProperties(throwEvent, propertiesNode);
}
use of org.activiti.bpmn.model.ThrowEvent 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