STARIONGROUP / COMET-IME-Community-Edition

The Concurrent Design Desktop Application and Excel Integration compliant with ECSS-E-TM-10-25 Annex A and Annex C
https://www.stariongroup.eu
Other
22 stars 5 forks source link

Missing LanguageCode in ReqIf import #996

Closed lxatstariongroup closed 6 months ago

lxatstariongroup commented 2 years ago

Prerequisites

Description

Missing LanguageCode during ReqIf import.

Fix in SDK: Default value on LanguageCode => en-GB

Steps to Reproduce

Logs

EXAMPLE REQIF FILE

The used example reqif file is attached as .txt. Rename file extension to .reqif before import. COMET_EXPORT_TEST_1.txt

System Configuration

dubowym commented 6 months ago

Has this been solved in the meanwhile? I am stuck with the same error.

samatstariongroup commented 6 months ago

is it possible to share a reqif file so we can reproduce?

dubowym commented 6 months ago

out.txt File attached. The problem seems to be with the language code of the requirement definition. If I omit the requirement text attribute, the file can be imported.

When I try to check the spec import preview before hitting the button, I get this error in the log:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: String reference not set to an instance of a String. Parameter name: name at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) at CDP4Requirements.ViewModels.RequirementDialogViewModel.UpdateLanguageCodes() at CDP4CommonView.DefinedThingDialogViewModel1.UpdateProperties() at CDP4CommonView.SimpleParameterizableThingDialogViewModel1.UpdateProperties() at CDP4CommonView.RequirementDialogViewModel.UpdateProperties() at CDP4Composition.Mvvm.DialogViewModelBase1..ctor(T thingClone, IThingTransaction parentTransaction, ISession session, Boolean isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable1 chainOfContainers) at CDP4CommonView.RequirementDialogViewModel..ctor(Requirement requirement, IThingTransaction transaction, ISession session, Boolean isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable1 chainOfContainers) at CDP4Requirements.ViewModels.RequirementDialogViewModel..ctor(Requirement requirement, IThingTransaction transaction, ISession session, Boolean isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable1 chainOfContainers) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at CDP4Composition.Navigation.ThingDialogNavigationService.Navigate(Thing thing, IThingTransaction transaction, ISession session, Boolean isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable`1 chainOfContainers)

samatstariongroup commented 6 months ago

thanks for the input, that helps a lot

dubowym commented 6 months ago

Hi, any hints how this problem could be solved? I am about to start adding 400 requirement definitions manually.

lxatstariongroup commented 6 months ago

Dear @dubowym,

The solution is simple in COMET, but I cannot create a fast update for you. Problem is that there is no fallback languagecode defined if the reqif file does not contain a value for that. In the reqif file there should be a header where the reqif language code can be found. I propose you edit the reqif file manually:

<REQ-IF p1:lang="en" xmlns:p1="xml" xml:lang="en" xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd">

The part that is missing in the reqif file is xml:lang="en". If you add only that specific part manually to the existing header, I think it should work in your case.

The problem will be solved in the next official COMET release.

Best regards, @lxatstariongroup

dubowym commented 6 months ago

Dear @lxatstariongroup,

thanks a lot for providing the work-around. It solved the problem and saved me a lot of time.

Best Regards, @dubowym