eclipse-aaspe / package-explorer

AASX Package Explorer
Other
64 stars 19 forks source link

[BUG] 'New Submodel from pool of known' throws an exception #235

Closed de-ich closed 3 months ago

de-ich commented 3 months ago

Describe the bug Invoking the menu action 'New Submodel from pool of known' throws an exception if there are not yet any concept descriptions definied in the current package/environment. In addition, the required concept descriptions are not added to the project.

To Reproduce Steps to reproduce the behavior:

  1. Start the AASPE (which will create an empty package/environment)
  2. Enable the 'Edit' mode
  3. Create a new (empty) AAS
  4. Select the AAS
  5. Click on 'Workspace -> Create... -> New Submodel from pool of known'
  6. Select any of the provided submodels, e.g. 'Digital Nameplate (IDTA) V2.0'
  7. Click on 'Select!'
  8. See error

Expected behavior There is no exception and the required concept descriptions are copied to the package.

Screenshots

image

Additional context The reason for this exception is in line 998 of the file "AasxPackageLogic/MainWindowHeadless.cs" (current main branch) where the concept descriptions are copied to the environment:

image

In case there are not yet any concept descriptions in the environment, "ticket.Env.ConceptDescriptions" is "null" instead of an empty list. Either when creating a new environment or directly at this place where the concept descriptions are added, the environment should be properly initialized with an empty list of ConceptDescriptions.

juileetikekar commented 3 months ago

Hi @de-ich,

Thank you for raising this issue.

The issue has been fixed.

image