Book a Demo

Author Topic: ArchiMate AppliationService parameter type/direction  (Read 8036 times)

naxx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
ArchiMate AppliationService parameter type/direction
« on: May 17, 2016, 06:50:34 pm »
Hello,
we are using ArchiMate language for modelling our system and we are using also Java automation API of EA provided by Sparx. We are currently not able to access service (ArchiMate_ApplicationService) parameter type and direction via Java API - because we don't know which method of API should be used. See images and part of XMI file attached.

Thank you for your help!
Ondrej




Code: [Select]
<UML:Namespace.ownedElement>
<UML:Collaboration xmi.id="EAID_87A01E57_9CA5_4c32_9574_DB31E2144E53_Collaboration" name="Collaborations">
<UML:Namespace.ownedElement>
<UML:ClassifierRole name="parameterName2" xmi.id="EAID_10F73A16_ACAD_4c7b_A1D1_5019EBBCF941" visibility="public" base="EAID_11111111_5487_4080_A7F4_41526CB0AA00">
<UML:ModelElement.taggedValue>
<UML:TaggedValue tag="documentation" value="Parameter 2 note (type = String)"/>
<UML:TaggedValue tag="isAbstract" value="false"/>
<UML:TaggedValue tag="isSpecification" value="false"/>
<UML:TaggedValue tag="ea_stype" value="ActivityParameter"/>
<UML:TaggedValue tag="ea_ntype" value="0"/>
<UML:TaggedValue tag="version" value="1.0"/>
<UML:TaggedValue tag="isActive" value="false"/>
<UML:TaggedValue tag="classifier" value="EAID_EASTRING_B653_4f3c_A010_30205D67F5F5"/>
<UML:TaggedValue tag="package" value="EAPK_87A01E57_9CA5_4c32_9574_DB31E2144E53"/>
<UML:TaggedValue tag="owner" value="EAID_7D56DDFF_4385_4168_B12A_3FE85B9933F0"/>
<UML:TaggedValue tag="classname" value="String"/>
<UML:TaggedValue tag="date_created" value="2016-05-12 13:00:29"/>
<UML:TaggedValue tag="date_modified" value="2016-05-17 10:26:54"/>
<UML:TaggedValue tag="gentype" value="&lt;none&gt;"/>
<UML:TaggedValue tag="tagged" value="0"/>
<UML:TaggedValue tag="package_name" value="Test"/>
<UML:TaggedValue tag="phase" value="1.0"/>
<UML:TaggedValue tag="author" value="Ondrej Pala"/>
<UML:TaggedValue tag="complexity" value="1"/>
<UML:TaggedValue tag="status" value="Proposed"/>
<UML:TaggedValue tag="tpos" value="1"/>
<UML:TaggedValue tag="ea_localid" value="922"/>
<UML:TaggedValue tag="ea_eleType" value="element"/>
<UML:TaggedValue tag="style" value="BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>
<UML:TaggedValue tag="$ea_xref_property" value="$XREFPROP=$XID={4068AD70-1BB5-4db3-9C2A-C68E5FA09EF8}$XID;$NAM=CustomProperties$NAM;$TYP=element property$TYP;$VIS=Public$VIS;$PAR=0$PAR;$DES=@PROP=@NAME=direction@ENDNAME;@TYPE=ParameterDirectionKind@ENDTYPE;@VALU=out@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;@PROP=@NAME=isStream@ENDNAME;@TYPE=boolean@ENDTYPE;@VALU=0@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;@PROP=@NAME=isException@ENDNAME;@TYPE=boolean@ENDTYPE;@VALU=0@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;$DES;$CLT={10F73A16-ACAD-4c7b-A1D1-5019EBBCF941}$CLT;$SUP=&lt;none&gt;$SUP;$ENDXREF;"/>
</UML:ModelElement.taggedValue>
</UML:ClassifierRole>
<UML:ClassifierRole name="parameterName1" xmi.id="EAID_1BD213F1_672B_4a3f_A700_A05B1746FEEF" visibility="public" base="EAID_11111111_5487_4080_A7F4_41526CB0AA00">
<UML:ModelElement.taggedValue>
<UML:TaggedValue tag="documentation" value="Parameter 1 note (type = Integer)"/>
<UML:TaggedValue tag="isAbstract" value="false"/>
<UML:TaggedValue tag="isSpecification" value="false"/>
<UML:TaggedValue tag="ea_stype" value="ActivityParameter"/>
<UML:TaggedValue tag="ea_ntype" value="0"/>
<UML:TaggedValue tag="version" value="1.0"/>
<UML:TaggedValue tag="isActive" value="false"/>
<UML:TaggedValue tag="classifier" value="EAID_EAINT000_B653_4f3c_A010_30205D67F5F5"/>
<UML:TaggedValue tag="package" value="EAPK_87A01E57_9CA5_4c32_9574_DB31E2144E53"/>
<UML:TaggedValue tag="owner" value="EAID_7D56DDFF_4385_4168_B12A_3FE85B9933F0"/>
<UML:TaggedValue tag="classname" value="Integer"/>
<UML:TaggedValue tag="date_created" value="2016-05-12 13:00:29"/>
<UML:TaggedValue tag="date_modified" value="2016-05-17 10:26:45"/>
<UML:TaggedValue tag="gentype" value="&lt;none&gt;"/>
<UML:TaggedValue tag="tagged" value="0"/>
<UML:TaggedValue tag="package_name" value="Test"/>
<UML:TaggedValue tag="phase" value="1.0"/>
<UML:TaggedValue tag="author" value="Ondrej Pala"/>
<UML:TaggedValue tag="complexity" value="1"/>
<UML:TaggedValue tag="status" value="Proposed"/>
<UML:TaggedValue tag="tpos" value="0"/>
<UML:TaggedValue tag="ea_localid" value="920"/>
<UML:TaggedValue tag="ea_eleType" value="element"/>
<UML:TaggedValue tag="style" value="BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>
<UML:TaggedValue tag="$ea_xref_property" value="$XREFPROP=$XID={AA16F7DF-349D-4ab8-933C-F96B61E3AA14}$XID;$NAM=CustomProperties$NAM;$TYP=element property$TYP;$VIS=Public$VIS;$PAR=0$PAR;$DES=@PROP=@NAME=isStream@ENDNAME;@TYPE=boolean@ENDTYPE;@VALU=0@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;@PROP=@NAME=isException@ENDNAME;@TYPE=boolean@ENDTYPE;@VALU=0@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;$DES;$CLT={1BD213F1-672B-4a3f-A700-A05B1746FEEF}$CLT;$SUP=&lt;none&gt;$SUP;$ENDXREF;"/>
</UML:ModelElement.taggedValue>
</UML:ClassifierRole>
</UML:Namespace.ownedElement>
<UML:Collaboration.interaction/>
</UML:Collaboration>
<UML:ActivityModel xmi.id="EAID_87A01E57_9CA5_4c32_9574_DB31E2144E53_ActivityModel" context="EAPK_87A01E57_9CA5_4c32_9574_DB31E2144E53" name="ActivityModel" visibility="public">
<UML:StateMachine.transitions/>
<UML:StateMachine.top>
<UML:CompositeState xmi.id="EAID_87A01E57_9CA5_4c32_9574_DB31E2144E53_Activity_Top" name="{top}">
<UML:CompositeState.substate>
<UML:ActionState name="serviceName" xmi.id="EAID_7D56DDFF_4385_4168_B12A_3FE85B9933F0" visibility="public" namespace="EAPK_87A01E57_9CA5_4c32_9574_DB31E2144E53">
<UML:ModelElement.stereotype>
<UML:Stereotype name="ArchiMate_ApplicationService"/>
</UML:ModelElement.stereotype>
<UML:ModelElement.taggedValue>
<UML:TaggedValue tag="documentation" value="Service description"/>
<UML:TaggedValue tag="isAbstract" value="false"/>
<UML:TaggedValue tag="isSpecification" value="false"/>
<UML:TaggedValue tag="ea_stype" value="Activity"/>
<UML:TaggedValue tag="ea_ntype" value="0"/>
<UML:TaggedValue tag="version" value="1.0"/>
<UML:TaggedValue tag="isActive" value="false"/>
<UML:TaggedValue tag="package" value="EAPK_87A01E57_9CA5_4c32_9574_DB31E2144E53"/>
<UML:TaggedValue tag="date_created" value="2016-05-12 13:00:29"/>
<UML:TaggedValue tag="date_modified" value="2016-05-17 10:25:16"/>
<UML:TaggedValue tag="gentype" value="&lt;none&gt;"/>
<UML:TaggedValue tag="tagged" value="0"/>
<UML:TaggedValue tag="package_name" value="Test"/>
<UML:TaggedValue tag="phase" value="1.0"/>
<UML:TaggedValue tag="author" value="Ondrej Pala"/>
<UML:TaggedValue tag="complexity" value="1"/>
<UML:TaggedValue tag="status" value="Proposed"/>
<UML:TaggedValue tag="stereotype" value="ArchiMate_ApplicationService"/>
<UML:TaggedValue tag="tpos" value="0"/>
<UML:TaggedValue tag="ea_localid" value="919"/>
<UML:TaggedValue tag="ea_eleType" value="element"/>
<UML:TaggedValue tag="style" value="BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=1;HSwimLanes=1;BorderStyle=0;"/>
<UML:TaggedValue tag="$ea_xref_property" value="$XREFPROP=$XID={ACBA81BD-D923-495b-A645-DDB6525CC0E3}$XID;$NAM=Stereotypes$NAM;$TYP=element property$TYP;$VIS=Public$VIS;$PAR=0$PAR;$DES=@STEREO;Name=ArchiMate_ApplicationService;FQName=Archimate2::ArchiMate_ApplicationService;@ENDSTEREO;$DES;$CLT={7D56DDFF-4385-4168-B12A-3FE85B9933F0}$CLT;$SUP=&lt;none&gt;$SUP;$ENDXREF;$XREFPROP=$XID={82B40DCB-FCAE-4577-A4AD-B4E5FA125222}$XID;$NAM=CustomProperties$NAM;$TYP=element property$TYP;$VIS=Public$VIS;$PAR=0$PAR;$DES=@PROP=@NAME=parameterName@ENDNAME;@TYPE=String@ENDTYPE;@VALU=Integer, String*@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;$DES;$CLT={7D56DDFF-4385-4168-B12A-3FE85B9933F0}$CLT;$SUP=&lt;none&gt;$SUP;$ENDXREF;"/>
</UML:ModelElement.taggedValue>
</UML:ActionState>
</UML:CompositeState.substate>
</UML:CompositeState>
</UML:StateMachine.top>
</UML:ActivityModel>
</UML:Namespace.ownedElement>

Full XMI file: http://pastebin.com/5UJTKuui

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

naxx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: ArchiMate AppliationService parameter type/direction
« Reply #2 on: May 18, 2016, 08:34:08 pm »
Hello Geert,
thank you for quick response!

We can't use EA.Parameter.Kind because in Archimate Service is internally (in EA, see XMI) represented as Activity (with stereotype ArchiMate_ApplicationService) and Archimate Service Parameter is represented as inner element ActivityParameter.

Following part of Java code creates new archimate service with one parameter via Java automation API:
Code: [Select]
// adding new Archimate Service to the Package "pckg"
Element newService = pckg.GetElements().AddNew("newArchimateService", "Activity");
newService.SetStereotype("ArchiMate_ApplicationService");
newService.Update();
pckg.GetElements().Refresh();

// adding new parameter to Archimate Service
Element newParameter = newService.GetElements().AddNew("newServiceParameter", "ActivityParameter");
newParameter.SetNotes("...some description...");
// how to set "type" of parameter ???
// how to set "direction" of parameter ???
newParameter.Update();
newService.GetElements().Refresh();

Result of this code can be seen here:



The question is: how to set type and direction of the Archimate Service Parameter, which is represented as Element base class (see http://sparxsystems.com/enterprise_architect_user_guide/12.1/automation_and_scripting/element.html).

Thank you!
Ondrej

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ArchiMate AppliationService parameter type/direction
« Reply #3 on: May 18, 2016, 08:42:19 pm »
In that case you'll have to figure out where EA stores that data and get it from the corresponding location.

The easiest way to figure that out is to use a profiler like the one on SQL Server that records all SQL queries that EA executes.

Geert

naxx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: ArchiMate AppliationService parameter type/direction
« Reply #4 on: May 19, 2016, 05:26:52 am »
Hello Geert,
I don't understand how profiling EA SQL server queries can help me to identify, which Java property of automation API allow me to access data type and direction of Archimate Service Parameter.

Ondrej

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ArchiMate AppliationService parameter type/direction
« Reply #5 on: May 19, 2016, 01:22:42 pm »
Ondrej,

There is a very close relationship between the API and the database. So once you know which field(s) in the database are used to store the information, it's usually easy to guess to which property int he API that translates.

And if it's not exposed in the API there's always Repository.SQLQuery() to the rescue.

Geert