Book a Demo

Author Topic: SynchTaggedValues  (Read 6580 times)

brunovdb

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
SynchTaggedValues
« on: May 15, 2013, 09:44:19 pm »
I'm trying to create a new element that has the BPMN 2.0 Gateway stereotype.

The code I use to try this out goes as follows:

if (repository.IsTechnologyLoaded("BPMN2.0"))
{
      Package model = (Package)repository.Models.AddNew("new model", "");
      if (model.Update())
      {
            Package view = (Package)model.Packages.AddNew("new view", "");
            if (view.Update())
            {
                  Element element = (Element)view.Elements.AddNew("new decision", "Decision");
                  element.Stereotype = "Gateway";
                  if (element.Update())
                  {
                        if (element.SynchTaggedValues("BPMN2.0", "Gateway"))
                        {
                              element.Refresh();
                        }
                  }
            }
      }
}

The the SynchTaggedValues fails (returns false) and the resulting element does not contain any of the BPMN 2.0 Gateway specific properties.

Any suggestions on how to get this right?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SynchTaggedValues
« Reply #1 on: May 16, 2013, 02:05:08 am »
I tried it here with V10. No problem. Which version do you use?

q.

brunovdb

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: SynchTaggedValues
« Reply #2 on: May 16, 2013, 05:05:59 pm »
Hello q,

The about box for EA gives me the following details:
- Program Version: 10.0.1007
- Database version: 4.01
- Registration details: Registered Enterprise Architect (Corporate Edition)

The version of the Interop.EA.dll is 2.10.238.1.

For what it's worth, I am calling the code from an add-in in EA.

Bruno

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SynchTaggedValues
« Reply #3 on: May 16, 2013, 08:12:32 pm »
I have the same version. For the test I used a stand-alone program, but that does not make a difference. You probably should contact Sparx support.

q.

[edit] The only way it fails is when the MDG is turned off...
« Last Edit: May 16, 2013, 08:20:23 pm by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: SynchTaggedValues
« Reply #4 on: May 17, 2013, 10:08:25 am »
I think the most likely cause for failure would be having multiple BPMN profiles enabled.

However, the solution is easy.

Replace
Code: [Select]
Element element = (Element)view.Elements.AddNew("new decision", "Decision");
element.Stereotype = "Gateway";
if (element.Update())
{
    if (element.SynchTaggedValues("BPMN2.0", "Gateway"))
    {
        element.Refresh();
     }
}
with

Code: [Select]
Element element = (Element)view.Elements.AddNew("new decision", "BPMN2.0::Gateway");
element.Update();
« Last Edit: May 17, 2013, 10:10:06 am by simonm »

brunovdb

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: SynchTaggedValues
« Reply #5 on: May 17, 2013, 05:03:41 pm »
That sorted it out, thanks a lot!
Bruno

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: SynchTaggedValues
« Reply #6 on: August 06, 2013, 05:20:16 pm »
I realise I'm a bit late into this discussion, and thanks Simon for the answer to my question: I was stuck on the basic adding of a new BPMN element.
It seems odd that we need to create a new element of type 'BPMN20.::Gateway', rather than one of type 'BPMN2.0::Decision' with a stereotype="Gateway", which is what I was expecting.
It seems that this MDG has effectively defined some new "types" rather than stereotypes of existing ones.
My question is therefore where are these new types listed? The BPMN help  explains very well what they are from the user's point of view e.g"Data Object", "End Event" etc, but is there somewhere where we can find the new type names which the API understands ? For example, do we:
addNew("something","BPMN2.0::Data Object") or
addnew("something","BPMN2.0::DataObject") etc

Also, is it just me who gets confused about what's a type, what's a stereotype, and what one of these new 'special types', which look like type+stereotype in the database, but which EA treats like first-class types when listing available types ? Are there some rules here which might merit a bit more explanation ?
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com