use of org.eclipse.bpmn2.IntermediateThrowEvent in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method convert.
public BpmnNode convert(IntermediateThrowEvent event) {
ThrowEventPropertyReader p = propertyReaderFactory.of(event);
List<EventDefinition> eventDefinitions = p.getEventDefinitions();
switch(eventDefinitions.size()) {
case 0:
throw new UnsupportedOperationException("An intermediate throw event should contain exactly one definition");
case 1:
return Match.of(EventDefinition.class, BpmnNode.class).when(SignalEventDefinition.class, e -> signalEvent(event, e)).when(MessageEventDefinition.class, e -> messageEvent(event, e)).missing(ErrorEventDefinition.class).missing(EscalationEventDefinition.class).missing(CompensateEventDefinition.class).missing(ConditionalEventDefinition.class).apply(eventDefinitions.get(0)).value();
default:
throw new UnsupportedOperationException("Multiple definitions not supported for intermediate throw event");
}
}
use of org.eclipse.bpmn2.IntermediateThrowEvent in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method signalEvent.
private PropertyWriter signalEvent(Node<View<IntermediateSignalEventThrowing>, ?> n) {
IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
event.setId(n.getUUID());
IntermediateSignalEventThrowing 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());
p.addSignal(definition.getExecutionSet().getSignalRef());
p.addSignalScope(definition.getExecutionSet().getSignalScope());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.IntermediateThrowEvent in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<IntermediateMessageEventThrowing>, ?> n) {
IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
event.setId(n.getUUID());
IntermediateMessageEventThrowing 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