Package org.apache.oodt.cas.workflow.gui.model

Examples of org.apache.oodt.cas.workflow.gui.model.ModelNode


    }
  }

  private void saveGraph(ModelGraph graph, Element parentElem, Document document)
      throws FileNotFoundException, ParserConfigurationException {
    ModelNode node = graph.getModel();

    Element workflowElem = document.createElement(node.getExecutionType());
    parentElem.appendChild(workflowElem);

    if (node.isRef()) {
      workflowElem.setAttribute("id-ref", node.getModelId());
      if (node.getAlias() != null) {
        workflowElem.setAttribute("alias", node.getAlias());
      }
      saveConfiguration(node, workflowElem, document);
    } else {
      workflowElem.setAttribute("id", node.getModelId());
      workflowElem.setAttribute("name", node.getModelName());
      if (node.getInstanceClass() != null) {
        workflowElem.setAttribute("class", node.getInstanceClass());
      }

      saveConfiguration(node, workflowElem, document);

      // handle preconditions
      if (graph.getPreConditions() != null) {
        Element preConditions = document.createElement("conditions");
        workflowElem.appendChild(preConditions);
        preConditions.setAttribute("type", "pre");
        preConditions.setAttribute("execution", graph.getPreConditions()
            .getModel().getExecutionType());
        preConditions.setAttribute("timeout", String.valueOf(graph.getModel().getTimeout()));
        preConditions.setAttribute("optional", String.valueOf(graph.getModel().isOptional()));
        for (ModelGraph preCondition : graph.getPreConditions().getChildren()) {
          saveGraph(preCondition, preConditions, document);
        }
      }

      // handle subprocessors
      for (ModelGraph subProcessor : graph.getChildren()) {
        saveGraph(subProcessor, workflowElem, document);
      }

      // handle postconditions
      if (graph.getPostConditions() != null) {
        Element postConditions = document.createElement("conditions");
        workflowElem.appendChild(postConditions);
        postConditions.setAttribute("type", "post");
        postConditions.setAttribute("execution", graph.getPostConditions()
            .getModel().getExecutionType());
        postConditions.setAttribute("timeout", String.valueOf(graph.getModel().getTimeout()));
        postConditions.setAttribute("optional", String.valueOf(graph.getModel().isOptional()));
        for (ModelGraph postCondition : graph.getPostConditions().getChildren()) {
          saveGraph(postCondition, postConditions, document);
        }
      }
    }
    if (!node.getExcusedSubProcessorIds().isEmpty()) {
      workflowElem.setAttribute("excused",
          StringUtils.join(node.getExcusedSubProcessorIds(), ","));
    }
    if (node.isEntryPoint()) {
      workflowElem.setAttribute("entryPoint", "true");
    }
  }
View Full Code Here


      if (!supportedProcessorIds.contains(executionType))
        LOG.log(Level.WARNING, "Unsupported execution type id '"
            + executionType + "'");

      ModelNode modelNode = new ModelNode(workflowNode.getFile());
      modelNode.setModelId(modelId);
      modelNode.setModelName(modelName);
      modelNode.setExecutionType(executionType);
      modelNode.setStaticMetadata(staticMetadata);
      modelNode.setExcusedSubProcessorIds(excused);
      modelNode.setInstanceClass(clazz);
      modelNode.setEntryPoint(entryPoint);
      modelNode.setTimeout(timeout);
      modelNode.setOptional(optional);

      loadConfiguration(rootElements, workflowNode, modelNode, globalConfGroups);

      graph = new ModelGraph(modelNode);
View Full Code Here

  public static boolean isDummyNode(ModelNode node) {
    return node.getModelId().startsWith("DUMMY-");
  }

  public static ModelNode createDummyNode() {
    ModelNode dummy = new ModelNode(null, "DUMMY-"
        + dummyUntitledIter.getAndIncrement());
    dummy.setTextVisible(false);
    return dummy;
  }
View Full Code Here

    }

    private void createNewGraph(String actionCommand) {
      ModelGraph newGraph = null;
      if (actionCommand.equals(NEW_TASK_ITEM_NAME)) {
        newGraph = new ModelGraph(new ModelNode(state.getFile(),
            GuiUtils.createUniqueName()));
      } else if (actionCommand.equals(NEW_PARALLEL_ITEM_NAME)) {
        ModelNode node = new ModelNode(state.getFile(),
            GuiUtils.createUniqueName());
        node.setExecutionType("parallel");
        newGraph = new ModelGraph(node);
      } else if (actionCommand.equals(NEW_SEQUENTIAL_ITEM_NAME)) {
        ModelNode node = new ModelNode(state.getFile(),
            GuiUtils.createUniqueName());
        node.setExecutionType("sequential");
        newGraph = new ModelGraph(node);
      } else {
        return;
      }
      Object cell = GraphView.this.jgraph.getSelectionCell();
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.gui.model.ModelNode

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.