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

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


    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 (!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

  @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

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

  @Override
  public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(
      String experimentId, String workflowInstanceId, String nodeId)
      throws AiravataAPIInvocationException {
    return getWorkflowInstanceNodeInputData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));
  }
View Full Code Here

  @Override
  public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(
      String experimentId, String workflowInstanceId, String nodeId)
      throws AiravataAPIInvocationException {
    return getWorkflowInstanceNodeOutputData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));

  }
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.WorkflowInstanceNode

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.