private void validateActionAtEnd(Artifact actionArt) throws OseeCoreException {
    resultData.log("\nValidating End...");
    // Ensure event service is connected
    if (!OseeEventManager.isEventManagerConnected()) {
      resultData.logError("Remote Event Service is not connected");
      return;
    }
    resultData.log("Remote Event Service connected");

    // Validate values
    TeamWorkFlowArtifact teamArt = ActionManager.getFirstTeam(actionArt);
    testEquals(
        "Description",
        "description 4",
        teamArt.getSoleAttributeValue(AtsAttributeTypes.Description, null));
    testEquals("Change Type", ChangeType.Support, ChangeTypeUtil.getChangeType(teamArt));
    testEquals(
        "Priority", "3", teamArt.getSoleAttributeValue(AtsAttributeTypes.PriorityType, null));
    testEquals(
        "Validation Required",
        "false",
        String.valueOf(teamArt.getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, null)));

    IAtsVersion verArt = AtsVersionService.get().getTargetedVersion(teamArt);
    String expectedTargetedVersion;
    if (verArt != null) {
      expectedTargetedVersion = verArt.toString();
    } else {
      expectedTargetedVersion = "not set";
    }
    testEquals("Targeted Version", expectedTargetedVersion, "2.5.7");
    testEquals("State", TeamState.Analyze.getName(), teamArt.getStateMgr().getCurrentStateName());
  }
예제 #2
0
 @Override
 public void init(IPageSite site) {
   super.init(site);
   setID(VIEW_ID);
   OseeStatusContributionItemFactory.addTo(getSite(), false);
   getSite().getActionBars().updateActionBars();
   OseeEventManager.addListener(this);
 }
예제 #3
0
  @Override
  public Collection<IAtsTask> createTasks(NewTaskData newTaskData) {
    AtsTaskEndpointApi taskEp = AtsClientService.getTaskEp();
    Response response = taskEp.create(newTaskData);

    Artifact teamWf = atsClient.getArtifact(newTaskData.getTeamWfUuid());

    JaxAtsTasks jaxTasks = response.readEntity(JaxAtsTasks.class);
    ArtifactEvent artifactEvent = new ArtifactEvent(AtsUtilCore.getAtsBranch());
    List<Long> artUuids = new LinkedList<>();
    for (JaxAtsTask task : jaxTasks.getTasks()) {
      String guid = ArtifactQuery.getGuidFromUuid(task.getUuid(), AtsUtilCore.getAtsBranch());
      artifactEvent
          .getArtifacts()
          .add(
              new EventBasicGuidArtifact(
                  EventModType.Added,
                  AtsUtilCore.getAtsBranch().getUuid(),
                  AtsArtifactTypes.Task.getGuid(),
                  guid));
      artUuids.add(task.getUuid());

      RelationLink relation = getRelation(teamWf, task);
      Artifact taskArt = atsClient.getArtifact(task.getUuid());

      DefaultBasicUuidRelation guidRelation =
          new DefaultBasicUuidRelation(
              AtsUtilCore.getAtsBranch().getUuid(),
              AtsRelationTypes.TeamWfToTask_Task.getGuid(),
              relation.getId(),
              relation.getGammaId(),
              getBasicGuidArtifact(teamWf),
              getBasicGuidArtifact(taskArt));

      artifactEvent
          .getRelations()
          .add(
              new EventBasicGuidRelation(
                  RelationEventType.Added,
                  newTaskData.getTeamWfUuid().intValue(),
                  new Long(task.getUuid()).intValue(),
                  guidRelation));
    }

    OseeEventManager.kickPersistEvent(getClass(), artifactEvent);

    List<IAtsTask> tasks = new LinkedList<>();
    for (Long uuid : artUuids) {
      tasks.add(
          AtsClientService.get()
              .getWorkItemFactory()
              .getTask(AtsClientService.get().getArtifact(uuid)));
    }
    return tasks;
  }
  private void createControl(Composite parent) {
    GridLayout gL = new GridLayout();
    gL.marginWidth = 0;
    gL.marginHeight = 0;
    parent.setLayout(gL);
    parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    group = new Group(parent, SWT.NONE);
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    stackedLayout = new StackLayout();
    group.setLayout(stackedLayout);
    group.setText(GROUP_TEXT);

    createStatusBar(group);
    createSelectableArea(group);
    handleBranchSelectEnabled(false);
    OseeEventManager.addListener(this);
  }
  private void validateActionAtStart(Artifact actionArt) throws OseeCoreException {
    resultData.log("\nValidating Start...");
    // Ensure event service is connected
    if (!OseeEventManager.isEventManagerConnected()) {
      resultData.logError("Remote Event Service is not connected");
      return;
    }
    resultData.log("Remote Event Service connected");

    // Validate values
    TeamWorkFlowArtifact teamArt = ActionManager.getFirstTeam(actionArt);
    testEquals(
        "Description",
        "description",
        teamArt.getSoleAttributeValue(AtsAttributeTypes.Description, null));
    testEquals("Change Type", ChangeType.Improvement, ChangeTypeUtil.getChangeType(teamArt));
    testEquals(
        "Priority", "1", teamArt.getSoleAttributeValue(AtsAttributeTypes.PriorityType, null));
  }
 @Override
 public void dispose() {
   OseeEventManager.removeListener(this);
   super.dispose();
 }