use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode 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.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method convertIntermediateCatchEvent.
public BpmnNode convertIntermediateCatchEvent(IntermediateCatchEvent event) {
CatchEventPropertyReader p = propertyReaderFactory.of(event);
List<EventDefinition> eventDefinitions = p.getEventDefinitions();
switch(eventDefinitions.size()) {
case 0:
throw new UnsupportedOperationException("An intermediate catch event should contain exactly one definition");
case 1:
return Match.of(EventDefinition.class, BpmnNode.class).when(TimerEventDefinition.class, e -> timerEvent(event, e)).when(SignalEventDefinition.class, e -> signalEvent(event, e)).when(MessageEventDefinition.class, e -> messageEvent(event, e)).when(ErrorEventDefinition.class, e -> errorEvent(event, e)).missing(EscalationEventDefinition.class).missing(CompensateEventDefinition.class).missing(ConditionalEventDefinition.class).apply(eventDefinitions.get(0)).value();
default:
throw new UnsupportedOperationException("Multiple definitions not supported for intermediate catch event");
}
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode 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.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertSubProcess.
public BpmnNode convertSubProcess(SubProcess subProcess) {
BpmnNode subProcessRoot;
if (subProcess instanceof org.eclipse.bpmn2.AdHocSubProcess) {
subProcessRoot = convertAdHocSubProcess((org.eclipse.bpmn2.AdHocSubProcess) subProcess);
} else {
subProcessRoot = subProcess.isTriggeredByEvent() ? convertEventSubprocessNode(subProcess) : convertEmbeddedSubprocessNode(subProcess);
}
Map<String, BpmnNode> nodes = super.convertChildNodes(subProcessRoot, subProcess.getFlowElements(), subProcess.getLaneSets());
super.convertEdges(subProcessRoot, subProcess.getFlowElements(), nodes);
return subProcessRoot;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.BpmnNode in project kie-wb-common by kiegroup.
the class SequenceFlowConverter method convertEdge.
public BpmnEdge convertEdge(org.eclipse.bpmn2.SequenceFlow seq, Map<String, BpmnNode> nodes) {
Edge<View<SequenceFlow>, Node> edge = factoryManager.newEdge(seq.getId(), SequenceFlow.class);
SequenceFlow definition = edge.getContent().getDefinition();
SequenceFlowPropertyReader p = propertyReaderFactory.of(seq);
definition.setGeneral(new BPMNGeneralSet(new Name(seq.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new SequenceFlowExecutionSet(new Priority(p.getPriority()), new ConditionExpression(p.getConditionExpression())));
return BpmnEdge.of(edge, nodes.get(p.getSourceId()), p.getSourceConnection(), nodes.get(p.getTargetId()), p.getTargetConnection());
}
Aggregations