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

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


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


        if (!isWorkflowInstanceExists(workflowInstanceId,true)){
      throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
    }
    try{
            WorkflowDataResource resource = jpa.getWorker().getWorkflowInstance(workflowInstanceId);
            WorkflowExecution workflowInstance = new WorkflowExecution(resource.getExperimentID(), resource.getWorkflowInstanceID());
            workflowInstance.setTemplateName(resource.getTemplateName());
            WorkflowExecutionData workflowInstanceData = new WorkflowExecutionDataImpl(null, workflowInstance, new WorkflowExecutionStatus(workflowInstance, resource.getStatus()==null? null:State.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

        }
        if (!isWorkflowInstanceNodePresent(workflowInstanceId, nodeId)){
      throw new WorkflowInstanceNodeDoesNotExistsException(workflowInstanceId,nodeId);
    }
    NodeDataResource nodeData = jpa.getWorker().getWorkflowInstance(workflowInstanceId).getNodeData(nodeId);
    NodeExecutionData data = new NodeExecutionData(new WorkflowInstanceNode(new WorkflowExecution(nodeData.getWorkflowDataResource().getExperimentID(),nodeData.getWorkflowDataResource().getWorkflowInstanceID()),nodeData.getNodeID()));
    data.setInput(nodeData.getInputs());
    data.setOutput(nodeData.getOutputs());
        data.setType(WorkflowNodeType.getType(nodeData.getNodeType()).getNodeType());
    //TODO setup status
    return data;
View Full Code Here

  public WorkflowExecution getWorkflowExecution(String experimentId)
      throws RegistryException {
      if (getProvenanceRegistry()!=null){
        return getProvenanceRegistry().getWorkflowExecution(experimentId);
      }
    WorkflowExecution workflowExecution = new WorkflowExecutionImpl();
    workflowExecution.setExperimentId(experimentId);
    workflowExecution.setExecutionStatus(getWorkflowExecutionStatus(experimentId));
    workflowExecution.setUser(getWorkflowExecutionUser(experimentId));
    workflowExecution.setMetadata(getWorkflowExecutionMetadata(experimentId));
    workflowExecution.setWorkflowInstanceName(getWorkflowExecutionName(experimentId));
    workflowExecution.setOutput(getWorkflowExecutionOutput(experimentId));
    workflowExecution.setServiceInput(searchWorkflowExecutionServiceInput(experimentId,".*",".*"));
    workflowExecution.setServiceOutput(searchWorkflowExecutionServiceOutput(experimentId,".*",".*"));
    return workflowExecution;
  }
View Full Code Here

        this.node = node;
  }

    public Object read() throws Exception {
        try {
            WorkflowExecution workflowExecution = registry.getWorkflowExecution(experimentId);
            List<WorkflowServiceIOData> serviceOutput = workflowExecution.getServiceOutput();
            if (serviceOutput.size() == 0) {
                return null;
            }
            for (WorkflowServiceIOData data : serviceOutput) {
                if (this.node.getID().equals(data.getNodeId())) {
View Full Code Here

    public boolean saveWorkflowData(String experimentID,String workflowInstanceID,String workflowTemplateID) {
        Timestamp currentTime = new Timestamp((new java.util.Date()).getTime());
        try {
            airavataAPI.getProvenanceManager().setWorkflowInstanceTemplateName(workflowInstanceID, workflowTemplateID);
            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(new WorkflowExecutionStatus(new WorkflowExecution(experimentID, workflowInstanceID), WorkflowExecutionStatus.State.STARTED,currentTime));
        } catch (AiravataAPIInvocationException e) {
            logger.error("Error saving Workflow Data !!");
        }
        return true;
    }
View Full Code Here

        }

      }
            if (inputs!=null) {
        try {
          this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(new WorkflowInstanceNode(new WorkflowExecution(experimentId, experimentId), node.getID()), xsul5.XmlConstants.BUILDER.serializeToString(inputs));
                } catch (AiravataAPIInvocationException e) {
          throw new WorkflowException(e);
        }
        // deal with the outputs
      }
      XmlElement outputs = elem.newElement("outputs");
      elem.addChild(outputs);

      List<DataPort> outputPorts = node.getOutputPorts();
      for (DataPort outputPort : outputPorts) {
        String outputName = outputPort.getName();

        XmlElement outputParamElement = outputs.newElement(outputName);
        outputs.addChild(outputParamElement);
        Object ouputParamValue = invokerMap.get(node).getOutput(
            outputName);

        if (ouputParamValue instanceof org.xmlpull.v1.builder.XmlElement) {
          ouputParamValue = XMLUtil
              .xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) ouputParamValue);
        }

        if (ouputParamValue != null) {
          outputParamElement.addChild(ouputParamValue);
        } else {
          outputParamElement.addChild("null");
        }
      }
            try {
        this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(new WorkflowInstanceNode(new WorkflowExecution(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(outputs));
            } catch (AiravataAPIInvocationException e) {
        throw new WorkflowException(e);
      }
    }
  }
View Full Code Here

    public boolean workflowNodeStarted(String workflowInstanceID,String nodeID,String inputs,String workflowID){
        try {
            //todo we currently save only service nodes
            WorkflowNodeType workflowNodeType = new WorkflowNodeType();
            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
      airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(node, inputs);
            airavataAPI.getProvenanceManager().setWorkflowNodeType(node, workflowNodeType);
            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.STARTED);
        } catch (AiravataAPIInvocationException e) {
            logger.error("Error updating Wokflow Node status !!");
View Full Code Here

    public boolean workflowNodeFinished(String workflowInstanceID,String nodeID,String inputs,String workflowID){
        try {
          WorkflowNodeType workflowNodeType = new WorkflowNodeType();
            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(node, inputs);
            airavataAPI.getProvenanceManager().setWorkflowNodeType(node,workflowNodeType);
            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FINISHED);
        } catch (AiravataAPIInvocationException e) {
            logger.error("Error updating Wokflow Node status !!");
View Full Code Here

        keywords[i] = ((InputNode) node).getName();
        values[i] = ((InputNode) node).getDefaultValue();
                //Saving workflow input Node data before running the workflow
                WorkflowNodeType workflowNodeType = new WorkflowNodeType();
                workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.INPUTNODE);
                WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution(getConfig().getTopic(),
                        getConfig().getTopic()), node.getID());
                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceNodeInput(workflowInstanceNode, keywords[i] + "=" + (String) values[i]);
                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowNodeType(workflowInstanceNode, workflowNodeType);
      }
      this.config.getNotifier().workflowStarted(values, keywords);
View Full Code Here

TOP

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

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.