Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EA;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- EA.Repository repo = new EA.Repository();
- /////////////////////
- // PARAMETERS
- String conn = "THE SQL CONNECTION STRING";
- String output_directory = "D:\\webdata\\local\\ea_dump\\";
- String username = "XXXXXXXXX";
- String password = "XXXXXXXXX";
- string[][] package_array = {
- new string[] { "{6E43E860-99B4-4ae2-A136-D439CE307018}", output_directory + "xmi\\" + "model_definitions.xmi" },
- new string[] { "{DBD75F47-876F-414a-A483-F0FDA3EDBF36}", output_directory + "xmi\\" + "support_objects.xmi" },
- new string[] { "{2AC2C577-3335-4e14-AE11-0C7367F655EA}", output_directory + "xmi\\" + "integration_framework.xmi" },
- new string[] { "{49A617D4-FCA9-46f9-80E0-C89E51B097C2}", output_directory + "xmi\\" + "industry_groups.xmi" },
- new string[] { "{F2AC3741-FE6D-469b-9C09-A20FD8FCAC64}", output_directory + "xmi\\" + "mining_objects.xmi" },
- new string[] { "{7AA5ABE0-7AE2-4b26-AFF1-526C4729EBBD}", output_directory + "xmi\\" + "sites_aa_group.xmi" }
- };
- string[][] package_array_XX = {
- new string[] { "{6BB0E562-35AD-4e80-816F-20C13244E79A}", output_directory + "aaiok2\\xmi\\" + "sites_Q.xmi" } ,
- new string[] { "{59981F1A-E998-4c84-AED9-B49BDF3DFADB}", output_directory + "aaiok2\\xmi\\" + "oem_A.xmi" } ,
- new string[] { "{F5DEC320-1640-47ec-87E8-1A36BA79925C}", output_directory + "aaiok2\\xmi\\" + "oem_B.xmi" } ,
- new string[] { "{C5835AF6-72BE-407f-8FF5-0778C0876D5F}", output_directory + "aaiok2\\xmi\\" + "oem_C.xmi" } ,
- new string[] { "{D845A809-3E82-4fb6-968A-C5E0F2F55DF1}", output_directory + "aaiok2\\xmi\\" + "oem_D.xmi" } ,
- new string[] { "{3951E1EF-B78A-466e-B2A7-CA5C3F041B52}", output_directory + "aaiok2\\xmi\\" + "otm_E.xmi" } ,
- new string[] { "{073029B0-85ED-4bb8-BA48-0C69390BC603}", output_directory + "aaiok2\\xmi\\" + "otm_F.xmi" } ,
- new string[] { "{49B8714A-54F6-4e18-92B5-9C7019C4FDF4}", output_directory + "aaiok2\\xmi\\" + "otm_G.xmi" }
- };
- /////////////////////
- //Transfer DBMS to EAP
- String eapfile_full = output_directory + "model2.eap";
- String eaplog_full = output_directory + "transfer.log";
- repo.OpenFile2(conn, username, password);
- repo.GetProjectInterface().ProjectTransfer(conn, eapfile_full, eaplog_full);
- repo.CloseFile();
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////
- // Export XMI
- repo.OpenFile2(eapfile_full, username, password);
- foreach (string[] pck in package_array)
- {
- repo.GetProjectInterface().ExportPackageXMI(pck[0], 0, 1, -1, 0, 0, pck[1]);
- }
- //export XMIs
- foreach (string[] pck in package_array_XX)
- {
- repo.GetProjectInterface().ExportPackageXMI(pck[0], 0, 1, -1, 0, 0, pck[1]);
- }
- repo.CloseFile();
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////////////////////
- // Import XMI
- String project1 = "XX";
- String project_directory1 = output_directory + project1 + "\\";
- String eapfile1 = output_directory + project1 + ".eap";
- repo.OpenFile2(eapfile1, username, password);
- foreach (string[] pck in package_array)
- {
- repo.GetProjectInterface().ImportPackageXMI(pck[0], pck[1], 1, 0);
- }
- foreach (string[] pck in package_array_aaiok)
- {
- repo.GetProjectInterface().ImportPackageXMI(pck[0], pck[1], 1, 0);
- }
- /////////////////////
- // Generate HTML Documentation
- repo.GetProjectInterface().RunHTMLReport("{180F65F8-18A6-4237-BE8C-77C7E7FD02EC}", project_directory1, "PNG", "Feedback", ".htm");
- //ROOT PACAKGE GUID FOR SUBMODELS USED
- repo.CloseFile();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment