Guest User

Untitled

a guest
Sep 12th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EA;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             EA.Repository repo = new EA.Repository();
  14.  
  15.             /////////////////////
  16.             // PARAMETERS
  17.             String conn = "THE SQL CONNECTION STRING";
  18.             String output_directory = "D:\\webdata\\local\\ea_dump\\";
  19.             String username = "XXXXXXXXX";
  20.             String password = "XXXXXXXXX";
  21.  
  22.             string[][] package_array = {
  23.  
  24.                                            new string[] { "{6E43E860-99B4-4ae2-A136-D439CE307018}", output_directory + "xmi\\" + "model_definitions.xmi" },
  25.                                            new string[] { "{DBD75F47-876F-414a-A483-F0FDA3EDBF36}", output_directory + "xmi\\" + "support_objects.xmi" },
  26.                                            new string[] { "{2AC2C577-3335-4e14-AE11-0C7367F655EA}", output_directory + "xmi\\" + "integration_framework.xmi" },
  27.                                            new string[] { "{49A617D4-FCA9-46f9-80E0-C89E51B097C2}", output_directory + "xmi\\" + "industry_groups.xmi" },
  28.                                            new string[] { "{F2AC3741-FE6D-469b-9C09-A20FD8FCAC64}", output_directory + "xmi\\" + "mining_objects.xmi" },
  29.                                            new string[] { "{7AA5ABE0-7AE2-4b26-AFF1-526C4729EBBD}", output_directory + "xmi\\" + "sites_aa_group.xmi" }
  30.                                        };
  31.  
  32.             string[][] package_array_XX = {
  33.                                             new string[] { "{6BB0E562-35AD-4e80-816F-20C13244E79A}", output_directory + "aaiok2\\xmi\\" + "sites_Q.xmi" } ,
  34.                                            
  35.                                             new string[] { "{59981F1A-E998-4c84-AED9-B49BDF3DFADB}", output_directory + "aaiok2\\xmi\\" + "oem_A.xmi" } ,
  36.                                             new string[] { "{F5DEC320-1640-47ec-87E8-1A36BA79925C}", output_directory + "aaiok2\\xmi\\" + "oem_B.xmi" } ,
  37.                                             new string[] { "{C5835AF6-72BE-407f-8FF5-0778C0876D5F}", output_directory + "aaiok2\\xmi\\" + "oem_C.xmi" } ,
  38.                                             new string[] { "{D845A809-3E82-4fb6-968A-C5E0F2F55DF1}", output_directory + "aaiok2\\xmi\\" + "oem_D.xmi" } ,
  39.                                            
  40.                                             new string[] { "{3951E1EF-B78A-466e-B2A7-CA5C3F041B52}", output_directory + "aaiok2\\xmi\\" + "otm_E.xmi" } ,
  41.                                             new string[] { "{073029B0-85ED-4bb8-BA48-0C69390BC603}", output_directory + "aaiok2\\xmi\\" + "otm_F.xmi" } ,
  42.                                             new string[] { "{49B8714A-54F6-4e18-92B5-9C7019C4FDF4}", output_directory + "aaiok2\\xmi\\" + "otm_G.xmi" }
  43.                                        };
  44.  
  45.  
  46.             /////////////////////
  47.             //Transfer DBMS to EAP
  48.             String eapfile_full = output_directory + "model2.eap";
  49.             String eaplog_full = output_directory + "transfer.log";
  50.  
  51.             repo.OpenFile2(conn, username, password);
  52.  
  53.             repo.GetProjectInterface().ProjectTransfer(conn, eapfile_full, eaplog_full);
  54.  
  55.             repo.CloseFile();
  56.  
  57. /////////////////////////////////////////////////////////////////////////////////////////////////////////////            
  58.  
  59.             /////////////////////
  60.             // Export XMI
  61.             repo.OpenFile2(eapfile_full, username, password);
  62.  
  63.             foreach (string[] pck in package_array)
  64.             {
  65.                 repo.GetProjectInterface().ExportPackageXMI(pck[0], 0, 1, -1, 0, 0, pck[1]);
  66.             }
  67.  
  68.             //export XMIs
  69.             foreach (string[] pck in package_array_XX)
  70.             {
  71.                 repo.GetProjectInterface().ExportPackageXMI(pck[0], 0, 1, -1, 0, 0, pck[1]);
  72.             }
  73.  
  74.             repo.CloseFile();
  75.  
  76. /////////////////////////////////////////////////////////////////////////////////////////////////////////////            
  77.  
  78.             /////////////////////
  79.             // Import XMI
  80.             String project1 = "XX";
  81.             String project_directory1 = output_directory + project1 + "\\";
  82.             String eapfile1 = output_directory + project1 + ".eap";
  83.  
  84.             repo.OpenFile2(eapfile1, username, password);
  85.  
  86.             foreach (string[] pck in package_array)
  87.             {
  88.                 repo.GetProjectInterface().ImportPackageXMI(pck[0], pck[1], 1, 0);
  89.             }
  90.  
  91.             foreach (string[] pck in package_array_aaiok)
  92.             {
  93.                 repo.GetProjectInterface().ImportPackageXMI(pck[0], pck[1], 1, 0);
  94.             }
  95.  
  96.             /////////////////////
  97.             // Generate HTML Documentation
  98.             repo.GetProjectInterface().RunHTMLReport("{180F65F8-18A6-4237-BE8C-77C7E7FD02EC}", project_directory1, "PNG", "Feedback", ".htm");
  99.             //ROOT PACAKGE GUID FOR SUBMODELS USED
  100.  
  101.             repo.CloseFile();
  102.          
  103.         }
  104.     }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment