Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - rmartinezb

Pages: [1] 2
Automation Interface, Add-Ins and Tools / Obtain MDG from stereotype
« on: June 28, 2017, 01:05:48 am »

There is a way of reading the stereotype of an element, get its MDG.
For example, I want to know if a collection of elements are Archimate, BPMN or other type elements.


I want to obtain programmatically some information about the version control, for example the url, or the type (SCC, CSV, subversion or TFS) etc.

There's a simple way to do this with the automation interface? I only see the package functions but any of them returns information about the version control.

General Board / Extending built in stereotypes in a profile (BPMN)
« on: April 04, 2017, 12:49:08 am »

I'm working with BPMN and I have to create some new elements. I know how to do this thanks to this guide

For example:

But some of the new elements have to extend form some built in stereotypes, like a subProcess Task. For that I have to extend form BPMN2.0::Activity and indicate that this activity have the subProcess type. How can I do that?


Is there any way for launch an addin from other addin, for example clicking a button?



I'm trying to create programmatically some archimate elements into an ArchiMate_Grouping element. I'm doing that replacing the parentID of the element for the elementID of the grouping element.
In the Project Browser, the elements appears into the grouping element, but this is not reflected in the diagram.

How can I represent this in the diagram?

PD: I have tried to create the DiagramObjects before and after replacing the parentID.

Automation Interface, Add-Ins and Tools / Create custom Diagram from MDG
« on: February 24, 2017, 07:50:37 pm »
I created a new MDG that defines a new toolbox and assign it to a custom diagram. In Ea, when I create a new diagram, i can select my new technology and i haven't any problem, but when i create a diagram from an addin only the called "Custom" toolbox are shown, not my custom toolbox:

The way I create the diagram is:
            EA.Diagram diagram = thePackage.Diagrams.AddNew(diagramName, "DevOpsMDG::DevOps");

And in my MDG file I have:

               <Stereotype name="DevOps " alias="DevOps" notes="Custom MDG" cx="386" cy="88" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                    <Apply type="Diagram_Custom">
                          <Property name="alias" value="DevOps"/>
                     <Property name="diagramID" value="DevOps"/>
                     <Property name="toolbox" value="DevOps"/>

I think the problem must be in one of this codes. Anyone know what I'm doing wrong?


General Board / Export extended BPMN2.0 elements
« on: February 16, 2017, 03:51:19 am »

I created new elements that extend from BPMN Activity following this guide:

The new element works fine, but when I want to export the package that contains an activity with the new stereotype in BPMN 2.0 XML format, this element doesn't appear on the xml file. This doesn't happen if I export the package in XMI format.

Also I've noticed that the "Exclude EA Extensions" option is disabled

May EA doesn't allow this or I'm doing something wrong?

General Board / Add an image to stereotype
« on: February 13, 2017, 07:42:26 pm »

I'm developing some new stereotypes for create new elements, my goal is add some .jpg icons to this new elements, but I don't know how.

I was trying with _image attribute, but it only allows  EAShapeScript 1.0 type. How can i get some like this?

Automation Interface, Add-Ins and Tools / Internationalize addin menu
« on: December 02, 2016, 10:45:12 pm »
Hi, I'm developing a C# addin and I have to internationalize it. I'm using resource (.resx) files on visual studio to translate most of the things. this seems to work well, I can change all the UI and al the strings on my program, but seems that addin menu items only accept const values so I cant change them.

There any way to change the menu depending of the user system language?

Automation Interface, Add-Ins and Tools / Custom Tagged Values by C# addin
« on: November 11, 2016, 02:03:37 am »

I'm programming an addin that generate some Archimate elements and I need to create some TV for each elements, but I need that some of them be read only.
How can I do that? I know how to create tagged values, but don't how to manage tagged value types through the automation interface. Any tip?

Hi!, I'm trying to set the "Notes" attribute of a package, but I can't. My code is more or less the next:
Code: [Select]
                EA.Package selectedPackage = Repository.GetTreeSelectedPackage();

                EA.Package repPackage selectedPackage.Packages.AddNew(package_data[0], "");


                repPackage.Element.Author = package_data[1];
                repPackage.Element.Notes = package_data[2];
                repPackage.Element.Tag = package_data[3];


Below this, on other function I have:

Code: [Select]
                    textbox_name.text = package.Element.Name;
                    textbox_author.text = package.Element.Author;
                    textbox_notes.text = package.Element.Notes;
                    textbox_tag.text package.Element.Tag;

All, except Notes works, and if I edit manually the Notes field on the package properties window, the second function, the  textbox_notes.text = package.Element.Notes; also works, so I think I missed something about the repPackage.Element.Notes = package_data[2];

Can somebody help me?


I have two C# addins that read a database and generate an Archimate Diagram and a BPMN Diagram.
Now I want to link this two generated diagrams, but I don't know how to do this programatically.
I have two options, generate the BPMN diagram into an Archimate Business Process element directly through my addin or generate the two diagrams independently and then link the BPMN one with the corresponding element of the Archimate Diagram.

I suppose the the answer will be near the "Composite Structure Diagram" option, but i don't know how to generate this kind of diagrams or how to link them to a specific element.

Any tips?

I'm trying to create BPMN elements, but I'm not able of add the subtype of the element.
I can create the basic elements, for example:
Code: [Select]
EA.Element theElement = elements.AddNew(elementName, "BPMN2.0::Gateway" );But i don't know how to specify that this Gateway is a Parallel Gateway.

I read this document ( ) and I tried to use tagged values for this purpose, but I must be doing something wrong.
Here is a part of my code:

Code: [Select]

                    EA.Element theElement = elements.AddNew(elementList[j][1], "BPMN2.0::" + elementList[j][2]);

                    if (elementList[j][2].Equals("Gateway"))
                        EA.TaggedValue taggedValue = (EA.TaggedValue)theElement.TaggedValues.AddNew("gatewayType", elementList[j][3]);
                        taggedValue.ElementID = theElement.ElementID;


(The elementList[j][3] variable contains the string "Parallel", "Exclusive" or "Inclusive")
Below this i do the corresponding Update().

Automation Interface, Add-Ins and Tools / BPMN2.0 from C# addin
« on: July 15, 2016, 07:23:47 pm »
I'm writing an addin in C# that creates a BPMN diagram with data from a mysql DB, but I have no idea how to do for insert lanes into pools or elements into lanes.

This is a part of my code:
Code: [Select]

                for(int i =0; i< poolList.Count; i++)
                    EA.Element poolElement = elements.AddNew(poolList[i][1], "BPMN2.0::" + poolList[i][2]);

                    poolList[i][3] = poolElement.ElementID.ToString();

                    EA.DiagramObject dObject = diagram.DiagramObjects.AddNew(poolList[i][1], "BPMN2.0::" + poolList[i][2]);
                    dObject.ElementID = poolElement.ElementID;

                for (int i = 0; i < laneList.Count; i++)
                    EA.Element laneElement = elements.AddNew(laneList[i][2], "BPMN2.0::Lane" );

                    laneList[i][3] = laneElement.ElementID.ToString();

                    EA.DiagramObject dObject = diagram.DiagramObjects.AddNew(laneList[i][2], "BPMN2.0::Lane");
                    dObject.ElementID = laneElement.ElementID;

                for (int j = 0; j < elementList.Count; j++)
                    EA.Element theElement = elements.AddNew(elementList[j][1], "BPMN2.0::" + elementList[j][2]);
                    theElement.Stereotype = "BPMN2.0::" + elementList[j][2];

                    elementList[j][3] = theElement.ElementID.ToString();

                    EA.DiagramObject dObject = diagram.DiagramObjects.AddNew(elementList[j][1], "BPMN2.0::" + elementList[j][2]);
                    dObject.ElementID = theElement.ElementID;

The code works fine, i create the elements (I haven't yet created the connectors) and add them to the diagram. But I do not want to have to drag each lane to their pool and each element to their lane with the mouse, i want do it by coding.
Any tips?

Automation Interface, Add-Ins and Tools / Create tables from MySql
« on: May 17, 2016, 09:10:01 pm »

I'm programming an addin in C# (only for learning purposes) that connects with a MySql database. I do a "SHOW COLUMS FROM myTable" query and im trying to draw in EA the table with the obtained data.

Has EA SDK any tool to draw the table using this data?
For example: EA.Element newElement = TheQueryThatReturnTheTableData
I saw a tool in EA that draws the schema of a database, but i have to do this programming in the addin.

I know that i can create a table, creating the element, the atributes, and methods, but if exist a easier way i would like to know it.

Pages: [1] 2