Example #1
0
  @Override
  protected void doWork(IProgressMonitor monitor) throws Exception {
    data.validate();
    data.getResultData().log(getName() + "\n");
    monitor.worked(calculateWork(0.20));

    try {
      AtsChangeSet changes = new AtsChangeSet(getName());

      // Import Work Definition sheets
      data.getResultData().log("Importing Work Definitions");
      Artifact folder = getWorkDefinitionFolder();
      Set<String> stateNames = new HashSet<String>();
      AtsWorkDefinitionSheetProviders.importWorkDefinitionSheets(
          data.getResultData(), changes, folder, data.getWorkDefSheets(), stateNames);

      monitor.worked(calculateWork(0.30));
      data.getResultData().log("Importing Work Definitions...Complete");

      // Import AI and Team sheets
      data.getResultData().log("Importing AIs and Teams");
      for (WorkDefinitionSheet sheet : data.getTeamsAiSheets()) {
        AtsWorkDefinitionSheetProviders.importAIsAndTeamsToDb(sheet, changes);
      }
      monitor.worked(calculateWork(0.40));

      // Perform specialized configuration code (eg set extra attributes, create branches, etc)
      data.performPostConfig(changes, data);

      if (data.getResultData().isErrors()) {
        String errorStr = "Errors found, not persisting.  May need to restart your OSEE";
        data.getResultData().log(errorStr);
        AWorkbench.popup(errorStr);
      } else {
        changes.execute();
      }
    } catch (Exception ex) {
      data.getResultData().logError("Exception " + ex.getLocalizedMessage());
    }
    XResultDataUI.report(data.getResultData(), getName());
    monitor.worked(calculateWork(0.10));
  }
Example #2
0
 public AtsConfig2Operation(AbstractAtsConfig2Data data) {
   super("Configure Ats for " + data.getConfigName(), Activator.PLUGIN_ID);
   this.data = data;
 }