Package org.apache.airavata.workflow.model.wf

Examples of org.apache.airavata.workflow.model.wf.Workflow


    @Test
    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
        logger.info("Running ComplexMathWorkflowTest...");
        URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexMath.xwf");
        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
    WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
    workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
View Full Code Here


    private String setupAndLaunch(String workflowAsString, String topic, String password, String username,
                                  NameValue[] inputs,Map<String,String>configurations,boolean inNewThread,WorkflowContextHeaderBuilder builder) throws XMLStreamException {
        System.err.println("Launch is called for topi:");

        Workflow workflow = null;
        try {
            workflow = new Workflow(workflowAsString);
            System.err.println("Workflow Object created");
        } catch (GraphException e1) {
            e1.printStackTrace();
        } catch (ComponentException e1) {
            e1.printStackTrace();
View Full Code Here

        URI workflowID = event.getWorkflowID();

        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
        boolean found = false;
        for (GraphCanvas graphCanvas : graphCanvases) {
            Workflow workflow = graphCanvas.getWorkflow();
//            URI instanceID = workflow.getGPELInstanceID();
//            if (instanceID == null) {
                // If the workflow doesn't have an instance ID, it's a template.
                // We handle it so that users can use a workflow template to
                // monitor a workflow too.
                // This is also needed in the case of jython workflow.
                handleEvent(event, forward, workflow.getGraph());
//            } else if (instanceID.equals(workflowID)) {
//                This is the regular case.
//                found = true;
//                handleEvent(event, forward, workflow.getGraph());
//            } else if (null != workflowID
//                    && -1 != WSDLUtil.findWorkflowName(workflowID).indexOf(WSDLUtil.findWorkflowName(instanceID))) {
//                handleEvent(event, WSDLUtil.findWorkflowName(workflowID), workflow.getGraph());
//            }
        }

        // Load a sub-workflow.
        if (type == MonitorUtil.EventType.WORKFLOW_INITIALIZED) {
            if (forward) {
                // Check if the workflow instance is already open.
                for (GraphCanvas graphCanvas : graphCanvases) {
                    Workflow workflow = graphCanvas.getWorkflow();
                    URI instanceID = workflow.getGPELInstanceID();
                    if (workflowID.equals(instanceID)) {
                        // The workflow instance is already loaded.
                        return;
                    }
                }
View Full Code Here

      url = (new File(fileName)).toURL();
    }
    Properties properties = new Properties();
    properties.load(url.openStream());
    try {
      Workflow workflow = new Workflow(this.workflow);
      List<NodeImpl> inputs = workflow.getGraph().getNodes();
      int inputSize = 0;
      for (NodeImpl input : inputs) {
        if (input instanceof InputNode) {
          inputSize++;
        }
View Full Code Here

    return null;
  }

  public void setInputs(Properties inputList) {
    try {
      Workflow workflow = new Workflow(this.workflow);
      List<WSComponentPort> inputs = workflow.getInputs();
      for (WSComponentPort input : inputs) {
        input.setValue(inputList.getProperty(input.getName()));
      }
    } catch (GraphException e) {
      e.printStackTrace(); // To change body of catch statement use File |
View Full Code Here

  public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs,String workflowInstanceName) throws Exception{
    return runWorkflow(workflowTemplateId,inputs,getRegistry().getUser().getUserName(),null,workflowInstanceName);
  }
 
  public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata, String workflowInstanceName) throws Exception{
    Workflow workflowObj = getWorkflow(workflowTemplateId);
    return runWorkflow(workflowObj, inputs, user, metadata,workflowInstanceName,builder);
  }
View Full Code Here

    Workflow workflowObj = getWorkflow(workflowTemplateId);
    return runWorkflow(workflowObj, inputs, user, metadata,workflowInstanceName,builder);
  }

  public String runWorkflow(String workflowTemplateId,List<WorkflowInput> inputs, String user, String metadata, String workflowInstanceName, WorkflowContextHeaderBuilder builder) throws Exception{
    Workflow workflowObj = getWorkflow(workflowTemplateId);
    return runWorkflow(workflowObj, inputs, user, metadata,workflowInstanceName,builder);
  }
View Full Code Here

    return null;
  }
 
  public List<WorkflowInput> getWorkflowInputs(String workflowTemplateId) throws Exception{
    try {
      Workflow workflowTemplate = getWorkflow(workflowTemplateId);
            List<WSComponentPort> inputs = getWSComponentPortInputs(workflowTemplate);
          List<InputNode> inputNodes = getInputNodes(workflowTemplate);
      List<WorkflowInput> results=new ArrayList<WorkflowInput>();
      for (InputNode port : inputNodes) {
        Object value=null;
View Full Code Here

  private List<WSComponentPort> getWSComponentPortInputs(
      String workflowTemplateId) throws RegistryException,
      PathNotFoundException, RepositoryException, GraphException,
      ComponentException, ValueFormatException {
    Workflow workflow = getWorkflow(workflowTemplateId);
    return getWSComponentPortInputs(workflow);
  }
View Full Code Here

  private Workflow getWorkflow(String workflowTemplateId)
      throws RegistryException, PathNotFoundException,
      RepositoryException, GraphException, ComponentException,
      ValueFormatException {
    Workflow workflow = new Workflow(getWorkflowAsString(workflowTemplateId));
    return workflow;
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.wf.Workflow

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.