use of com.emc.sa.workflow.ValidationHelper in project coprhd-controller by CoprHD.
the class CustomServicesWorkflowService method validateWorkflow.
@POST
@CheckPermission(roles = { Role.SYSTEM_ADMIN })
@Path("/{id}/validate")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public CustomServicesValidationResponse validateWorkflow(@PathParam("id") final URI id) {
try {
final CustomServicesWorkflowDocument wfDocument = WorkflowHelper.toWorkflowDocument(getCustomServicesWorkflow(id));
final ValidationHelper customServicesValidationHelper = new ValidationHelper(wfDocument);
final CustomServicesValidationResponse validationResponse = customServicesValidationHelper.validate(id, client);
// update the status of workflow VALID / INVALID in the DB
final CustomServicesWorkflow wfstatusUpdated = WorkflowHelper.updateState(getCustomServicesWorkflow(id), validationResponse.getStatus());
customServicesWorkflowManager.save(wfstatusUpdated);
return validationResponse;
} catch (final IOException e) {
throw APIException.internalServerErrors.genericApisvcError("Failed to deserialize workflow document", e);
}
}
Aggregations