use of org.jboss.pnc.model.DeliverableAnalyzerOperation in project pnc by project-ncl.
the class OperationsManagerImpl method newDeliverableAnalyzerOperation.
@Override
public DeliverableAnalyzerOperation newDeliverableAnalyzerOperation(String milestoneId, Map<String, String> inputParams) {
ProductMilestone milestone = productMilestoneRepository.queryById(ProductMilestoneMapper.idMapper.toEntity(milestoneId));
if (milestone == null) {
throw new EmptyEntityException("Milestone with id " + milestoneId + " doesn't exist");
}
String operationId = Sequence.nextBase32Id();
MDCUtils.addProcessContext(operationId);
org.jboss.pnc.model.DeliverableAnalyzerOperation operation = org.jboss.pnc.model.DeliverableAnalyzerOperation.Builder.newBuilder().progressStatus(ProgressStatus.NEW).submitTime(Date.from(Instant.now())).productMilestone(milestone).operationParameters(inputParams).user(userService.currentUser()).id(operationId).build();
repository.save(operation);
analysisStatusChangedEventNotifier.fire(new OperationChangedEvent(operation, null));
return operation;
}
Aggregations