Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Shaun Yandle on February 13, 2013, 07:47:50 am
-
Using EA v10 b1004. Trying to create BPMN2 elements via Java batch application to provide an import from external data/relationship sources.
I can do this via UI, but unable to figure out what/how to get the same result via API. UML Activity is close but not sufficient.
Already doing the base work of obtaining the Collection<Elements>.AddNew(name,type?)
No stereotypes show when manually created.
Any advice is appreciated!
-
You need to supply the MDG identifier. E.g.
AddNew ("name", "BPMN2.0::Activity")
q.
-
I've got this working with elements - but not with packages
When I create a package, referring to the [profile]::[type] I get no stereotype in the created package.
This profile is not created by me (and I haven't done that - yet), can it be a missing thingy in the profile ?
gr
-
No idea. Either you wait a day for a Sparxian to reply or contact their support.
Is it a certain package out of the BPMN2 profile from Sparx?
q.
-
No - it's a home made profile by one of my colleagues.
Problem is we're both beginners in EA MDG/automatisation
Great product but .... ;)
-
But you can create the package manually using that profile?
q.
-
Took me a bit of more trial-and-error, but discovered that you have to use the stereotype defined in the MDG xml (and that shows in Project Browser). So more of [MDG-ID]::[MDG-Stereotype]. For example, use BPMN2.0::StartEvent
Basically, do not set the stereotype field (I have a utility routine that does the createElement(name, type, stereotype) ).
Thanks!
-
Yep use [profile::type] BUT it doesn't seem to work for a package
Works for EA.Element, not for EA.Package
- in my case anyway
Querty asked if the package can be created thru the MDG ?
I don't know - it is not in the toolbox.
The MDG package is there only to be used by the add-in; the user doesn't manually create such packages
-
Querty asked if the package can be created thru the MDG ?
I don't know - it is not in the toolbox.
The MDG package is there only to be used by the add-in; the user doesn't manually create such packages
For testing purpose you should put it into a toolbox so you'll be sure it is created correctly. If it doesn't create manually the API won't do it anyway.
Probably you should think of having the package in a toolbox permanently for maintenance purpose.
q.