public WorkflowInstanceStatus getWorkflowExecutionStatus(String experimentId)throws RegistryException{
if (getProvenanceRegistry()!=null){
return getProvenanceRegistry().getWorkflowExecutionStatus(experimentId);
}
Session session = null;
WorkflowInstanceStatus property = null;
try {
session = getSession();
Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
ExecutionStatus status = null;
if (workflowDataNode.hasProperty(WORKFLOW_STATUS_PROPERTY)) {
status = ExecutionStatus.valueOf(workflowDataNode.getProperty(
WORKFLOW_STATUS_PROPERTY).getString());
}
Date date = null;
if (workflowDataNode.hasProperty(WORKFLOW_STATUS_TIME_PROPERTY)) {
Property prop = workflowDataNode
.getProperty(WORKFLOW_STATUS_TIME_PROPERTY);
date = null;
if (prop != null) {
Long dateMiliseconds = prop.getLong();
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(dateMiliseconds);
date = cal.getTime();
}
}
property=new WorkflowInstanceStatus(new WorkflowInstance(experimentId,experimentId),status, date);
session.save();
} catch (Exception e) {
throw new RegistryException("Error while retrieving workflow execution status!!!", e);
} finally {
closeSession(session);