{
for ( int i = 0; i < projectsId.length; i++ )
{
getContinuum().getDistributedBuildManager().cancelBuild( projectsId[i] );
AuditLog event = new AuditLog( "Project id=" + projectsId[i], AuditLogConstants.CANCEL_BUILD );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
}
}
else
{
BuildsManager parallelBuildsManager = getContinuum().getBuildsManager();
parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );
try
{
// now we must check if the current build is one of this
int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
if ( index > 0 )
{
int projId = projectsId[index];
getContinuum().getBuildsManager().cancelBuild( projId );
AuditLog event = new AuditLog( "Project id=" + projId, AuditLogConstants.CANCEL_BUILD );
event.setCategory( AuditLogConstants.PROJECT );
event.setCurrentUser( getPrincipal() );
event.log();
}
}
catch ( BuildManagerException e )
{