Skip to content
Snippets Groups Projects
Commit 7f64b2d5 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

first trial to take SDO into account

parent 9c160ad9
No related tags found
1 merge request!59WIP: Resolve "correct explicit links from FCDA"
Pipeline #4593 passed
...@@ -1091,6 +1091,8 @@ public class FCDAImpl extends SclObjectImpl implements FCDA { ...@@ -1091,6 +1091,8 @@ public class FCDAImpl extends SclObjectImpl implements FCDA {
@Override @Override
protected void doBuildExplicitLinks( IRiseClipseConsole console ) { protected void doBuildExplicitLinks( IRiseClipseConsole console ) {
//@formatter:off
// see Issue #13 // see Issue #13
super.doBuildExplicitLinks( console ); super.doBuildExplicitLinks( console );
...@@ -1263,13 +1265,29 @@ public class FCDAImpl extends SclObjectImpl implements FCDA { ...@@ -1263,13 +1265,29 @@ public class FCDAImpl extends SclObjectImpl implements FCDA {
else { else {
// daName – if missing, all attributes with functional characteristic given by fc are selected. // daName – if missing, all attributes with functional characteristic given by fc are selected.
if( getFc() == null ) return; if( getFc() == null ) {
console.warning( "[SCL links] FCDA (line ", getLineNumber(),
") does not refer to any AbstractDataAttribute because FC is empty" );
return;
}
doType // We select either DAs contained in DOType or DAs contained in SDOs contained in DOType
if( doType.getDA().size() > 0 ) {
doType
.getDA() .getDA()
.stream() .stream()
.filter( da -> da.getFc().equals( getFc() ) ) .filter( da -> da.getFc().equals( getFc() ) )
.collect( Collectors.toCollection( () -> getRefersToAbstractDataAttribute() ) ); .collect( Collectors.toCollection( () -> getRefersToAbstractDataAttribute() ) );
}
else {
doType
.getSDO()
.stream()
.map( sdo -> sdo.getRefersToDOType() )
.flatMap( dotype -> dotype.getDA().stream() )
.filter( da -> da.getFc().equals( getFc() ) )
.collect( Collectors.toCollection( () -> getRefersToAbstractDataAttribute() ) );
}
if( getRefersToAbstractDataAttribute().size() > 0 ) { if( getRefersToAbstractDataAttribute().size() > 0 ) {
for( AbstractDataAttribute a : getRefersToAbstractDataAttribute() ) { for( AbstractDataAttribute a : getRefersToAbstractDataAttribute() ) {
...@@ -1284,6 +1302,7 @@ public class FCDAImpl extends SclObjectImpl implements FCDA { ...@@ -1284,6 +1302,7 @@ public class FCDAImpl extends SclObjectImpl implements FCDA {
} }
} }
//@formatter:on
} }
} //FCDAImpl } //FCDAImpl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment