TaggedValues again

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


if(model.getTaggedValues()==null)
  model.setTaggedValues(IModelElementFactory.instance().createTaggedValueContainer());
ITaggedValue tv = model.getTaggedValues().getTaggedValueByName(name);
if(tv == null) {
  IModelElementFactory.instance().createTaggedValue();
  tv = model.getTaggedValues().createTaggedValue();
  tv.setName("ParticularTaggedValueName");
  model.getTaggedValues().addTaggedValue(tv);
}
tv.setValue("ParticularTaggedValueValue");

it works, but there are problems with displaying Tagged Values tab in specification window. Is it something wrong in my code?

Regards,
Jacek

Hi again Jacek,

I will talk to our engineers about your questions regarding plugin. I will come back to you as soon as possible.

Best regards,
Jick

Hello Jacek,

We have checked your code, and have several comments.

if(tv == null) {
   // this is meaningless (just create, no one has ref to the tagged value)
   IModelElementFactory.instance().createTaggedValue();
   tv = model.getTaggedValues().createTaggedValue();
   tv.setName("ParticularTaggedValueName");

   // This is meaningless as well because "tv" is created by 
   // TaggedValueContainer.createTaggedValue(), 
   // so "tv" is added into Container while create.
   model.getTaggedValues().addTaggedValue(tv);
 }

Although there are some statements that seems to be meaningless, we do not find any problem with displaying tagged values tab. Could you explain more, perhaps with screenshots, to show what the problem is?

Best regards,
Jick

Of course, you’re right. These lines are meaningless.
Should be:

			if(rm.getTaggedValues() == null) {
				rm.setTaggedValues(IModelElementFactory.instance().createTaggedValueContainer());
			}
			ITaggedValue tv = rm.getTaggedValues().getTaggedValueByName("ParticulerTaggedValueName");
			if(tv == null) {
				tv = rm.getTaggedValues().createTaggedValue();
				tv.setName("ParticulerTaggedValueName");
			}
			tv.setValue("ParticulerTaggedValueValue");

It’s difficult to show screenshots, because the tagged values tab simply does not appear.
The problem occurs only when creating new TaggedValueContainer.

Regards,
Jacek

TaggedValues.JPG

Hello Jacenty,

I believe there is exception appear in the log file. Could you post here the vp.log file? ($vp-suite-install-dir/bin/vp.log)

Best regards,
Jick

Hello Jick,

This is my vp.log file
vp.log

Thanks Jacenty,

I will discuss with our engineers.

Best regards,
Jick

HI again Jacenty,

Glad to inform you that the problem is fixed. Please download the patch at:
http://files3.visual-paradigm.com/200704/Patch/sp1_20070420h/vpplatform.jar

To install the patch:

  1. Shutdown any running instances of VP
  2. Replace $vp-suite-install-dir/lib/vpplatform.jar with the downloaded jar file
  3. Run $vp-suite-install-dir/bin/VP Suite.exe to install the patch
  4. Restart the application

Best regards,
Jick

Hello Jacenty,

Service Pack 2 is released. Several of your reported problems are ready in this release. I suggest you advance to it.

To upgrade, please run the product updater inside the bin folder of VP Suite installation directory.

You may want to know more about the new and enhanced feature in Service Pack 2:
http://resources.visual-paradigm.com/vpsuite3.0sp2

Please feel free to let me know if you need any help.

Best regards,
Jick

Thank you,

It works now and there are bew interesting features.

Regards,
Jacek

You are welcome. Feel free to contact us if there are any questions or suggestions.