Package org.apache.airavata.common.workflow.execution.context

Examples of org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder


  public static void main(String[] args) {
    ExecutionManagerImpl a = new ExecutionManagerImpl(null);
    try {
      ExperimentAdvanceOptions b = a.createExperimentAdvanceOptions();
      b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", "da", false);
      WorkflowContextHeaderBuilder c = AiravataAPIUtils.createWorkflowContextHeaderBuilder(b, "sheeeeeeeeeeee","meeee");
      System.out.println(XMLUtil.xmlElementToString(c.getXml()));
    } catch (AiravataAPIInvocationException e) {
      e.printStackTrace();
    }
  }
View Full Code Here


                "    <wor:workflow-scheduling-context />\n" +
                "    <wor:security-context />\n" +
                "</wor:context-header>");
        }
        Map<String, String> configuration = new HashMap<String, String>();
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
        String user = workflowContextHeaderBuilder.getSubmissionUser();

        String s = null;
        try {
             s = setupAndLaunch(workflowAsString, topic, ServerSettings.getDefaultGatewayId(),
                    user,inputs, configuration, runInThread, workflowContextHeaderBuilder);
View Full Code Here

            log.error(e.getMessage());
        } catch (AiravataAPIInvocationException e) {
            log.error(e.getMessage());
        }
      String submissionUser = workflowContext.getAttributeValue(new QName(workflowContext.getNamespace().getNamespaceURI(), "submissionUser"));
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = new WorkflowContextHeaderBuilder(parse.getContextHeader());
        workflowContextHeaderBuilder.setSubmissionUser(submissionUser);
    return workflowContextHeaderBuilder;
    }
View Full Code Here

    }

    private void setup(WsdlDefinitions definitions) throws WorkflowException {

        // Set LEAD context header.
        WorkflowContextHeaderBuilder builder;
        if(contextHeader == null){
            builder = new WorkflowContextHeaderBuilder(this.notifier.getEventSink()
                .getAddress(), this.gfacURL, null, this.topic,
                "xbaya-experiment", this.messageBoxURL);
        }else{
             builder = new WorkflowContextHeaderBuilder(contextHeader);
        }
        if(builder.getWorkflowMonitoringContext() == null){
            builder.addWorkflowMonitoringContext(this.notifier.getEventSink().getAddress(),
                    this.topic,this.nodeID,this.messageBoxURL);
        } else {
            builder.getWorkflowMonitoringContext().setWorkflowInstanceId(this.notifier.getWorkflowID().toASCIIString());
        }
        builder.getWorkflowMonitoringContext().setWorkflowNodeId(this.nodeID);
        builder.getWorkflowMonitoringContext().setServiceInstanceId(this.nodeID);
        builder.getWorkflowMonitoringContext().setWorkflowTimeStep(1);
        builder.setUserIdentifier("xbaya-user");
        //todo write a UI component to collect this information and pass it through Header
//        builder.setGridMyProxyRepository("myproxy.nersc.gov","fangliu","Jdas7wph",14000);
        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-workflowcontext-header", builder.getXml());
        // Create Invoker
        this.invoker = InvokerFactory.createInvoker(this.portTypeQName, definitions, this.gfacURL, this.messageBoxURL,
                builder, true);
        this.invoker.setup();
View Full Code Here

     */

  public java.lang.String launchWorkflow(java.lang.String workflowAsString, java.lang.String topic, NameValue[] inputs) throws XMLStreamException {
        OMElement workflowContext = getWorkflowContextHeader();
        Map<String, String> configuration = new HashMap<String, String>();
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
        return setupAndLaunch(workflowAsString, topic,
                (String)configurationContext.getProperty(MYPROXY_USER),(String)configurationContext.getProperty(MYPROXY_PASS),inputs,configuration,runInThread,workflowContextHeaderBuilder);
  }
View Full Code Here

            configuration.put(GFAC, parse.getContextHeader().getSoaServiceEprs().getGfacUrl());
            configuration.put(MSGBOX, parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr());
        } catch (XmlException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
        return new WorkflowContextHeaderBuilder(parse.getContextHeader());
    }
View Full Code Here

  }
  private void initialize() throws MalformedURLException {
    updateClientConfiguration(configuration);
   
        // At this point we do not know the workflowExperimentId
    builder = new WorkflowContextHeaderBuilder(configuration.get(BROKER),
            configuration.get(GFAC),configuration.get(JCR),null,null,
            configuration.get(MSGBOX));
   
    //TODO: At some point this should contain the current user the airavata client is
    //logged in to the Airavata system
View Full Code Here

  @Override
  public WorkflowContextHeaderBuilder createWorkflowContextHeader()
      throws AiravataAPIInvocationException {
    AiravataClientConfiguration config = getClient().getClientConfiguration();
    try {
      return new WorkflowContextHeaderBuilder(config.getMessagebrokerURL().toString(),
          config.getGfacURL().toString(),config.getJcrURL().toString(),null,null,
          config.getMessageboxURL().toString());
    } catch (Exception e) {
      throw new AiravataAPIInvocationException(e);
    }
View Full Code Here

                    }
                    XBayaConfiguration configuration = engine.getConfiguration();
                    String myProxyUsername = configuration.getRegistryUserName();
                    String myProxyPass = configuration.getRegistryPassphrase();
                    //todo we need to add the workflowContext header in the message
                    WorkflowContextHeaderBuilder builder = new WorkflowContextHeaderBuilder(configuration.getBrokerURL().toASCIIString(),
                            configuration.getGFacURL().toASCIIString(),configuration.getRegistryURL().toASCIIString(),configuration.getTopic()
                            ,null,configuration.getMessageBoxURL().toASCIIString());
                    stub._getServiceClient().addHeader(AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder.getXml())));
                    stub.launchWorkflow(workflow.toXMLText(), topicString,inputNameVals);
                    engine.getConfiguration().getJcrComponentRegistry().getRegistry().saveWorkflowExecutionName(topicString, instanceNameFinal);
                } catch (Exception e) {
                    WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e);
                }
View Full Code Here

                "    <wor:workflow-scheduling-context />\n" +
                "    <wor:security-context />\n" +
                "</wor:context-header>");
        }
        Map<String, String> configuration = new HashMap<String, String>();
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
        String user = workflowContextHeaderBuilder.getSubmissionUser();

        String s = null;
        try {
             s = setupAndLaunch(workflowAsString, topic, ServerSettings.getSystemUserGateway(),
                    user,inputs, configuration, runInThread, workflowContextHeaderBuilder);
View Full Code Here

TOP

Related Classes of org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder

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.