use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader in project kie-wb-common by kiegroup.
the class StartEventConverter method convert.
public Result<BpmnNode> convert(StartEvent event) {
CatchEventPropertyReader p = propertyReaderFactory.of(event);
List<EventDefinition> eventDefinitions = p.getEventDefinitions();
switch(eventDefinitions.size()) {
case 0:
return Result.success(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)).when(ConditionalEventDefinition.class, e -> conditionalEvent(event, e)).when(EscalationEventDefinition.class, e -> escalationEvent(event, e)).when(CompensateEventDefinition.class, e -> compensationEvent(event, e)).mode(getMode()).apply(eventDefinitions.get(0));
default:
throw new UnsupportedOperationException("Multiple event definitions not supported for start event");
}
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method errorEvent.
protected Result<BpmnNode> errorEvent(CatchEvent event, ErrorEventDefinition e) {
String nodeId = event.getId();
Node<View<IntermediateErrorEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class);
IntermediateErrorEventCatching definition = node.getContent().getDefinition();
CatchEventPropertyReader p = propertyReaderFactory.of(event);
node.getContent().setBounds(p.getBounds());
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), new ErrorRef(EventDefinitionReader.errorRefOf(e))));
return Result.success(BpmnNode.of(node, p));
}
Aggregations