Package edu.indiana.extreme.xbaya.wf

Examples of edu.indiana.extreme.xbaya.wf.Workflow


    }

    private Workflow createWorkflow() throws ComponentException,
            GraphException, ComponentRegistryException {

        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("ADASInitializedWRFForecast");
        workflow.setDescription("");

        WSGraph graph = workflow.getGraph();

        LocalComponentRegistry componentRegistry = new LocalComponentRegistry(
                WSDL_DIRECTORY);

        // WRF_STATIC_PREPROCESSOR_WSDL
        Component wrfPreComp = componentRegistry
                .getComponent(WRF_STATIC_PREPROCESSOR_WSDL);
        Node wrfPreNode = workflow.addNode(wrfPreComp);
        wrfPreNode.setPosition(new Point(313, 0));

        // TERRAIN_PREPROCESSOR_WSDL
        Component terrainPreComp = componentRegistry
                .getComponent(TERRAIN_PREPROCESSOR_WSDL);
        Node terrainPreNode = workflow.addNode(terrainPreComp);
        terrainPreNode.setPosition(new Point(59, 289));

        // ADAS_INTERPOLATOR_WSDL
        Component adasIntComp = componentRegistry
                .getComponent(ADAS_INTERPOLATOR_WSDL);
        Node adasIntNode = workflow.addNode(adasIntComp);
        adasIntNode.setPosition(new Point(373, 235));

        // LATERAL_BOUNDARY_INTERPOLATOR_WSDL
        Component lateralIntComp = componentRegistry
                .getComponent(LATERAL_BOUNDARY_INTERPOLATOR_WSDL);
        Node lateralIntNode = workflow.addNode(lateralIntComp);
        lateralIntNode.setPosition(new Point(371, 369));

        // ARPS2WRF_INTERPOLATOR_WSDL
        Component arp2wrfComp = componentRegistry
                .getComponent(ARPS2WRF_INTERPOLATOR_WSDL);
        Node arp2wrfNode = workflow.addNode(arp2wrfComp);
        arp2wrfNode.setPosition(new Point(607, 104));

        // WRF_FORECASTING_MODEL_WSDL
        Component wrfComp = componentRegistry
                .getComponent(WRF_FORECASTING_MODEL_WSDL);
        Node wrfNode = workflow.addNode(wrfComp);
        wrfNode.setPosition(new Point(781, 14));

        // Parameters
        Component inputComponent = new InputComponent();
        Component outputComponent = new OutputComponent();

        // Input parameter node
        InputNode confInput = (InputNode) workflow.addNode(inputComponent);
        confInput.setPosition(new Point(0, 100));

        // Input parameter node
        InputNode adasInput = (InputNode) workflow.addNode(inputComponent);
        adasInput.setPosition(new Point(286, 145));

        // Input parameter node
        InputNode namInput = (InputNode) workflow.addNode(inputComponent);
        namInput.setPosition(new Point(179, 438));

        // Output parameter
        OutputNode outParamNode = (OutputNode) workflow
                .addNode(outputComponent);
        outParamNode.setPosition(new Point(863, 169));

        // Connect ports
        graph.addEdge(confInput.getOutputPort(0), wrfPreNode.getInputPort(0));
View Full Code Here


  private void handleSubWorkComponent(Node node) throws XBayaException {
    if (this.mode == GUI_MODE) {
      ((SubWorkflowNodeGUI) node.getGUI()).openWorkflowTab(this.engine);
    }
    // setting the inputs
    Workflow subWorkflow = ((SubWorkflowNode) node).getWorkflow();
    // List<WSComponentPort> subWorkflowdInputs = new ODEClient()
    // .getInputs(subWorkflow);
    ArrayList<Node> subWorkflowInputNodes = getInputNodes(subWorkflow);

    List<DataPort> inputPorts = node.getInputPorts();
View Full Code Here

          /**
           * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
           */
          public void actionPerformed(ActionEvent e1) {
            try {
          Workflow workflow = engine.getWorkflow();
          XBayaExecutionState executionState = workflow.getExecutionState();
          if(executionState == XBayaExecutionState.RUNNING ||
              executionState == XBayaExecutionState.STEP){
            workflow.setExecutionState(XBayaExecutionState.PAUSED);
            play.setIcon(PLAY_ICON);
          }else if(executionState == XBayaExecutionState.PAUSED){
            workflow.setExecutionState(XBayaExecutionState.RUNNING);
            play.setIcon(PAUSE_ICON);
          }else{
            throw new IllegalStateException("Unknown state :"+executionState);
          }
        } catch (RuntimeException e) {
View Full Code Here

  private void ok() {
    OGCEXRegistrySearchResult result = this.list.getSelectedValue();
    hide();

    try {
      Workflow workflow = new XRegistryAccesser(this.engine)
          .getOGCEWorkflow(result.getData().getResourceID());
      OGCEXRegistryLoaderWindow.this.engine.setWorkflow(workflow);
    } catch (Exception e) {
      OGCEXRegistryLoaderWindow.this.engine.getErrorWindow().error(e);
    }
View Full Code Here

 
  public void invoke(String operationName, WsdlDefinitions wsdl, String name, String topic){
    ODEClient odeClient = new ODEClient();
    GSSCredential credential = SecurityUtil.getGSSCredential("chathura", "changeme", XBayaConstants.DEFAULT_MYPROXY_SERVER);
    XRegistryAccesser xregistryAccesser = new XRegistryAccesser(credential, XBayaConstants.DEFAULT_XREGISTRY_URL);
    Workflow workflow = xregistryAccesser.getWorkflow(name);
   
    GsiInvoker secureInvoker = null;
    secureInvoker = new GsiInvoker(credential, XBayaSecurity
        .getTrustedCertificates());
View Full Code Here

     * @throws IOException
     */
    public void testComplexMath() throws GraphException, ComponentException,
            IOException {

        Workflow workflow = createComplexMathWorkflow();
        File workflowFile = new File(this.temporaryDirectory,
                "web-complex-math.xwf");
        XMLUtil.saveXML(workflow.toXML(), workflowFile);

        // Load the same graph again from the file, saves it, and compare them.
        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
        Workflow workflow2 = new Workflow(workflowElement);
        File workflowFile2 = new File(this.temporaryDirectory,
                "web-complex-math-2.xwf");
        XMLUtil.saveXML(workflow2.toXML(), workflowFile2);

        String workflowFileString = IOUtil.readFileToString(workflowFile);
        String workflowFile2String = IOUtil.readFileToString(workflowFile2);
        assertEquals(workflowFileString, workflowFile2String);

View Full Code Here

     * @return The graph
     * @throws GraphException
     */
    private Workflow createComplexMathWorkflow() throws GraphException {

        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("Complex math workflow");
        workflow.setDescription("Complex math workflow");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component adderComp = this.componentRegistry.getComponents(
                MATH_ADDER_WSDL).get(0);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        Node adderNode2 = workflow.addNode(adderComp);
        adderNode2.setPosition(new Point(170, 210));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponents(
                MATH_MULTIPLIER_WSDL).get(0);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Parameter node 1
        InputNode paramNode1 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode1.setPosition(new Point(20, 30));
        String paramValue1 = "2";
        paramNode1.setDefaultValue(paramValue1);

        // Parameter node 2
        InputNode paramNode2 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode2.setPosition(new Point(20, 100));
        String paramValue2 = "3";
        paramNode2.setDefaultValue(paramValue2);

        // Parameter node 3
        InputNode paramNode3 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode3.setPosition(new Point(20, 170));
        String paramValue3 = "4";
        paramNode3.setDefaultValue(paramValue3);

        // Parameter node 4
        InputNode paramNode4 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode4.setPosition(new Point(20, 240));
        String paramValue4 = "5";
        paramNode4.setDefaultValue(paramValue4);

        OutputNode outParamNode = (OutputNode) workflow
                .addNode(this.outputComponent);
        outParamNode.setPosition(new Point(370, 240));

        // Connect ports
        graph.addEdge(paramNode1.getOutputPort(0), adderNode1.getInputPort(0));
View Full Code Here

  public static LeadContextHeader buildLeadContextHeader(
      final XBayaEngine engine, MonitorConfiguration monitorConfiguration, String nodeId, LeadResourceMapping resourceMapping)
      throws URISyntaxException {
   
    XBayaConfiguration configuration = engine.getConfiguration();
    Workflow workflow = engine.getWorkflow();
   
    LeadContextHeader leadContext = buildLeadContextHeader(workflow, configuration, engine.getMyLead(),
        monitorConfiguration, nodeId, resourceMapping);
   
    return leadContext;
View Full Code Here

   *
   */
  public Workflow load(URI templateID, WorkflowType workflowType)
      throws GraphException, WorkflowProxyException, ComponentException {

    Workflow workflow = null;
    String templateIDString = templateID.toString();

    // workflow template id is of the format
    // urn:uuid:<workflow_name>:date_as_long. Trying to extract
    // the workflow name from the template id now

    QName workflowQName;
    if (templateIDString.indexOf("urn:uuid") > -1) {
      int secondColonLocation = templateIDString.indexOf(":",
          templateIDString.indexOf(":") + 1);
      int thirdColonLocation = templateIDString.indexOf(":",
          secondColonLocation + 1);

      workflowQName = new QName(templateIDString, templateIDString
          .substring(secondColonLocation + 1, thirdColonLocation));
    } else {
      workflowQName = new QName(templateIDString);
    }

    XRegistryAccesser xregistryAccesser = new XRegistryAccesser(this.xbayaEngine);
    String templateAsString = xregistryAccesser.getWorkflow(workflowQName).toString();

    System.out.println("templateAsString = " + templateAsString);

    workflow = new Workflow(XMLUtil
        .stringToXmlElement(templateAsString));

    return workflow;
  }
View Full Code Here

      List<GraphCanvas> graphCanvases = this.engine.getGUI()
          .getGraphCanvases();
      for (GraphCanvas graphCanvas : graphCanvases) {
        if (oldWorkflowName.equals(graphCanvas.getWorkflow().getName())) {
          this.engine.getGUI().setFocus(graphCanvas);
          Workflow workflow2 = this.engine.getWorkflow();
          oldWorkflowID = workflow2.getGraph().getID();
          break;
        }
      }

      try {
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.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.