int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( result );
Project project = projectDao.getProjectWithAllDetails( projectId );
BuildDefinition buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
BuildResult oldBuildResult =
buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId );
BuildResult buildResult = distributedBuildUtil.convertMapToBuildResult( result );
buildResult.setBuildDefinition( buildDefinition );
buildResult.setBuildNumber( project.getBuildNumber() + 1 );
buildResult.setModifiedDependencies( distributedBuildUtil.getModifiedDependencies( oldBuildResult, result ) );
buildResult.setScmResult( distributedBuildUtil.getScmResult( result ) );
String buildOutput = ContinuumBuildConstant.getBuildOutput( result );
map.put( ContinuumBuildConstant.KEY_BUILD_RESULT, buildResult );
map.put( ContinuumBuildConstant.KEY_BUILD_OUTPUT, buildOutput );