eclipse-aaspe / package-explorer

AASX Package Explorer
Other
44 stars 12 forks source link

.aasx cannot be opened when Referable observed of BasicEventElement has no Type #16

Closed jannisjung closed 4 months ago

jannisjung commented 5 months ago

Describe the bug AASXPackageExplorer cannot open an aasx-file contains a BasicEvent that has no observable defined (and therefore it's type attribute is missing)

To Reproduce

Expected behavior The aasx file loads in AASPE

Screenshots Screenshot 2024-02-01 175716

Additional Information the attribute "observed" is a Referable which does not necessarily need a idShort: NameType nor a category: NameType [0..1]

juileetikekar commented 4 months ago

Hi @jannisjung,

Thank you for raising the issue!!

I had a look into attached "TestAASBasicEvent.aasx" file and tried to reproduce the issue as well. In both the cases, the attribute "observed" is not being modelled. However, as per the specifications, the attribute "observed" is a mandatory attribute for "BasicEventElement" (screenshot 1 in the end). Thus, while loading the file in AASPE, an exception is thrown, as it cannot find a mandatory parameter "observed".

Comment on "Additional information" : The attribute "observed" is not a referable, but it is a reference to the referable. The exception here is thrown because of missing "observed", and not because of IdShort.

Screenshot 1: image

jannisjung commented 4 months ago

Hi @juileetikekar , thank you for bringing this to my notice. In this case, I have to point out that the above attached .aasx file was created with AASPE and could be saved without an error message or warning. Only the subsequent opening failed. This means that AASPE does not check whether the mandatory observed attribute has been defined when the BasicEventElement was created.

juileetikekar commented 4 months ago

Hi @jannisjung,

Current implementation does not check for mandatory attributes while modelling an AAS. Handling of such situations is being discussed internally.