@Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS)
@Produces(MediaType.TEXT_PLAIN)
public Response updateWorkflowInstanceStatus(@FormParam("workflowInstanceId") String workflowInstanceId,
@FormParam("executionStatus") String executionStatus,
@FormParam("statusUpdateTime") String statusUpdateTime) {
AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date formattedDate = dateFormat.parse(statusUpdateTime);
WorkflowExecutionStatus.State status = WorkflowExecutionStatus.State.valueOf(executionStatus);
WorkflowExecutionStatus workflowInstanceStatus = new WorkflowExecutionStatus(workflowInstanceId, workflowInstanceId);
workflowInstanceStatus.setExecutionStatus(status);
workflowInstanceStatus.setStatusUpdateTime(formattedDate);
airavataRegistry.updateWorkflowInstanceStatus(workflowInstanceStatus);
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity("Workflow instance status updated successfully...");
return builder.build();
} catch (ParseException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);