Package edu.indiana.extreme.xbaya.lead

Examples of edu.indiana.extreme.xbaya.lead.LEADWorkflowInvoker


        if (this.configuration.isPullMode()) {
            messageBoxURL = this.configuration.getMessageBoxURL();
        }

        // Create a invoke to invoke the workflow instance.
        LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
                leadContext, messageBoxURL);

        // Set the input values to the invoker.
        // Get the input information
        List<WSComponentPort> inputs = workflow.getInputs();

        for (WSComponentPort input : inputs) {
            // Show the information of each input.

            // Name
            String name = input.getName();
            logger.info("name: " + name);

            // Type
            QName type = input.getType();
            logger.info("type: " + type);

            String defaultValue = input.getDefaultValue();
            logger.info("defaultValue: " + defaultValue);

            // Set a value to each input.
            input.setValue(defaultValue);
        }
        invoker.setInputs(inputs);

        // Invoke the workflow. This will block, so you may want to do it in a
        // thread.
        boolean success = invoker.invoke();
        logger.info("success: " + success);

        // We don't need to wait for the outputs.

        if (success) {
            List<WSComponentPort> outputs = invoker.getOutputs();
            for (WSComponentPort output : outputs) {
                String name = output.getName();
                logger.info("name: " + name);
                Object value = output.getValue();
                logger.info("value: " + value);
            }
        } else {
            WSIFMessage fault = invoker.getFault();
            logger.info("fault: " + fault);
        }

    }
View Full Code Here


        if (this.configuration.isPullMode()) {
            messageBoxURL = this.configuration.getMessageBoxURL();
        }

        // Create an invoker to invoke the workflow instance.
        LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
                leadContext, messageBoxURL);

        // Set the input values to the invoker.
        invoker.setInputs(inputs);

        // Invoke the workflow. This will block, so you may want to do it in a
        // thread.
        boolean success = invoker.invoke();
        logger.info("success: " + success);

        // We don't need to wait for the outputs.

        if (success) {
            List<WSComponentPort> outputs = invoker.getOutputs();
            for (WSComponentPort output : outputs) {
                String name = output.getName();
                logger.info("name: " + name);
                Object value = output.getValue();
                logger.info("value: " + value);
            }
        } else {
            WSIFMessage fault = invoker.getFault();
            logger.info("fault: " + fault);
        }

    }
View Full Code Here

        .getConfiguration();
    XBayaConfiguration configuration = this.engine.getConfiguration();
   

    // Create the invoker
    LEADWorkflowInvoker invoker = null;
    try {
     
      WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());
     
      LeadContextHeader leadContext = WSDLUtil.buildLeadContextHeader(this.engine,
          monitorConfiguration, StringUtil.convertToJavaIdentifier(engine
              .getWorkflow().getName()),resourceMapping);
      ///////////////////////////////////////
      leadContext.setExperimentId(monitorConfiguration.getTopic());
     
     
      //////////////////////////////////////////////////////////////
     
      URI messageBoxURL = null;
      if (monitorConfiguration.isPullMode()) {
        messageBoxURL = monitorConfiguration.getMessageBoxURL();
      }

      // create an invoker with LEAD Context
      GsiInvoker secureInvoker = null;
      if (this.engine.getWorkflowClient().isSecure()) {
        MyProxyClient myProxyClient = this.engine.getMyProxyClient();
        secureInvoker = new GsiInvoker(myProxyClient.getProxy(),
            XBayaSecurity.getTrustedCertificates());
       
        leadContext.setScmsUrl(URI.create("https://tyr12.cs.indiana.edu:60443/SCMS?wsdl"));

       
       
      }
      invoker = new LEADWorkflowInvoker(wsdl, leadContext, messageBoxURL,
          secureInvoker);
    } catch (ComponentException e) {
      if (this.canceled) {
        logger.caught(e);
      } else {       
        this.engine.getErrorWindow().error(
            ErrorMessages.GRAPH_NOT_READY_ERROR, e);
        this.invokingDialog.hide();
      }
      return;
    } catch (RuntimeException e) {
      if (this.canceled) {
        logger.caught(e);
      } else {       
        this.engine.getErrorWindow().error(
            ErrorMessages.UNEXPECTED_ERROR, e);
        this.invokingDialog.hide();
      }
      return;
    } catch (Exception e) {     
      this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
          e);
      this.invokingDialog.hide();
      return;
    }

    invoker.setInputs(inputs);

    // Start the monitor.
    try {
      this.engine.getMonitor().start();
    } catch (MonitorException e) {
      if (this.canceled) {
        logger.caught(e);
      } else {       
        this.engine.getErrorWindow().error(
            ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
        this.invokingDialog.hide();
      }
      return;
    } catch (RuntimeException e) {
      if (this.canceled) {
        logger.caught(e);
      } else {       
        this.engine.getErrorWindow().error(
            ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
        this.invokingDialog.hide();
      }
      return;
    } catch (Error e) {     
      this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
          e);
      this.invokingDialog.hide();
    }

    final LEADWorkflowInvoker workflowInvoker = invoker;
    new Thread() {
      @Override
      public synchronized void run() {
        try {
          boolean success = workflowInvoker.invoke();
          String result = null;
          if (success) {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getOutputMessage());
          } else {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getFaultMessage());
          }
          logger.info("Done with the execution. result: " + result);
        } catch (XBayaException e) {
          ODEInvoker.this.engine.getErrorWindow().error(
View Full Code Here

        URI messageBoxURL = null;
        if (this.configuration.isPullMode()) {
            messageBoxURL = this.configuration.getMessageBoxURL();
        }

        LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(definitions,
                leadContext, messageBoxURL);

        List<WSComponentPort> inputs = invoker.getInputs();

        for (WSComponentPort input : inputs) {
            String name = input.getName();
            logger.info("name: " + name);
            input.setValue("200");

            org.xmlpull.infoset.XmlElement appinfo = input.getAppinfo();
            logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
        }

        invoker.setInputs(inputs);

        boolean success = invoker.invoke();
        logger.info("success: " + success);

        if (success) {
            List<WSComponentPort> outputs = invoker.getOutputs();
            for (WSComponentPort output : outputs) {
                String name = output.getName();
                logger.info("name: " + name);
                Object value = output.getValue();
                logger.info("value: " + value);
            }
        } else {
            WSIFMessage fault = invoker.getFault();
            logger.info("fault: " + fault);
        }

        service.shutdownServer();
    }
View Full Code Here

                    .loadCertificates(trustedcerts));
        } else {
            // Using service certificate.
            secureInvoker = new PuretlsInvoker(certskey, "", trustedcerts);
        }
        LEADWorkflowInvoker workflowInvoker = new LEADWorkflowInvoker(wsdl,
                leadContext, messageBoxURL, secureInvoker);
        assertNotNull(workflowInvoker);
    }
View Full Code Here

    try {
      LeadContextHeader defaultLeadHeader = odeClient.getDefaultLeadHeader(workflow, topic,
          credential.getName().toString(), new URI(topic), null, null);
      defaultLeadHeader.setExperimentId(topic);
      LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
          defaultLeadHeader, null, secureInvoker, operationName);
     
      WSIFMessage inputMessage = invoker.getInputMessage();
//      inputMessage.setObjectPart("input", XmlConstants.BUILDER.newFragment("<n1:Run xmlns:n1='http://www.extreme.indiana.edu/xbaya/demok/xsd/'><file1>fds</file1><file2>fsfas</file2></n1:Run>"));
      inputMessage.setObjectPart("input", "tttt");
//      inputMessage.setObjectPart("file2", "tttt");
      invoker.invoke();
    } catch (ComponentException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (GSSException e) {
      // TODO Auto-generated catch block
View Full Code Here

      }
      componentPort.setValue(value);
    }


    LEADWorkflowInvoker invoker = null;
    try {

      URI messageBoxURL = XBayaConstants.DEFAULT_MESSAGE_BOX_URL;

      // create an invoker with LEAD Context
      GsiInvoker secureInvoker = new GsiInvoker(this.context.getCredentials(), XBayaSecurity
          .getTrustedCertificates());

      invoker = new LEADWorkflowInvoker(this.wsdl, context.getHeader(),
          messageBoxURL, secureInvoker);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    invoker.setInputs(wfInputs);

    final LEADWorkflowInvoker workflowInvoker = invoker;
    logger.info("Invoking .....");

    new Thread() {
      @Override
      public synchronized void run() {
        try {
          boolean success = workflowInvoker.invoke();
          String result = null;
          if (success) {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getOutputMessage());
          } else {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getFaultMessage());
          }
          logger.info("Result from workflow invocation => " + result);
        } catch (XBayaException e) {
          e.printStackTrace();
View Full Code Here

      GsiInvoker secureInvoker = null;
      secureInvoker = new GsiInvoker(credentials,
          XBayaSecurity.getTrustedCertificates());

      LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
          leadContext, null, secureInvoker);
      invoker.setInputs(inputs);
      final LEADWorkflowInvoker finalInvoker = invoker;

      new Thread() {
        public synchronized void run() {
          boolean success;
          try {
            success = finalInvoker.invoke();

            String result = null;
            if (success) {
              result = XmlConstants.BUILDER
                  .serializeToString(finalInvoker
                      .getOutputMessage());
            } else {
              result = XmlConstants.BUILDER
                  .serializeToString(finalInvoker
                      .getFaultMessage());
            }
          } catch (XBayaException e) {
            ODEClient.this.throwException(e);
          }
View Full Code Here

            this.invokingDialog.hide();
            return;
        }

        // Create the invoker
        LEADWorkflowInvoker invoker = null;
        try {
            LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
            leadContextHelper.setXBayaConfiguration(xbayaConfiguration);
            leadContextHelper.setMyLeadConfiguration(this.engine.getMyLead()
                    .getConfiguration());
            leadContextHelper.setWorkflow(workflow);
            leadContextHelper.setMonitorConfiguration(monitorConfiguration);

            LeadContextHeader leadContext = leadContextHelper
                    .getLeadContextHeader();

            URI messageBoxURL = null;
            if (monitorConfiguration.isPullMode()) {
                messageBoxURL = monitorConfiguration.getMessageBoxURL();
            }

            // create an invoker with LEAD Context
            GsiInvoker secureInvoker = null;
            if (this.engine.getWorkflowClient().isSecure()) {
                MyProxyClient myProxyClient = this.engine.getMyProxyClient();
                secureInvoker = new GsiInvoker(myProxyClient.getProxy(),
                        XBayaSecurity.getTrustedCertificates());
            }
            invoker = new LEADWorkflowInvoker(wsdl, leadContext, messageBoxURL,
                    secureInvoker);
        } catch (ComponentException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(
                        ErrorMessages.GRAPH_NOT_READY_ERROR, e);
                this.invokingDialog.hide();               
            }
            return;
        } catch (RuntimeException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(
                        ErrorMessages.UNEXPECTED_ERROR, e);
                this.invokingDialog.hide();               
            }
            return;
        } catch (Error e) {           
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            this.invokingDialog.hide();
            return;
        }

        invoker.setInputs(inputs);

        // Start the monitor.
        try {
            this.engine.getMonitor().start();
        } catch (MonitorException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(
                        ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
                this.invokingDialog.hide();
            }
            return;
        } catch (RuntimeException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(
                        ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
                this.invokingDialog.hide();
            }
            return;
        } catch (Error e) {           
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            this.invokingDialog.hide();
        }

        final LEADWorkflowInvoker workflowInvoker = invoker;
        new Thread() {
            @Override
            public synchronized void run() {
                try {
                    boolean success = workflowInvoker.invoke();
                    String result = null;
                    if (success) {
                        result = XmlConstants.BUILDER
                                .serializeToString(workflowInvoker
                                        .getOutputMessage());
                    } else {
                        result = XmlConstants.BUILDER
                                .serializeToString(workflowInvoker
                                        .getFaultMessage());
                    }
                    logger.info("Done with the execution. result: " + result);
                } catch (XBayaException e) {
                    GPELInvoker.this.engine.getErrorWindow().error(
View Full Code Here

    System.out.println(instance.getId());
    System.out.println(instance.getInstanceId());
    WsdlDefinitions wsdl = client.start(instance);
    System.out.println(workflow.getGPELTemplateID());

    LEADWorkflowInvoker invoker = null;
    try {
      if(leadContextHeader == null){
      leadContextHeader = getLeadContextHeader(topic,
          workflow, proxy, instance);
      }

      URI messageBoxURL = XBayaConstants.DEFAULT_MESSAGE_BOX_URL;

      // create an invoker with LEAD Context
      GsiInvoker secureInvoker = new GsiInvoker(proxy, XBayaSecurity
          .getTrustedCertificates());

      invoker = new LEADWorkflowInvoker(wsdl, leadContextHeader,
          messageBoxURL, secureInvoker);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    invoker.setInputs(inputs);

    final LEADWorkflowInvoker workflowInvoker = invoker;
    System.out.println("Invoking .....");
   

    new Thread() {
      @Override
      public synchronized void run() {
        try {
          boolean success = workflowInvoker.invoke();
          String result = null;
          if (success) {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getOutputMessage());
          } else {
            result = XmlConstants.BUILDER
                .serializeToString(workflowInvoker
                    .getFaultMessage());
          }
        } catch (XBayaException e) {
          throw new RuntimeException(e);
        }
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.lead.LEADWorkflowInvoker

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.