Welcome to the Jazz Community Forum
How to access RTC build engine status programmatically.

2 answers

There are Ant tasks available in the build toolkit that allow you to contribute to a build result's progress. You can read about them in the current release's docs under development here, https://jazz.net/help-dev/clm/topic/com.ibm.team.build.doc/topics/r_enableprogressmonitor.html. Or you can find the equivalent doc in your release's docs. Also, notice the other Ant tasks available in that context.
Scott
Comments

The available methods are limited to startBuildActivity and
completeBuildActivity. These seem to provide only two states. Our intent is to provide a more granular update of the status so the user can see the detailed progress of builds through multiple phases. Is the usage of the startBuildActivity
intended to be called for multiple status updates during the build?

You can create child activities to break down the progress of a parent activity, but unlike IProgressMonitor, you cannot divide an activity into units and update the number of completed units.

To be more clear. The update methods available are both ANT tasks. We are using ANT to execute our external Java code to perform a build. We would like to be able to send status updates from our Java build processes that would be sent to the user viewable panel on the RTC client.

I couldn't fit this all in a comment to the answer above, so I've created another answer. Here's an example I whipped up based on the example at startBuildActivity and Integrating with Jazz SCM and Builds from Hudson and Jenkins . You can see what the progress looks like in the Builds view below.
It looks like,

where build.xml contains,
<project name="sample" default="compile"> <property name="userId" value="ADMIN" /> <property name="password" value="ADMIN" /> <taskdef name="startBuildActivity" classname="com.ibm.team.build.ant.task.StartBuildActivityTask" /> <taskdef name="completeBuildActivity" classname="com.ibm.team.build.ant.task.CompleteBuildActivityTask" /> <taskdef resource="net/sf/antcontrib/antlib.xml" /> <target name="compile"> <echo message="Compiling parent"/> <startBuildActivity label="Compiling parent" activityIdProperty="parentId" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> <sleep milliseconds="1000"/> <for list="1,2,3,4,5,6,7,8,9,10" param="num" delimiter=","> <sequential> <echo message="Compiling child @{num}"/> <startBuildActivity label="Compiling child @{num}" parentActivityId="${parentId}" autocomplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> <sleep milliseconds="1000"/> </sequential> </for> <completeBuildActivity activityId="${parentId}" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" /> </target> </project>
Comments

We are calling a custom java build process from ANT we need to be able to send back status from within our java code to provide a more detailed status to our users.
It looks like we should be able to instantiate a TeamBuildClient object and then call it's
startBuildActivity method.
The parameters are as follows =>
public String startBuildActivity(final IBuildResultHandle buildResultHandle, final String label,
final String parentId, final boolean autoComplete, IProgressMonitor progressMonitor)
I think the parm info is available to me from the Ant env except "parentId". I'm not sure where to get that.
I'm I headed in the right direction here or is there some reason this will not work?
Thanks