Package edu.indiana.extreme.xbaya.monitor

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration


                this.invokingDialog.hide();
            }
            return;
        }

        MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
                .getConfiguration();
        XBayaConfiguration xbayaConfiguration = this.engine.getConfiguration();
        WsdlDefinitions wsdl;
        try {
            GcInstance instance = client.instantiate(workflow,
                    xbayaConfiguration.getDSCURL(), monitorConfiguration
                            .getTopic());
            wsdl = client.start(instance);
        } catch (WorkflowEngineException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(ErrorMessages.GPEL_ERROR, e);
                this.invokingDialog.hide();
            }
            return;
        } catch (ComponentException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(ErrorMessages.GPEL_ERROR, e);
                this.invokingDialog.hide();
            }
            return;
        } catch (GraphException e) {
            if (this.canceled) {
                logger.caught(e);
            } else {               
                this.engine.getErrorWindow().error(ErrorMessages.GPEL_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;
        }

        // 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()) {
View Full Code Here


    this.configuration = configuration;
    this.engine = this;
   
    // Creates some essential objects.

    MonitorConfiguration monitorConfiguration = new MonitorConfiguration(
        configuration.getBrokerURL(), configuration.getTopic(),
        configuration.isPullMode(), configuration.getMessageBoxURL());
    this.monitor = new Monitor(monitorConfiguration);

    // MyProxy
View Full Code Here

    this.workflow = this.engine.getWorkflow();

    this.script = new ScuflScript(this.workflow,
        this.engine.getConfiguration());

    MonitorConfiguration notifConfig = this.engine.getMonitor()
        .getConfiguration();
    if (notifConfig.getBrokerURL() == null) {
      this.engine.getErrorWindow().error(
          ErrorMessages.BROKER_URL_NOT_SET_ERROR);
      return;
    }

    // Check if the workflow is valid before the user types in input
    // values.
    JythonScript jythonScript = new JythonScript(this.workflow,
        this.engine.getConfiguration());
    ArrayList<String> warnings = new ArrayList<String>();
    if (!jythonScript.validate(warnings)) {
      StringBuilder buf = new StringBuilder();
      for (String warning : warnings) {
        buf.append("- ");
        buf.append(warning);
        buf.append("\n");
      }
      this.engine.getErrorWindow().warning(buf.toString());
      return;
    }

    // Create a script here. It might throw some exception because the
    // validation is not perfect.
    try {
      this.script.create();
    } catch (GraphException e) {
      this.engine.getErrorWindow().error(
          ErrorMessages.GRAPH_NOT_READY_ERROR, e);
      hide();
      return;
    } catch (RuntimeException e) {
      this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
          e);
      hide();
      return;
    } catch (Error e) {
      this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
          e);
      hide();
      return;
    }

    // Create input fields
    Collection<InputNode> inputNodes = GraphUtil
        .getInputNodes(this.workflow.getGraph());
    for (InputNode node : inputNodes) {
      String id = node.getID();
      QName parameterType = node.getParameterType();
      JLabel nameLabel = new JLabel(id);
      JLabel typeField = new JLabel(parameterType.getLocalPart());
      XBayaTextField paramField = new XBayaTextField();
      Object value = node.getDefaultValue();

      String valueString;
      if (value == null) {
        valueString = "";
      } else {
        if (value instanceof XmlElement) {
          XmlElement valueElement = (XmlElement) value;
          valueString = XMLUtil.xmlElementToString(valueElement);
        } else {
          // Only string comes here for now.
          valueString = value.toString();
        }
      }
      paramField.setText(valueString);
      this.parameterPanel.add(nameLabel);
      this.parameterPanel.add(typeField);
      this.parameterPanel.add(paramField);
      this.parameterTextFields.add(paramField);
    }
    this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE,
        2);

    this.topicTextField.setText(notifConfig.getTopic());

    XBayaConfiguration config = this.engine.getConfiguration();

    this.dialog.show();
  }
View Full Code Here

    // find it.
    URI workfowInstanceID = URI.create(StringUtil
        .convertToJavaIdentifier(topic));
    this.workflow.setGPELInstanceID(workfowInstanceID);

    MonitorConfiguration notifConfig = this.engine.getMonitor()
        .getConfiguration();
    notifConfig.setTopic(topic);
    arguments.add("-" + JythonScript.TOPIC_VARIABLE);
    arguments.add(topic);

    // TODO error check for user inputs

    List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow
        .getGraph());
    final org.xmlpull.v1.builder.XmlElement inputs = builder
        .newFragment("inputs");
    for (int i = 0; i < inputNodes.size(); i++) {
      InputNode inputNode = inputNodes.get(i);
      XBayaTextField parameterTextField = this.parameterTextFields.get(i);
      String id = inputNode.getID();
      String value = parameterTextField.getText();
      org.xmlpull.v1.builder.XmlElement input = inputs.addElement(id);
      input.addChild(value);
    }

    final String scriptString = this.script.getScript();
    final String topicString = topic;
    new Thread() {
      /**
       * @see java.lang.Thread#run()
       */
      @Override
      public void run() {
        try {
          MonitorConfiguration notifConfig = TavernaRunnerWindow.this.engine
              .getMonitor().getConfiguration();
          TavernaRunnerWindow.this.engine.getMonitor().start();
          notifConfig.setTopic(topicString);
          TavernaRunnerWindow.this.engine.getGUI()
              .addDynamicExecutionToolsToToolbar();
          new WorkflowInterpreter(TavernaRunnerWindow.this.engine,
              topicString).scheduleDynamically();
        } catch (XBayaException e) {
View Full Code Here

     */
    public void show() {
        this.workflow = this.engine.getWorkflow();
       

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(
                    ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }


        // Create input fields
        Collection<InputNode> inputNodes = GraphUtil
                .getInputNodes(this.workflow.getGraph());
        for (InputNode node : inputNodes) {
            String id = node.getID();
            QName parameterType = node.getParameterType();
            JLabel nameLabel = new JLabel(id);
            JLabel typeField = new JLabel(parameterType.getLocalPart());
            XBayaTextField paramField = new XBayaTextField();
            Object value = node.getDefaultValue();

            String valueString;
            if (value == null) {
                valueString = "";
            } else {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }
            paramField.setText(valueString);
            this.parameterPanel.add(nameLabel);
            this.parameterPanel.add(typeField);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
        }
        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE,
                2);

        this.topicTextField.setText(notifConfig.getTopic());

        XBayaConfiguration config = this.engine.getConfiguration();
        this.gfacTextField.setText(config.getGFacURL().toString());
        URI registryURL = config.getXRegistryURL();
        if(null != registryURL){
View Full Code Here

        // find it.
        URI workfowInstanceID = URI.create(StringUtil
                .convertToJavaIdentifier(topic));
        this.workflow.setGPELInstanceID(workfowInstanceID);

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        notifConfig.setTopic(topic);
        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
        arguments.add(topic);

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow
                .getGraph());
        final org.xmlpull.v1.builder.XmlElement inputs = builder.newFragment("inputs");
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            org.xmlpull.v1.builder.XmlElement input = inputs.addElement(id);
            input.addChild(value);
        }
        
       
        final String xregistryUrl = this.xRegistryTextField.getText();
        if( null != xregistryUrl && !"".equals(xregistryUrl)){
          try {
        this.engine.getConfiguration().setXRegistryURL(new URI(xregistryUrl));
      } catch (URISyntaxException e) {
        this.engine.getErrorWindow().error(e);
      }
        }
       
        final String gFacUrl = this.gfacTextField.getText();
        if( null != gFacUrl && !"".equals(gFacUrl)){
          try {
        this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
      } catch (URISyntaxException e) {
        this.engine.getErrorWindow().error(e);
      }
        }
       
       
       
       
       
        final String topicString = topic;
        new Thread() {
        /**
         * @see java.lang.Thread#run()
         */
        @Override
        public void run() {
          try {
            MonitorConfiguration notifConfig = DynamicWorkflowRunnerWindow.this.engine.getMonitor()
                    .getConfiguration();
            DynamicWorkflowRunnerWindow.this.engine.getMonitor().start();
            notifConfig.setTopic(topicString);
            DynamicWorkflowRunnerWindow.this.engine.getGUI().addDynamicExecutionToolsToToolbar();
            new WorkflowInterpreter(DynamicWorkflowRunnerWindow.this.engine).scheduleDynamically(topicString);           
          } catch (XBayaException e) {
            DynamicWorkflowRunnerWindow.this.engine.getErrorWindow().error(e);
          }
View Full Code Here

   */
  public void show() {
    this.workflow = this.engine.getWorkflow();

    XBayaConfiguration configuration = this.engine.getConfiguration();
    MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
        .getConfiguration();

    // Topic
    String topic = monitorConfiguration.getTopic();
    if (topic != null) {
      this.topicTextField.setText(topic);
    } else {
      this.topicTextField.setText(UUID.randomUUID().toString());
    }
View Full Code Here

            return;
        }

        // Change the topic so that messages won't be mixed up with ones for the
        // original workflow.
        MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
                .getConfiguration();
        String newTopic = monitorConfiguration.getTopic() + "-diff";
        monitorConfiguration.setTopic(newTopic);

        // Invoke the workflow without showing the dialog.
        GPELInvoker invoker = new GPELInvoker(this.engine);

        try {
View Full Code Here

        .getGPELInstanceID());
    leadContextHelper.setWorkflowTemplateID(engine.getWorkflow()
       
        .getUniqueWorkflowName());

    MonitorConfiguration monitorConfig = engine.getMonitor().getConfiguration();
    String TOPIC = "d25edf16-499c-4bb6-832f-b2b21d50fabe";
    monitorConfig.setTopic(TOPIC);
    leadContextHelper.setMonitorConfiguration(monitorConfig);

    LeadContextHeader leadContext = leadContextHelper
        .getLeadContextHeader();
   
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

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.