Closed lxatstariongroup closed 6 months ago
Has this been solved in the meanwhile? I am stuck with the same error.
is it possible to share a reqif file so we can reproduce?
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.SimpleParameterizableThingDialogViewModel
1.UpdateProperties()
at CDP4CommonView.RequirementDialogViewModel.UpdateProperties()
at CDP4Composition.Mvvm.DialogViewModelBase1..ctor(T thingClone, IThingTransaction parentTransaction, ISession session, Boolean isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable
1 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, IEnumerable
1 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)
thanks for the input, that helps a lot
Hi, any hints how this problem could be solved? I am about to start adding 400 requirement definitions manually.
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
Dear @lxatstariongroup,
thanks a lot for providing the work-around. It solved the problem and saved me a lot of time.
Best Regards, @dubowym
Prerequisites
Description
Missing LanguageCode during ReqIf import.
Fix in SDK: Default value on LanguageCode => en-GB
Steps to Reproduce
Start process via "Requirements/ReqIF->Import"
Select model and correct ReqIF file
Select auto for mapping
In the next window, the following parameter types are shown: Integer, String, Date, Created Thru (with suptypes: Manual Input, Extracting, Copying), Text, Boolean
Next, the specification parameters are mapped: ReqIF.ForeignCreatedBy, ReqIF.ForeignCreatedOn, ReqIF.Description, ReqIF.ForeignModifiedBy, ReqIF.ForeignModifiedOn, ReqIF.Name, ReqIF.Prefix
Next, the requirement parameters are mapped: ReqIF.ForeignID, ReqIF.ForeignCreatedBy, ReqIF.ForeignCreatedOn, ReqIF.CreatedThru, ReqIF.ForeignModifiedBy, ReqIF.ForeignModifiedOn, ReqIF.ChapterName, ReqIF.Name, ReqIF.Text, ReqIF.ForeignDeleted
In the next window, Relation-Groups are defined. I don't have any.
In the next window, Spec-Relations are defined. I don't have any.
In the next window, I can see a preview of the import.
When clicking OK, the following error is raised:
The CDP4 Services replied with code InternalServerError: Internal Server Error: "exception:The \u0027LanguageCode\u0027 property of a \u0027Definition\u0027 is mandatory and cannot be empty or null.
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