Commit c1db887d authored by Dominique Marcadet's avatar Dominique Marcadet

build explicit links before applying ServiceNSUsage

parent 7a03b042
Pipeline #5223 passed with stages
...@@ -169,6 +169,9 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet { ...@@ -169,6 +169,9 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
*/ */
@Override @Override
public void finalizeLoad( IRiseClipseConsole console ) { public void finalizeLoad( IRiseClipseConsole console ) {
// Explicit links must be built first, there are needed for ServiceNsUsage
buildExplicitLinks( console );
if( appNS != null ) { if( appNS != null ) {
for( ServiceNsUsage serviceNsUsage : appNS.getServiceNsUsage() ) { for( ServiceNsUsage serviceNsUsage : appNS.getServiceNsUsage() ) {
NsIdentification serviceNsId = new NsIdentification( serviceNsUsage ); NsIdentification serviceNsId = new NsIdentification( serviceNsUsage );
...@@ -184,12 +187,16 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet { ...@@ -184,12 +187,16 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
nsdAdditions.get( nsId ).add( serviceNSResources.get( serviceNsId )); nsdAdditions.get( nsId ).add( serviceNSResources.get( serviceNsId ));
applyServiceNs( serviceNSResources.get( serviceNsId ), nsdResources.get( nsId ), nsId, console ); applyServiceNs( serviceNSResources.get( serviceNsId ), nsdResources.get( nsId ), nsId, console );
} }
else {
console.warning( "While applying ServiceNsUsage: NS with id " + nsId + " not found" );
} }
} }
} }
else {
console.warning( "While applying ServiceNsUsage: ServiceNS with id " + serviceNsId + " not found" );
}
}
} }
buildExplicitLinks( console );
} }
private void applyServiceNs( ServiceNS serviceNS, NS ns, NsIdentification nsIdentification, IRiseClipseConsole console ) { private void applyServiceNs( ServiceNS serviceNS, NS ns, NsIdentification nsIdentification, IRiseClipseConsole console ) {
...@@ -204,12 +211,14 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet { ...@@ -204,12 +211,14 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
.collect( Collectors.toList() ); .collect( Collectors.toList() );
for( AgAttributeType att : atts ) { for( AgAttributeType att : atts ) {
att.unsetRefersToBasicType(); att.unsetRefersToBasicType();
console.info( "Service NS: using TypeRealization " + basic.getName() + " to attribute " + att.getType() ); console.info( "While applying ServiceNsUsage: Service NS: using TypeRealization " + basic.getName() + " to attribute " + att.getType() );
att.setRefersToConstructedAttribute( typeRealization ); att.setRefersToConstructedAttribute( typeRealization );
} }
continue; continue;
} }
// TODO: warning else {
console.warning( "While applying ServiceNsUsage: BasicType " + typeRealization.getName() + " not found" );
}
} }
// A ServiceConstructedAttribute defines new ConstructedAttribute: // A ServiceConstructedAttribute defines new ConstructedAttribute:
...@@ -224,11 +233,13 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet { ...@@ -224,11 +233,13 @@ public class NsdResourceSetImpl extends AbstractRiseClipseResourceSet {
.stream() .stream()
.forEach( att -> { .forEach( att -> {
DataAttribute da = att.toDataAttribute(); DataAttribute da = att.toDataAttribute();
console.info( "Service NS: Adding DataAttribute " + da.getName() + " to CDC " + cdc.getName() ); console.info( "While applying ServiceNsUsage: Service NS: Adding DataAttribute " + da.getName() + " to CDC " + cdc.getName() );
da.setParentCDC( cdc ); da.setParentCDC( cdc );
}); });
} }
else {
console.warning( "While applying ServiceNsUsage: CDC " + serviceCDC.getCdc() + " not found" );
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment