executeAction( "store-project", context );
try
{
BuildDefinitionTemplate bdt;
if ( executorId.equalsIgnoreCase( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR ) )
{
if ( buildDefinitionTemplateId <= 0 )
{
bdt = buildDefinitionService.getDefaultAntBuildDefinitionTemplate();
}
else
{
bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId );
}
}
else
{
//shell default
if ( buildDefinitionTemplateId <= 0 )
{
bdt = buildDefinitionService.getDefaultShellBuildDefinitionTemplate();
}
else
{
bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId );
}
}
buildDefinitionService.addTemplateInProject( bdt.getId(), getProject(
AbstractContinuumAction.getProjectId( context ) ) );
}
catch ( BuildDefinitionServiceException e )
{
throw new ContinuumException( e.getMessage(), e );