Subversion Repositories DevTools

Rev

Rev 2141 | Rev 2147 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2141 Rev 2145
Line 27... Line 27...
27
      /// Method to parse a ReqPro database using the information in a ReqProDB artifact,
27
      /// Method to parse a ReqPro database using the information in a ReqProDB artifact,
28
      /// assumed to be selected in EA's project browser prior to the method call.
28
      /// assumed to be selected in EA's project browser prior to the method call.
29
      /// </summary>
29
      /// </summary>
30
      /// <param name="ea_repository"></param>
30
      /// <param name="ea_repository"></param>
31
      /// <returns></returns>
31
      /// <returns></returns>
32
      public override bool parse(EA.Repository ea_repository)
32
      public override bool prompt_and_parse(EA.Repository ea_repository, ReqProDB_Artifact.MODE mode)
33
      {
33
      {
34
         try
34
         try
35
         {
35
         {
36
            if (true == base.parse(ea_repository))
36
            if (true == base.prompt_and_parse(ea_repository, mode))
37
            {
37
            {
38
               ea_repository.EnsureOutputVisible(Main.GUI_OUTPUT_TAB_NAME);
38
               ea_repository.EnsureOutputVisible(Main.GUI_OUTPUT_TAB_NAME);
39
               ImportFromReqPro(ea_repository);
39
               ImportFromReqPro(ea_repository);
-
 
40
 
-
 
41
               // Configure the ReqProDB artifact as a traceability artifact
-
 
42
               RQ_Artifact.set_traceability_mode(ea_repository, RQ_Element);
-
 
43
 
40
               return true;
44
               return true;
41
            }
45
            }
42
         }
46
         }
43
         catch (Exception ex)
47
         catch (Exception ex)
44
         {
48
         {
Line 185... Line 189...
185
      /// <param name="repository"></param>
189
      /// <param name="repository"></param>
186
      private void ImportFromReqPro(EA.Repository ea_repository)
190
      private void ImportFromReqPro(EA.Repository ea_repository)
187
      {
191
      {
188
         try
192
         try
189
         {
193
         {
190
            // Create a ReqProDB_Artifact object and obtain the EA ReqProDB element from it.
-
 
191
            ReqProDB_Artifact RQ_Artifact = new ReqProDB_Artifact();
-
 
192
            EA.Element ea_rq_artifact = RQ_Artifact.get_rq_artifact(ea_repository);
-
 
193
 
-
 
194
            //IFormatProvider cultureInfo = new CultureInfo("en-US", true);
194
            //IFormatProvider cultureInfo = new CultureInfo("en-US", true);
195
 
195
 
196
            string importDateTime = System.TimeZone.CurrentTimeZone.ToUniversalTime( System.DateTime.Now ).ToString();
196
            string importDateTime = System.TimeZone.CurrentTimeZone.ToUniversalTime( System.DateTime.Now ).ToString();
197
 
197
 
198
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EA Requirement import at " + importDateTime, -1 );
198
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EA Requirement import at " + importDateTime, -1 );
199
 
199
 
200
            // Update the ReqProDB stereotypes element with all the EA requirements in the package
200
            // Update the ReqProDB stereotypes element with all the EA requirements in the package
201
            RQ_Artifact.UpdatePackageToReqProDatabaseAssociation(ea_repository, ea_rq_artifact);
201
            base.RQ_Artifact.UpdatePackageToReqProDatabaseAssociation(ea_repository, base.RQ_Element);
202
 
202
 
203
            // Get a list of EA requirements and their associated ReqPro GUIDs
203
            // Get a list of EA requirements and their associated ReqPro GUIDs
204
            ArrayList ea_reqs = new ArrayList();
204
            ArrayList ea_reqs = new ArrayList();
205
            ArrayList ea_GUIDs = new ArrayList();
205
            ArrayList ea_GUIDs = new ArrayList();
206
            ArrayList ea_req_matched = new ArrayList();
206
            ArrayList ea_req_matched = new ArrayList();
207
            foreach (EA.Connector connector in ea_rq_artifact.Connectors)
207
            foreach (EA.Connector connector in base.RQ_Element.Connectors)
208
            {
208
            {
209
               EA.Element ea_req = ea_repository.GetElementByID( connector.SupplierID );
209
               EA.Element ea_req = ea_repository.GetElementByID( connector.SupplierID );
210
               if (ea_req != null)
210
               if (ea_req != null)
211
               {
211
               {
212
                  ea_reqs.Add(ea_req);
212
                  ea_reqs.Add(ea_req);
Line 216... Line 216...
216
               }
216
               }
217
            }
217
            }
218
 
218
 
219
            // Obtain the EA parent package so that we can create under it an import package
219
            // Obtain the EA parent package so that we can create under it an import package
220
            // if need be.
220
            // if need be.
221
            EA.Package parentPackage = ea_repository.GetPackageByID( ea_rq_artifact.PackageID );
221
            EA.Package parentPackage = ea_repository.GetPackageByID( base.RQ_Element.PackageID );
222
 
222
 
223
            EA.Package importPackage = (EA.Package )parentPackage.Packages.AddNew( "import " + importDateTime, "Package");
223
            EA.Package importPackage = (EA.Package )parentPackage.Packages.AddNew( "import " + importDateTime, "Package");
224
            importPackage.Update();
224
            importPackage.Update();
225
 
225
 
226
            EA.Element changeLog = (EA.Element)importPackage.Elements.AddNew("Change Log","InformationItem");
226
            EA.Element changeLog = (EA.Element)importPackage.Elements.AddNew("Change Log","InformationItem");
Line 252... Line 252...
252
 
252
 
253
                     EA.Element ea_req = ((EA.Element)ea_reqs[i_ea_req]);
253
                     EA.Element ea_req = ((EA.Element)ea_reqs[i_ea_req]);
254
 
254
 
255
                     // This ReqPro requirement already has a counterpart in EA, so we must simply
255
                     // This ReqPro requirement already has a counterpart in EA, so we must simply
256
                     // update the counterpart. But, to aid the designer, we need to try to tell them
256
                     // update the counterpart. But, to aid the designer, we need to try to tell them
257
                     // if the requirement text has changed, which could ofcoarse change the meaning 
257
                     // how the requirement has changed, which could ofcoarse change the meaning 
258
                     // of the requirement.
258
                     // of the requirement and require design changes to be done.
259
 
259
 
260
                     bool meaningMayHaveChanged = false;
260
                     bool meaningMayHaveChanged = false;
261
                     bool statusMayHaveChanged = false;
261
                     bool statusMayHaveChanged = false;
262
                     
262
                     
263
                     string ea_req_name = rq_obj.tag + " " + rq_obj.name;
263
                     string ea_req_name = rq_obj.tag + " " + rq_obj.name;
Line 337... Line 337...
337
                     EA_Utils.WriteTag(ea_req, "GUID", rq_obj.guid);
337
                     EA_Utils.WriteTag(ea_req, "GUID", rq_obj.guid);
338
                     EA_Utils.WriteTag(ea_req, "TAG", rq_obj.tag);
338
                     EA_Utils.WriteTag(ea_req, "TAG", rq_obj.tag);
339
                     ea_req.Update();
339
                     ea_req.Update();
340
 
340
 
341
                     // Connect the new requirement to the ea_rq_artifact
341
                     // Connect the new requirement to the ea_rq_artifact
342
                     RQ_Artifact.add_connection(ea_repository, ea_rq_artifact, ea_req);
342
                     base.RQ_Artifact.add_connection(ea_repository, base.RQ_Element, ea_req);
343
 
343
 
344
                     changeLog.Notes += ea_req.ElementGUID + ":Created:" + ea_req.Name + "\r\n";
344
                     changeLog.Notes += ea_req.ElementGUID + ":Created:" + ea_req.Name + "\r\n";
345
                     changeLog.Update();
345
                     changeLog.Update();
346
                  }
346
                  }
347
                  
347
                  
Line 373... Line 373...
373
 
373
 
374
            displayChangeLog(ea_repository, changeLog);
374
            displayChangeLog(ea_repository, changeLog);
375
 
375
 
376
            ea_repository.RefreshModelView(parentPackage.PackageID);
376
            ea_repository.RefreshModelView(parentPackage.PackageID);
377
 
377
 
-
 
378
            // display summary stats
378
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, newRequirementCount.ToString() + " new requirements", -1);
379
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, newRequirementCount.ToString() + " new requirements", -1);
379
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, modifiedRequirementCount.ToString() + " requirements modified", -1);
380
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, modifiedRequirementCount.ToString() + " requirements modified", -1);
380
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, statusUpdatedRequirementCount.ToString() + " requirements had status changes", -1);
381
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, statusUpdatedRequirementCount.ToString() + " requirements had status changes", -1);
381
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, orphanedCount.ToString() + " requirements were orphaned", -1);
382
            ea_repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, orphanedCount.ToString() + " requirements were orphaned", -1);
382
 
383