provenanceRegistry.updateWorkflowInstanceStatus(status);
}else {
if (!isWorkflowInstanceExists(status.getWorkflowInstance().getWorkflowExecutionId(), true)){
throw new WorkflowInstanceDoesNotExistsException(status.getWorkflowInstance().getWorkflowExecutionId());
}
WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(status.getWorkflowInstance().getWorkflowExecutionId());
Timestamp currentTime = new Timestamp(status.getStatusUpdateTime().getTime());
if(status.getExecutionStatus() != null){
wi.setStatus(status.getExecutionStatus().toString());
}
if (status.getExecutionStatus()==State.STARTED){
wi.setStartTime(currentTime);
}
wi.setLastUpdatedTime(currentTime);
wi.save();
}
}