FMUs cannot be exported when the project has not been saved immediately before
How to reproduce
- Import this AF3 project.
- Generate FMUs via the context menu of the component-to-task allocation table.
- Observe, that the FMUs have been generated successfully.
- Delete the existing task architecture and allocation table collection.
- Generate a new task architecture (and the respective component-to-task allocations) via the context menu of the component architecture.
- Repeat step 2.
- Observe, that the FMU export fails.
A workaround
Save the file project immediately before exporting the FMUs.
Notes on the potential cause
The org.fortiss.tooling.kernel.utils.KernelModelElementUtils.findReferencedElement(IIdLabeledReference)
function (called by org.fortiss.af3.project.internal.ExecutionService.prepareExecutable(ExecutionConfiguration, IExecutionTarget)
) uses the IPersistencyService
to look the given ID reference up. In the case where the project has not been saved, the persisted XML representation of the file project and its counterpart in memory diverge - and so do the IDs. In this case, the ID to look for points to the ExecutionConfiguraiton
instead of to the ComponentArchitecture
.