Package org.apache.airavata.registry.api.workflow

Examples of org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus


  }

  @Override
  public boolean saveWorkflowExecutionStatus(String experimentId,
      ExecutionStatus status) throws RegistryException {
    this.status.put(experimentId, new WorkflowInstanceStatus(new WorkflowInstance(experimentId,experimentId),status));
    return true;
  }
View Full Code Here


    public boolean saveWorkflowData(String experimentID,String workflowInstanceID,String workflowTemplateID) {
        Timestamp currentTime = new Timestamp((new java.util.Date()).getTime());
        try {
            registry.setWorkflowInstanceTemplateName(workflowInstanceID, workflowTemplateID);
            registry.updateWorkflowInstanceStatus(new WorkflowInstanceStatus(new WorkflowInstance(experimentID, workflowInstanceID), WorkflowInstanceStatus.ExecutionStatus.STARTED,currentTime));
        } catch (RegistryException e) {
            logger.error("Error saving Workflow Data !!");
        }
        return true;
    }
View Full Code Here

  }
 
  @Override
  public void setWorkflowInstanceStatus(String experimentId, String workflowInstanceId,
      ExecutionStatus status) throws AiravataAPIInvocationException {
    setWorkflowInstanceStatus(new WorkflowInstanceStatus(new WorkflowInstance(experimentId, workflowInstanceId),status));
  }
View Full Code Here

      throws RegistryException {
    if (!isWorkflowInstanceExists(instanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(instanceId);
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(instanceId);
    return new WorkflowInstanceStatus(new WorkflowInstance(wi.getExperimentID(),wi.getWorkflowInstanceID()),wi.getStatus()==null?null:ExecutionStatus.valueOf(wi.getStatus()),wi.getLastUpdatedTime());
  }
View Full Code Here

      nodeData.setStartTime(t);
    }
    nodeData.setLastUpdateTime(t);
    nodeData.save();
    //Each time node status is updated the the time of update for the workflow status is going to be the same
    WorkflowInstanceStatus currentWorkflowInstanceStatus = getWorkflowInstanceStatus(workflowInstance.getWorkflowInstanceId());
    updateWorkflowInstanceStatus(new WorkflowInstanceStatus(workflowInstance, currentWorkflowInstanceStatus.getExecutionStatus(), t));
  }
View Full Code Here

      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    WorkflowDataResource resource = jpa.getWorker().getWorkflowInstance(workflowInstanceId);
    WorkflowInstance workflowInstance = new WorkflowInstance(resource.getExperimentID(), resource.getWorkflowInstanceID());
        workflowInstance.setTemplateName(resource.getTemplateName());
    WorkflowInstanceData workflowInstanceData = new WorkflowInstanceData(null, workflowInstance, new WorkflowInstanceStatus(workflowInstance, resource.getStatus()==null? null:ExecutionStatus.valueOf(resource.getStatus()),resource.getLastUpdatedTime()), null);
    List<NodeDataResource> nodeData = resource.getNodeData();
    for (NodeDataResource nodeDataResource : nodeData) {
      workflowInstanceData.getNodeDataList().add(getWorkflowInstanceNodeData(workflowInstanceId, nodeDataResource.getNodeID()));
    }
    return workflowInstanceData;
View Full Code Here

        workflowExecutionName="["+getExperiment().getExperimentId()+"]";
      }
    }
      String caption=workflowExecutionName;
      try {
      WorkflowInstanceStatus workflowExecutionStatus = getRegistry().getWorkflowInstanceStatus(getExperiment().getExperimentId());
      if (workflowExecutionStatus!=null && workflowExecutionStatus.getExecutionStatus()!=null){
        caption += " - <i>" + workflowExecutionStatus.getExecutionStatus().toString()+"</i>";
        if (workflowExecutionStatus.getStatusUpdateTime()!=null) {
            caption += "<i> as of " + workflowExecutionStatus.getStatusUpdateTime().toString() + "</i>";
        }
      }
    } catch (RegistryException e) {
      e.printStackTrace();
    }
View Full Code Here

  }
 
  @Override
  public void setWorkflowInstanceStatus(String experimentId, String workflowInstanceId,
      ExecutionStatus status) throws AiravataAPIInvocationException {
    setWorkflowInstanceStatus(new WorkflowInstanceStatus(new WorkflowInstance(experimentId, workflowInstanceId),status));
  }
View Full Code Here

  }

  private WorkflowInstanceData createWorkflowInstanceData(
      WorkflowExecution execution) {
    WorkflowInstance workflowInstance = new WorkflowInstance(execution.getExperimentId(),execution.getTopic());
    WorkflowInstanceData workflowInstanceData = new WorkflowInstanceData(workflowInstance, new WorkflowInstanceName(workflowInstance, execution.getWorkflowInstanceName()),new WorkflowInstanceUser(workflowInstance,execution.getUser()), new WorkflowInstanceStatus(workflowInstance,execution.getExecutionStatus().getExecutionStatus(),execution.getExecutionStatus().getStatusUpdateTime()), new WorkflowInstanceMetadata(workflowInstance,execution.getMetadata()), null);
    Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortInputData = groupNodePortData(execution.getServiceInput());
    Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortOutputData = groupNodePortData(execution.getServiceOutput());
    for (WorkflowInstanceNode instanceNode : groupNodePortInputData.keySet()) {
      workflowInstanceData.addNodeData(new WorkflowInstanceNodeData(instanceNode, groupNodePortInputData.get(instanceNode), null));
    }
View Full Code Here

    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);
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.