ST6RI-797 PortConjugation elements have no elements listed in the JSON source field #596
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR corrects a bug causing the
source
andconjugatedType
fields ofPortConjugation
to not be set. This results in the JSON emitted by theSysML2JSON
utility to produce empty values for these attributes. They should both be populated with theconjugatedPortDefinition
of thePortConjugation
.PortConjugation
is a specialization of the KerMLConjugation
relationship. TheConjugation::conjugatedType
property redefinesRelationship::source
. In KerML, aConjugation
may or may not be owned by itsconjugatedType
. If it is owned, then itsowningType
must be the same as itsconjugatedType
– but these are still two separate properties. In SysML,PortConjugation::conjugatedPortDefinition
redefinesConjugation::owningType
, and aPortConjugation
must be owned by itsconjugatedPortDefinition
. ButPortConjugation
also inheritsconjugatedType
, which should be the same asconjugatedPortDefinition
(i.e., theowningType
), and, therefore, the value ofsource
should also be the same asconjugatedPortDefinition
.In the Pilot Implementation, the
Conjugation::getSource
operation callsgetConjugatedType
to get thesource
of aConjugation
. However, when aConjugation
is parsed with anowningType
, theconjugatedType
property is not set during parsing. Instead, it is set byConjugationAdapter::postProcess
to the value ofowningType
. In this way,getSource
,getConjugatedType
andgetOwningType
all return the same value for aConjugation
with anowningType
.For a
PortConjugation
, there is additional post-processing required to set theoriginalPortDefinition
of thePortConjugation
to the owner of theconjugatedPortDefinition
. This is done inPortConjugationAdapter::postProcess
, which overridesConjugationAdapter::postProcess
. Unfortunately,PortConjugationAdapter::postProcess
was not callingsuper.postProcess()
, so the baseConjugation
post-processing was not being carried out for aPortConjugation
. As a result, theconjugatedType
property was never set for aPortConjugation
, sogetConjugatedType
just returned null (and, hence,getSource
returned the empty list), even thoughconjugatedPortDefinition
is non-null.Adding the
super.postProcess()
call fixes the bug.