Skip to content

Commit aabbf2d

Browse files
committed
Fix for GitHub Issue 11
1 parent 99b2352 commit aabbf2d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/AasxCsharpLibrary/Extensions/ExtendReference.cs

+11
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ public static string GetAsIdentifier(this IReference reference)
203203
return reference.Keys[0].Value;
204204
}
205205

206+
//TODO (jtikekar, 2024-03-06): Refactor, added w.r.t. GitHub issue 11
207+
if(reference.Type == ReferenceTypes.ModelReference)
208+
{
209+
if (reference.Keys == null || reference.Keys.Count < 1)
210+
{
211+
return null;
212+
}
213+
214+
return reference.Keys[0].Value;
215+
}
216+
206217
return null;
207218
}
208219

src/AasxPackageLogic/DispEditHelperEntities.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,8 @@ public void DisplayOrEditAasEntitySubmodelElement(
27022702
if (ks != null)
27032703
{
27042704
// set the semantic id
2705-
sme.SemanticId = new Aas.Reference(Aas.ReferenceTypes.ExternalReference, new List<Aas.IKey>(ks));
2705+
//Using ModelReference for "Use existing" as this cd is being fetched from model/env
2706+
sme.SemanticId = new Aas.Reference(Aas.ReferenceTypes.ModelReference, new List<Aas.IKey>(ks));
27062707

27072708
// if empty take over shortName
27082709
var cd = env.FindConceptDescriptionByReference(sme.SemanticId);

0 commit comments

Comments
 (0)