use of org.eclipse.winery.model.tosca.yaml.YTActivityDefinition in project winery by eclipse.
the class ToCanonical method convert.
public TActivityDefinition convert(YTMapActivityDefinition node) {
if (Objects.isNull(node) || node.getMap().isEmpty()) {
return null;
}
for (YTActivityDefinition value : node.getMap().values()) {
if (value instanceof YTCallOperationActivityDefinition) {
YTCallOperationActivityDefinition yamlDef = (YTCallOperationActivityDefinition) value;
TCallOperationActivityDefinition canonicalDef = new TCallOperationActivityDefinition(yamlDef.getOperation());
List<ParameterDefinition> inputs = yamlDef.getInputs().entrySet().stream().map(entry -> convert(entry.getValue(), entry.getKey())).collect(Collectors.toList());
canonicalDef.setInputs(inputs);
return canonicalDef;
}
}
return null;
}
Aggregations