Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: piku on October 19, 2019, 06:01:45 am
-
Hello All,
I need to automate requirements import to enterprise architect.
If excel file or (sql table from other system) has new requirements then create them in EA, if they already exist in EA then update them.
I was thinking of using OSLC API feature in EA pro cloud server but i am not sure how exactly i can do it.
I got this link (http://localhost:port/model/oslc/cf/) to create new requirements from documentation.
But how can i pass values? how can i update existing requirements? It can not be a manual process.
I am planning to use powershell or sql or C# app to make api calls.
Thank you so much for your help.
-
https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/model_repository/oslc_quick_ref.html (https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/model_repository/oslc_quick_ref.html)
Go down the page until you see Creation Factory - Resource (Package/Element).
-
Thanks for your reply. I have to update thousands of values using excel file. Do i have to pass them one by one? Or is there a way to make a post using values in a files?
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:ss="https://sparxsystems.com.au/oslc_am#">
<oslc_am:Resource>
<!--Required Properties-->
<dcterms:title>NAME</dcterms:title>
<dcterms:type>ENTERPRISE ARCHITECT TYPE</dcterms:type>
<ss:parentresourceidentifier>GUID OF CONTAINING PACKAGE/ELEMENT WITH GUID PREFIX</ss:parentresourceidentifier>
<!--Required in a Security Enabled Model-->
<ss:useridentifier>USER AUTHENTICATION TOKEN</ss:useridentifier>
<!--Optional Properties-->
<dcterms:subject>KEYWORDS</dcterms:subject>
<dcterms:creator>
<foaf:Person>
<foaf:name>AUTHOR</foaf:name>
</foaf:Person>
</dcterms:creator>
<dcterms:description>NOTES</dcterms:description>
<ss:alias>ALIAS</ss:alias>
<ss:status>STATUS</ss:status>
<ss:complexity>COMPLEXITY</ss:complexity>
<ss:stereotype>
<ss:stereotypename>
<ss:name>STEREOTYPE</ss:name>
</ss:stereotypename>
</ss:stereotype>
<ss:phase>PHASE</ss:phase>
<ss:version>VERSION</ss:version>
<ss:difficulty>DIFFICULTY</ss:difficulty>
<ss:priority>PRIORITY</ss:priority>
<ss:language>LANGUAGE</ss:language>
</oslc_am:Resource>
</rdf:RDF>
-
How to make a HTTP POST request will depend on the language you are writing in.
But you could equally use EA's API directly to create the objects or use the Data Miner in EA 15 to make it easier. (There's an example data miner script that imports from excel in the example model)
-
Thanks. Can we automate that import using data miner feature? Can i schedule it to run?