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

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


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


  @Override
  public WorkflowInstanceNodeStatus getWorkflowInstanceNodeStatus(
      String experimentId, String workflowInstaceId, String nodeId)
      throws AiravataAPIInvocationException {
    return getWorkflowInstanceNodeStatus(new WorkflowInstanceNode(new WorkflowInstance(experimentId,workflowInstaceId),nodeId));
  }
View Full Code Here

    ExperimentResource experiment = jpa.getWorker().getExperiment(experimentId);
    ExperimentDataResource data = experiment.getData();
    List<WorkflowInstance> result=new ArrayList<WorkflowInstance>();
    List<WorkflowDataResource> workflowInstances = data.getWorkflowInstances();
    for (WorkflowDataResource resource : workflowInstances) {
      WorkflowInstance workflowInstance = new WorkflowInstance(resource.getExperimentID(), resource.getWorkflowInstanceID());
      workflowInstance.setTemplateName(resource.getTemplateName());
      result.add(workflowInstance);
    }
    return result;
  }
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

  @Override
  public void updateWorkflowNodeStatus(
      WorkflowInstanceNodeStatus workflowStatusNode)
      throws RegistryException {
    WorkflowInstance workflowInstance = workflowStatusNode.getWorkflowInstanceNode().getWorkflowInstance();
    String nodeId = workflowStatusNode.getWorkflowInstanceNode().getNodeId();
    if (!isWorkflowInstanceNodePresent(workflowInstance.getWorkflowInstanceId(), nodeId, true)){
      throw new WorkflowInstanceNodeDoesNotExistsException(workflowInstance.getWorkflowInstanceId(), nodeId);
    }
    NodeDataResource nodeData = jpa.getWorker().getWorkflowInstance(workflowInstance.getWorkflowInstanceId()).getNodeData(nodeId);
    nodeData.setStatus(workflowStatusNode.getExecutionStatus().toString());
    Timestamp t = new Timestamp(workflowStatusNode.getStatusUpdateTime().getTime());
    if (workflowStatusNode.getExecutionStatus()==ExecutionStatus.STARTED){
      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


  @Override
  public void updateWorkflowNodeStatus(String workflowInstanceId,
      String nodeId, ExecutionStatus status) throws RegistryException {
    updateWorkflowNodeStatus(new WorkflowInstanceNode(new WorkflowInstance(workflowInstanceId, workflowInstanceId), nodeId), status);
  }
View Full Code Here

    if (!isWorkflowInstanceNodePresent(id, nodeId)){
      throw new WorkflowInstanceNodeDoesNotExistsException(id, nodeId);
    }
    WorkflowDataResource workflowInstance = jpa.getWorker().getWorkflowInstance(id);
    NodeDataResource nodeData = workflowInstance.getNodeData(nodeId);
    return new WorkflowInstanceNodeStatus(new WorkflowInstanceNode(new WorkflowInstance(workflowInstance.getExperimentID(), workflowInstance.getWorkflowInstanceID()), nodeData.getNodeID()), nodeData.getStatus()==null?null:ExecutionStatus.valueOf(nodeData.getStatus()),nodeData.getLastUpdateTime());
  }
View Full Code Here

      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);
    List<NodeDataResource> nodeData = resource.getNodeData();
    for (NodeDataResource nodeDataResource : nodeData) {
      workflowInstanceData.getNodeDataList().add(getWorkflowInstanceNodeData(workflowInstanceId, nodeDataResource.getNodeID()));
    }
View Full Code Here

      String workflowInstanceId, String nodeId) throws RegistryException {
    if (!isWorkflowInstanceNodePresent(workflowInstanceId,nodeId)){
      throw new WorkflowInstanceNodeDoesNotExistsException(workflowInstanceId,nodeId);
    }
    NodeDataResource nodeData = jpa.getWorker().getWorkflowInstance(workflowInstanceId).getNodeData(nodeId);
    WorkflowInstanceNodeData data = new WorkflowInstanceNodeData(new WorkflowInstanceNode(new WorkflowInstance(nodeData.getWorkflowDataResource().getExperimentID(),nodeData.getWorkflowDataResource().getWorkflowInstanceID()),nodeData.getNodeID()));
    data.setInput(nodeData.getInputs());
    data.setOutput(nodeData.getOutputs());
    //TODO setup status
    return data;
  }
View Full Code Here

  @Override
  public void addWorkflowInstanceNodeInputData(String experimentId,
      String workflowInstanceId, String nodeId, String data)
      throws AiravataAPIInvocationException {
    addWorkflowInstanceNodeInputData(new WorkflowInstanceNodePortData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId), data));
  }
View Full Code Here

TOP

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

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.