use of org.eclipse.bpmn2.EndEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method convert.
public BpmnNode convert(EndEvent event) {
ThrowEventPropertyReader p = propertyReaderFactory.of(event);
List<EventDefinition> eventDefinitions = p.getEventDefinitions();
switch(eventDefinitions.size()) {
case 0:
return endNoneEvent(event);
case 1:
return Match.of(EventDefinition.class, BpmnNode.class).when(TerminateEventDefinition.class, e -> terminateEndEvent(event, e)).when(SignalEventDefinition.class, e -> signalEventDefinition(event, e)).when(MessageEventDefinition.class, e -> messageEventDefinition(event, e)).when(ErrorEventDefinition.class, e -> errorEventDefinition(event, e)).missing(EscalationEventDefinition.class).missing(CompensateEventDefinition.class).missing(CancelEventDefinition.class).apply(eventDefinitions.get(0)).value();
default:
throw new UnsupportedOperationException("Multiple event definitions not supported for end event");
}
}
use of org.eclipse.bpmn2.EndEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method noneEvent.
private PropertyWriter noneEvent(Node<View<EndNoneEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
BaseEndEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.EndEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method terminateEvent.
private PropertyWriter terminateEvent(Node<View<EndTerminateEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
EndTerminateEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.addTerminate();
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.EndEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method errorEvent.
private PropertyWriter errorEvent(Node<View<EndErrorEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
EndErrorEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
ErrorEventExecutionSet executionSet = definition.getExecutionSet();
p.addError(executionSet.getErrorRef());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.EndEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<EndMessageEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
EndMessageEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
MessageEventExecutionSet executionSet = definition.getExecutionSet();
p.addMessage(executionSet.getMessageRef());
p.setBounds(n.getContent().getBounds());
return p;
}
Aggregations