# Tagged value

**URL:** <https://forums.visual-paradigm.com/t/tagged-value/10651>\
**Category:** Plug-in & Open API\
**Created:** [January 17, 2009, 6:08pm UTC](https://forums.visual-paradigm.com/t/tagged-value/10651 "2009-01-17T18:08:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonymous](https://avatars.discourse-cdn.com/v2/letter/a/8491ac/32.png) [@Anonymous](https://forums.visual-paradigm.com/u/Anonymous)\
**Post date:** [January 19, 2009, 8:38am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/1 "2009-01-19T08:38:55Z")

</div>

Hello,  
When I add/edit a tagged value programatically, like this:

```auto
 
IRequirement req = ...
if(req.getTaggedValues()!=null && req.getTaggedValues().getTaggedValueByName("Body")!=null){
     ITaggedValue tvBody = req.getTaggedValues().getTaggedValueByName("Body");
     tvBody.setValue(...); 

```

it works only if I display Tagged Values tab in specification window before. Is it something wrong in my code?

Regards,  
anita

---

<div class="post-metadata">

**Author:** ![LilianWong](https://avatars.discourse-cdn.com/v2/letter/l/919ad9/32.png) [@LilianWong](https://forums.visual-paradigm.com/u/LilianWong)\
**Post date:** [January 19, 2009, 9:51am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/2 "2009-01-19T09:51:30Z")

</div>

Hi Anita,

Thanks for your post. We’re sorry that our engineers cannot repeat the problem. Our engineers prepared 3 kinds of Requirement as attached image,  
\<\> is the original requirement with Text, ID, etc… properties  
\<\> is a new requirement with body property.  
\<\> is a new requirement without any property.

They tried to call the IRequirement.getTaggedValues() first, \<\> and \<\> must can return ITaggedValueContainer, \<\> must return null since it really has no property (taggedValue).  
Secondly, they tried to get “Body” from the ITaggedValueContainer, \<\> and \<\> also return null, since there really no “Body” property.

May I know is “Body” a property you defined in your own requirement?  
If no, please manually add your own requirements via Tool \> Configure Requirements. More details can be found at the following link:

> **[Easy-to-Use SysML Modeling Software](https://www.visual-paradigm.com/features/sysml-diagram-tool/#sysml-requirement-diagram)**
>
> \#1 SysML Diagram Tool, easy-to-Use, feature-rich, international award winners. Support SysML modeling notations and SysML diagrams. Try it FREE!

If there is any further inquiry, please do not hesitate to contact me.

Best regards,  
Lilian Wong   
 ![](https://forums.visual-paradigm.com/uploads/default/original/2X/2/20266518b00421233cbdd3a94a8ecbb4b3817b0a.png)  
prepared\_requirements.png

---

<div class="post-metadata">

**Author:** ![Anonymous](https://avatars.discourse-cdn.com/v2/letter/a/8491ac/32.png) [@Anonymous](https://forums.visual-paradigm.com/u/Anonymous)\
**Post date:** [January 20, 2009, 8:33am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/3 "2009-01-20T08:33:40Z")

</div>

Hi,  
“Body” is a property I defined in my own requirement (via Tool \> Configure Requirements).  
I tried to call the IRequirement.getTaggedValues() - return ITaggedValueContainer, when I tried to get “Body” from the ITaggedValueContainer - return null, since there really is “Body” property.  
It works if I display Tagged Values tab in specification window (Requirement specification -\> Attributes) and than  
call req.getTaggedValues().getTaggedValueByName(“Body”).

Regards,  
anita

---

<div class="post-metadata">

**Author:** ![LilianWong](https://avatars.discourse-cdn.com/v2/letter/l/919ad9/32.png) [@LilianWong](https://forums.visual-paradigm.com/u/LilianWong)\
**Post date:** [January 21, 2009, 10:42am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/4 "2009-01-21T10:42:32Z")

</div>

Hi Anita,

Thanks for replying. May I know was your requirement created by plugin or diagram toolbar?

Best regards,  
Lilian Wong

---

<div class="post-metadata">

**Author:** ![Anonymous](https://avatars.discourse-cdn.com/v2/letter/a/8491ac/32.png) [@Anonymous](https://forums.visual-paradigm.com/u/Anonymous)\
**Post date:** [January 22, 2009, 8:12am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/5 "2009-01-22T08:12:56Z")

</div>

Hi,

> May I know was your requirement created by plugin or diagram toolbar?  
> by plugin.  
> It works OK if I create by diagram toolbar.

Best regards,  
Anita

---

<div class="post-metadata">

**Author:** ![LilianWong](https://avatars.discourse-cdn.com/v2/letter/l/919ad9/32.png) [@LilianWong](https://forums.visual-paradigm.com/u/LilianWong)\
**Post date:** [January 22, 2009, 11:22am UTC](https://forums.visual-paradigm.com/t/tagged-value/10651/6 "2009-01-22T11:22:53Z")

</div>

Hi Anita,

Thanks for replying. May I know did you add the requirement stereotype into IRequirement?

Would you mind sending me your plugin and project file for investigation? Thanks in advance!

\*If you do not want the files to be accessed by public, please send to [lilian@visual-paradigm.com](mailto:lilian@visual-paradigm.com)

Best regards,  
Lilian Wong
