This PR corrects a bug causing the source and conjugatedType fields of PortConjugation to not be set. This results int the JSON emitted by the SysML2JSON utility to produce empty values for these attributes. They should both be populated with the conjugatedPortDefinition of the PortConjugation.
PortConjugation is a specialization of the KerML Conjugation relationship. The Conjugation::conjugatedType property redefines Relationship::source. In KerML, a Conjugation may or may not be owned by its conjugatedType. If it is owned, then its owningType must be the same as its conjugatedType – but these are still two separate properties. In SysML, PortConjugation::conjugatedPortDefinition redefines Conjugation::owningType, and a PortConjugation must be owned by its conjugatedPortDefinition. But PortConjugation also inherits conjugatedType, which should be the same as conjugatedPortDefinition (i.e., the owningType), and, therefore, the value of source should also be the same as conjugatedPortDefinition.
In the Pilot Implementation, the Conjugation::getSource operation calls getConjugatedType to get the source of a Conjugation. However, when a Conjugation is parsed with an owningType, the conjugatedType property is not set during parsing. Instead, it is set by ConjugationAdapter::postProcess to the value of owningType. In this way, getSource, getConjugatedType and getOwningType all return the same value for a Conjugation with an owningType.
For a PortConjugation, there is additional post-processing required to set the originalPortDefinition of the PortConjugation to the owner of the conjugatedPortDefinition. This is done in PortConjugationAdapter::postProcess, which overrides ConjugationAdapter::postProcess. Unfortunately, PortConjugationAdapter::postProcess was not calling super.postProcess(), so the base Conjugation post-processing was not being carried out for a PortConjugation. As a result, the conjugatedType property was never set for a PortConjugation, so getConjugatedType just returned null (and, hence, getSource returned the empty list), even though conjugatedPortDefinition is non-null.
Adding the super.postProcess() call fixes the bug.
This PR corrects a bug causing the
source
andconjugatedType
fields ofPortConjugation
to not be set. This results int 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.