Hello Geert,
I`ve modified your macro a little bit, but I still have some questions.
Hope you might answer them.
Here`s the source code that I modified. I just post the relevant parts.
First of, this is from 'ExcelImporter':
'create or update the class
Set currentClass = eaConn.addOrUpdateClass(parentPackage, className, "", classDescription)
' Add tagged value to a requirement
eaConn.addTaggedValues2Requirement currentClass, "test", "TEST"
As you can see, I created a function 'addTaggedValues2Requirement' which has three parameters - the current element, the tagged value name and the tagged value value.
Next, from EAConnector:
Public Function addTaggedValues2Requirement(parentClass As EA.Element, tagName As String, tagValue As String) As EA.Collection
Dim tags As EA.Collection
Set tags = parentClass.TaggedValues
Dim newTag As EA.TaggedValue
Set newTag = tags.AddNew(tagName, tagValue)
tags.Refresh
parentClass.TaggedValues.Refresh
Set addTaggedValues2Requirement = tags
End Function
This part is mostly from the VBScript 'Element Extras Example' that comes with EA.
What works:
I`m able to import requirements (changed that in your code from class to requirement). All requirements have a name as well as their notes. I cannot use your function 'addOrUpdateAttributeTag', as requirements are not allowed to have attributes.
What doesn`t work:
Unfortunately, the tagged values ares not being added to a requirement. Though, no error message is being thrown.
I wonder if my function calls are right.
Also, I`m not sure if this is correct:
Public Function addTaggedValues2Requirement(parentClass As EA.Element, tagName As String, tagValue As String) As EA.Collection
Any hints will be highly appreciated :-)
Best regards,
palim