Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to update RTC build engine status from inside a running java build process

Our team intends to invoke a java build process from ANT via the RTC build engine.  We would like to be able to update the status of the build with a very granular detailed status throughout the course of the build process.
To do this I have attempted to use the teamBuildClient.startBuildActivity to substitute for the ANT task "startBuildActivity".  A code snippit appears below.  It compiles properly however I have several questions.

The two lines below are not complete because I don't know how to get the values =>

IProgressMonitor progressMonitor = null;//***Don't know how to get this ***
final String parentId = null;//***Don't know how to get this ***


Please let me know if I am on the right track with this code. 
Also please provide a link to some source example to help me with this.

Thanks

Here is the code:

   private void myTest( String[] args )
   {
      buildResultUUID = args[3];// ***BDE
      System.out.println( "buildResultUUID=" + buildResultUUID );

      repositoryAddress = args[4];// ***BDE
      System.out.println( "repositoryAddress=" + repositoryAddress );

      userId = args[5];// ***BDE
      System.out.println( "userId=" + userId );

      passwordFile = args[6];// ***BDE
      System.out.println( "passwordFile=" + passwordFile );

      final boolean autoComplete = Boolean.parseBoolean( args[7] );// ***BDE
      System.out.println( "autocomplete=" + autocomplete );

      IClientLibraryContext iClientLibraryContext = null;

      TeamBuildClient teamBuildClient = new TeamBuildClient( iClientLibraryContext );

      IBuildResultHandle buildResultHandle = (IBuildResultHandle)IBuildResult.ITEM_TYPE.createItemHandle(
            com.ibm.team.repository.common.UUID.valueOf( buildResultUUID ), null );

      final String label = "This is a status message";

      IProgressMonitor progressMonitor = null;//***Don't know how to get this ***

      final String parentId = null;//***Don't know how to get this ***

      try
      {
         String out = teamBuildClient.startBuildActivity( buildResultHandle, label, parentId, autoComplete,
               progressMonitor );
        
         System.out.println("Output="+out);
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
  }

0 votes



One answer

Permanent link
You shouldn't need to worry about the progress monitor; at worst you can use NullProgressMonitor if necessary.

Each activity has an ID; I don't know this particular API but I assume that the return value of teamBuildClient.startBuildActivity is the ID of the activity that was started. Activities can be subordinate to a parent (renders as nested activities in the UI), so if you want one activity to appear nested within another you need to supply the parent. It should be optional.

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 562
× 169

Question asked: Dec 03 '13, 12:06 p.m.

Question was seen: 5,521 times

Last updated: Dec 16 '13, 11:32 a.m.

Confirmation Cancel Confirm