Author Topic: Importing Open Exchange File generated by Archi into Sparx Systems EA  (Read 2871 times)

Volker Augustin

  • Newbie
  • *
  • Posts: 1
All,

at the moment I am using both Archi and Sparx Systems Enterprise Architect for modelling.
Recently, I wanted to export an ArchiMate 3.0 model from Archi and import into EA.
However, it seems EA only has support to import ArchiMate 2.0 models.
Therefore, I wrote a small XML conversion using xmlstarlet that I wanted to share:

Code: [Select]
@echo off
set INPUTFILE=%1
set OUTPUTFILE=%2
set INTERMEDIATEFILE=CONVERSION_INTERMEDIATE.xml

xml  ed ^
  -N x=http://www.opengroup.org/xsd/archimate/3.0/ ^
  -N dc=http://purl.org/dc/elements/1.1/ ^
  -i "/x:model" -t attr -n "xmlns:dc" -v "http://purl.org/dc/elements/1.1/" ^
  -u "/x:model/@xsi:schemaLocation" -v "http://www.opengroup.org/xsd/archimate http://www.opengroup.org/xsd/archimate/archimate_v2p1.xsd http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd" ^
  -i "/x:model/x:name" -t elem -n "metadata" -v "" ^
  -s "/x:model/metadata" -t elem -n "schema" -v "Dublin Core" ^
  -s "/x:model/metadata" -t elem -n "schemaversion" -v "1.1" ^
  -s "/x:model/metadata" -t elem -n "dc:title" -v "Title" ^
  -s "/x:model/metadata" -t elem -n "dc:subject" -v "Subject" ^
  -s "/x:model/metadata" -t elem -n "dc:format" -v "The Open Group ArchiMate Exchange Format" ^
  -s "/x:model/metadata" -t elem -n "dc:language" -v "en" ^
  -r "//*/x:name" -v label ^
  -r "/x:model/x:label" -v name ^
  -r "/x:model/x:organizations" -v organization ^
  -r "//*/x:item/@identifierRef" -v identifierref ^
  -r "//*/x:node/@elementRef" -v elementref ^
  -r "//*/x:connection/@relationshipRef" -v relationshipref ^
  -u "//*/x:relationship[@xsi:type=\"Access\"]/@xsi:type" -v "AccessRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Aggregation\"]/@xsi:type" -v "AggregationRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Assignment\"]/@xsi:type" -v "AssignmentRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Association\"]/@xsi:type" -v "AssociationRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Composition\"]/@xsi:type" -v "CompositionRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Flow\"]/@xsi:type" -v "FlowRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Realization\"]/@xsi:type" -v "RealisationRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Serving\"]/@xsi:type" -v "UsedByRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Specialization\"]/@xsi:type" -v "SpecialisationRelationship" ^
  -u "//*/x:relationship[@xsi:type=\"Triggering\"]/@xsi:type" -v "TriggeringRelationship" ^
  -m "/x:model/x:views/x:diagrams/x:view" "/x:model/x:views" ^
  -d "/x:model/x:views/x:diagrams" ^
  %INPUTFILE% > %INTERMEDIATEFILE%

sed -e "s/http:\/\/www\.opengroup\.org\/xsd\/archimate\/3\.0\//http:\/\/www\.opengroup\.org\/xsd\/archimate/g" %INTERMEDIATEFILE%  > %OUTPUTFILE%

DEL %INTERMEDIATEFILE%

Best regards,
Volker
« Last Edit: May 24, 2017, 10:13:37 AM by Volker Augustin »

Phil Beauvoir

  • Archi Master
  • Hero Member
  • *****
  • Posts: 922
    • Archi
Hi Volker,

thanks for sharing!

I'm sure one day Sparx will come up to speed...  ;)

Phil
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

steen.jensen@sll.se

  • Member
  • **
  • Posts: 14
Re: Importing Open Exchange File generated by Archi into Sparx Systems EA
« Reply #2 on: October 13, 2017, 22:29:38 PM »
From this sommer, release of Sparx EA 13.5 the Archimate Exchnage format v3 is working okey to share models between Sparx EA and Archi.

Phil Beauvoir

  • Archi Master
  • Hero Member
  • *****
  • Posts: 922
    • Archi
Re: Importing Open Exchange File generated by Archi into Sparx Systems EA
« Reply #3 on: October 13, 2017, 22:53:14 PM »
From this sommer, release of Sparx EA 13.5 the Archimate Exchnage format v3 is working okey to share models between Sparx EA and Archi.

Thanks for the info, Steen.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate