use of org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent 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.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAbsoluteBounds(n);
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent in project kie-wb-common by kiegroup.
the class DefaultRouteFormProvider method findElements.
@Override
protected Collection<Pair<Object, String>> findElements(Predicate<Node> filter, Function<Node, Pair<Object, String>> mapper) {
Node selectedNode = getSelectedElement();
Collection<Pair<Object, String>> result = new ArrayList<>();
if (selectedNode != null) {
List<Edge> outEdges = selectedNode.getOutEdges();
if (outEdges != null) {
result = outEdges.stream().map(outEdge -> {
String routeIdentifier = outEdge.getUUID();
// UI value for the route is the target node name or target node type
String targetName = null;
String targetNodeType = null;
BPMNDefinition bpmnDefinition = getEdgeTarget(outEdge);
if (bpmnDefinition != null) {
targetNodeType = definitionManager.adapters().forDefinition().getTitle(bpmnDefinition);
if (bpmnDefinition instanceof BaseStartEvent || bpmnDefinition instanceof BaseCatchingIntermediateEvent || bpmnDefinition instanceof BaseThrowingIntermediateEvent || bpmnDefinition instanceof BaseEndEvent || bpmnDefinition instanceof BaseTask || bpmnDefinition instanceof BaseGateway || bpmnDefinition instanceof BaseSubprocess) {
targetName = bpmnDefinition.getGeneral().getName().getValue();
}
}
if (targetName != null && !targetName.isEmpty()) {
return new Pair<Object, String>(routeIdentifier, targetName);
} else if (targetNodeType != null && !targetNodeType.isEmpty()) {
return new Pair<Object, String>(routeIdentifier, targetNodeType);
} else {
return new Pair<Object, String>(routeIdentifier, routeIdentifier);
}
}).collect(Collectors.toList());
}
}
return result;
}
Aggregations