Search code examples
enterprise-architect

How to import a custom xml file into my EA model


The context of my use case is as follows:

I have a model of a robot that I have created in Enterprise Architect (15.1) primarily with SysML. I want my model to check a URDF file (which is itself an XML file) to determine whether attributes of the URDF model meet the requirements of my EA model.

In my EA model I have requirement 'Maximum Mass' that is satisfied by with a property 'mass', type Real, which is owned by 'Robot' block. In the URDF it has 'mass' attributes for each robot link (so in the XML hierarchy the 'mass' attribute is in robot:link:inertial).

My use case: I want my EA model to import the URDF model in accordance with a XML schema. From there I should be able to sum the total mass according to the URDF model to give a derived value to my 'mass' property in the EA model and then compare that value to the requirement constraint to determine whether the requirement is verified or not.

If importing this urdf is not possible then is it possible to read the urdf file?

I took an example .urdf file and converted it to a .xsd file. In the Ribbon I then did Develop->Schema Modeling->Import XSD. I chose the 'UML Attributes' option under the 'Import XSD Elements/Attributes' Import Options header. Elements are stereotyped XSD{complexType,element,attribute} and the hierarchy looks to be in order. However, I don't know what to do next to import a urdf model in accordance with the created schema.


Solution

  • It is not possible to import a random xml file into EA, not even if you have imported it's XML schema.

    There are a number of file formats supported such as XMI, EMX/UML2, etc... but URDF is not one of them.

    So in order to import the file you'll have to write your own automation in the form of a script, add-in or standalone program.

    Before you can do that you'll have to determine how to translate your URDF file into EA concepts such as elements, attributes, connectors or tagged values.

    Look here for more info on automation in EA: https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/automation_interface.html