use of org.eclipse.bpmn2.StartEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method errorEvent.
private PropertyWriter errorEvent(Node<View<StartErrorEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartErrorEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingErrorEventExecutionSet executionSet = definition.getExecutionSet();
p.addError(executionSet.getErrorRef());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.StartEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method noneEvent.
private PropertyWriter noneEvent(Node<View<StartNoneEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartNoneEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
event.setIsInterrupting(false);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setSimulationSet(definition.getSimulationSet());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.StartEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method convert.
public BpmnNode convert(StartEvent event) {
CatchEventPropertyReader p = propertyReaderFactory.of(event);
List<EventDefinition> eventDefinitions = p.getEventDefinitions();
switch(eventDefinitions.size()) {
case 0:
return noneEvent(event);
case 1:
return Match.of(EventDefinition.class, BpmnNode.class).when(SignalEventDefinition.class, e -> signalEvent(event, e)).when(MessageEventDefinition.class, e -> messageEvent(event, e)).when(TimerEventDefinition.class, e -> timerEvent(event, e)).when(ErrorEventDefinition.class, e -> errorEvent(event, e)).missing(ConditionalEventDefinition.class).missing(EscalationEventDefinition.class).missing(CompensateEventDefinition.class).apply(eventDefinitions.get(0)).value();
default:
throw new UnsupportedOperationException("Multiple event definitions not supported for start event");
}
}
use of org.eclipse.bpmn2.StartEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method messageEvent.
private PropertyWriter messageEvent(Node<View<StartMessageEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartMessageEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingMessageEventExecutionSet executionSet = definition.getExecutionSet();
p.addMessage(executionSet.getMessageRef());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.eclipse.bpmn2.StartEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method timerEvent.
private PropertyWriter timerEvent(Node<View<StartTimerEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartTimerEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getName().getValue());
InterruptingTimerEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addTimer(executionSet.getTimerSettings());
p.setSimulationSet(definition.getSimulationSet());
p.setBounds(n.getContent().getBounds());
return p;
}
Aggregations