Package org.apache.airavata.registry.api.exception.worker

Examples of org.apache.airavata.registry.api.exception.worker.WorkflowInstanceDoesNotExistsException



  @Override
  public String getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException {
    if (!isWorkflowInstanceExists(workflowInstanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowInstanceId);
    return wi.getTemplateName();
  }
View Full Code Here


  @Override
  public void setWorkflowInstanceTemplateName(String workflowInstanceId,
      String templateName) throws RegistryException {
    if (!isWorkflowInstanceExists(workflowInstanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowInstanceId);
    wi.setTemplateName(templateName);
    wi.save();
  }
View Full Code Here

  @Override
  public void updateWorkflowInstanceStatus(String instanceId,
      ExecutionStatus status) throws RegistryException {
    if (!isWorkflowInstanceExists(instanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(instanceId);
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(instanceId);
    Timestamp currentTime = new Timestamp(Calendar.getInstance().getTime().getTime());
    wi.setStatus(status.toString());
    if (status==ExecutionStatus.STARTED){
View Full Code Here

  @Override
  public void updateWorkflowInstanceStatus(WorkflowInstanceStatus status)
      throws RegistryException {
    if (!isWorkflowInstanceExists(status.getWorkflowInstance().getWorkflowInstanceId(), true)){
      throw new WorkflowInstanceDoesNotExistsException(status.getWorkflowInstance().getWorkflowInstanceId());
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(status.getWorkflowInstance().getWorkflowInstanceId());
    Timestamp currentTime = new Timestamp(status.getStatusUpdateTime().getTime());
    wi.setStatus(status.getExecutionStatus().toString());
    if (status.getExecutionStatus()==ExecutionStatus.STARTED){
View Full Code Here

  @Override
  public WorkflowInstanceStatus getWorkflowInstanceStatus(String instanceId)
      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

  @Override
  public Date getWorkflowStartTime(WorkflowInstance workflowInstance)
      throws RegistryException {
    if (!isWorkflowInstanceExists(workflowInstance.getWorkflowInstanceId(),true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstance.getWorkflowInstanceId());
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowInstance.getWorkflowInstanceId());
    return wi.getStartTime();
  }
View Full Code Here

  @Override
  public WorkflowInstanceData getWorkflowInstanceData(
      String workflowInstanceId) throws RegistryException {
    if (!isWorkflowInstanceExists(workflowInstanceId,true)){
      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);
View Full Code Here

  @Override
  public boolean isWorkflowInstanceNodePresent(String workflowInstanceId,
      String nodeId, boolean createIfNotPresent) throws RegistryException {
    if (!isWorkflowInstanceExists(workflowInstanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    if (jpa.getWorker().getWorkflowInstance(workflowInstanceId).isNodeExists(nodeId)){
      return true;
    }else if (createIfNotPresent){
      addWorkflowInstanceNode(workflowInstanceId, nodeId);
View Full Code Here

        throw new ExperimentDoesNotExistsException(experimentId);
      }
      gFacJobs = jpa.getWorker().getExperiment(experimentId).getData().getGFacJobs();
    }else if (nodeId==null){
      if (!isWorkflowInstanceExists(workflowExecutionId)){
        throw new WorkflowInstanceDoesNotExistsException(workflowExecutionId);
      }
      gFacJobs = jpa.getWorker().getExperiment(experimentId).getData().getWorkflowInstance(workflowExecutionId).getGFacJobs();
    }else{
      if (!isWorkflowInstanceNodePresent(workflowExecutionId, nodeId)){
        throw new WorkflowInstanceNodeDoesNotExistsException(workflowExecutionId, nodeId);
View Full Code Here

  public String getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException {
        if (provenanceRegistry != null){
            return provenanceRegistry.getWorkflowExecutionTemplateName(workflowInstanceId);
        }
    if (!isWorkflowInstanceExists(workflowInstanceId, true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowInstanceId);
    return wi.getTemplateName();
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.exception.worker.WorkflowInstanceDoesNotExistsException

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.