Examples of FlowControllerDeclaration


Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      flowControllerDesc = CapabilityLanguageFlowController.getDescription();
    } else {
      flowControllerDesc = FixedFlowController.getDescription();
    }

    FlowControllerDeclaration decl = new FlowControllerDeclaration_impl();
    decl.setKey("_FlowController");
    decl.setSpecifier(flowControllerDesc);
    return decl;
  }
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      getSection().setDescription(Messages.getString("FlowSection.onlyForAggregates")); //$NON-NLS-1$
    } else {
      getSection().setText(Messages.getString("FlowSection.ComponentEngineFlowTitle")); //$NON-NLS-1$
      getSection().setDescription(Messages.getString("FlowSection.ComponentEngineFlowDescription")); //$NON-NLS-1$

      FlowControllerDeclaration fcd = getFlowControllerDeclaration();
      flowList.setEnabled(true);
      FlowConstraints flowConstraints = getModelFlow();
      FlowNodes nodesModel = new FlowNodes(flowConstraints);
      String[] nodes = nodesModel.getFlow();
      if (null == nodes)
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      String flowTypeGUI = flowControllerChoice.getText();
      if (null == flowTypeGUI || flowTypeGUI.equals(S_))
        return;

      String prevFlowTypeGUI;
      FlowControllerDeclaration fcd = getFlowControllerDeclaration();
      FlowConstraints modelFlow = getModelFlow();
      if (null != fcd)
        prevFlowTypeGUI = USER_DEFINED_FLOW;
      else {
        if (null == modelFlow)
          prevFlowTypeGUI = "";
        else {
          String prevFlowType = modelFlow.getFlowConstraintsType();
          if (CapabilityLanguageFlow.FLOW_CONSTRAINTS_TYPE.equals(prevFlowType))
            prevFlowTypeGUI = CAPABILITY_LANGUAGE_FLOW;
          else
            prevFlowTypeGUI = FIXED_FLOW;
        }
      }

      if (prevFlowTypeGUI.equals(flowTypeGUI))
        return;

      CapabilityLanguageFlow clf = null;
      FixedFlow ff = null;

      String[] nodes = new FlowNodes(modelFlow).getFlow();

      if (flowTypeGUI.equals(CAPABILITY_LANGUAGE_FLOW)) {
        setFlowControllerDeclaration(null);
        getAnalysisEngineMetaData().setFlowConstraints(clf = new CapabilityLanguageFlow_impl());
        clf.setCapabilityLanguageFlow(nodes);
      } else if (flowTypeGUI.equals(FIXED_FLOW)) {
        setFlowControllerDeclaration(null);
        getAnalysisEngineMetaData().setFlowConstraints(ff = new FixedFlow_impl());
        ff.setFixedFlow(nodes);
      } else if (flowTypeGUI.equals(USER_DEFINED_FLOW)) {
        // use case: user set user-defined-flow from some other state.
        // user will have to fill in the import (CDE only supports that format)
        // flow nodes kept, put under "Fixed Flow" arbitrarily
        FlowControllerDeclaration newFcd = new FlowControllerDeclaration_impl();
        setFlowControllerDeclaration(newFcd);
        refreshFcd(newFcd);
        getAnalysisEngineMetaData().setFlowConstraints(ff = new FixedFlow_impl());
        ff.setFixedFlow(nodes);
      }
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

    }
  }

  private void handleHoverHelp(Event event) {
    String sDesc = "";
    FlowControllerDeclaration fcd = editor.getResolvedFlowControllerDeclaration();
    String text = flowControllerGUI.getText();
    if (null != fcd && !"".equals(text) && null != fcd.getSpecifier()) {
      sDesc = getDescriptionForDescriptor(flowControllerGUI.getText(), fcd.getSpecifier());
    }
    flowControllerGUI.setToolTipText(sDesc);
  }
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      downButton.setEnabled(false);
      flowChoiceLabel.setEnabled(false);
      flowControllerChoice.setEnabled(false);
      enableFlowControllerGUI(false);
    } else {
      FlowControllerDeclaration fcd = getFlowControllerDeclaration();
      enableFlowControllerGUI(null != fcd);
      flowControllerChoice.setEnabled(true);
      flowChoiceLabel.setEnabled(true);
      int items = flowList.getItemCount();
      int selection = flowList.getSelectionIndex();
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

    Import imp = createImport(fullPathFileName, isImportByName);

    // key is shortName plus a suffix if needed to make it unique.
    // The set of existing keys is obtained from the model,
    // not from the GUI table (as was the case in earlier design)
    FlowControllerDeclaration oldFcd = getFlowControllerDeclaration();
    setFlowControllerDeclaration(null);

    String keyName = produceUniqueComponentKey(shortName);
    if (null == keyName) {
      setFlowControllerDeclaration(oldFcd); // revert
      return;
    }

    XMLizable inputDescription = readImport(imp, fullPathFileName, isImportByName);
    if (null == inputDescription) {
      setFlowControllerDeclaration(oldFcd); // revert
      return;
    }

    if (!(inputDescription instanceof FlowControllerDescription)) {
      Utility.popMessage("Invalid kind of descriptor", MessageFormat.format(
              "Operation cancelled: The descriptor ''{0}'' being added is not a FlowController.",
              new Object[] { maybeShortenFileName(fullPathFileName) }), MessageDialog.ERROR);
      setFlowControllerDeclaration(oldFcd); // revert
      return;
    }

    FlowControllerDeclaration fcd = new FlowControllerDeclaration_impl();
    fcd.setKey(keyName);
    fcd.setImport(imp);
    setFlowControllerDeclaration(fcd);

    // before adding the import, see if the merge type system is OK
    if (!isValidAggregateChange()) {
      setFlowControllerDeclaration(oldFcd); // revert
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      Map.Entry entry = (Map.Entry) it.next();
      addSofasToAllComponentSofaMap(allComponentSofas, (String) entry.getKey(),
              (ResourceSpecifier) entry.getValue(), isInput);
    }
    // pick up any sofa info from flow controller
    FlowControllerDeclaration fcd = editor.getResolvedFlowControllerDeclaration();
    if (null != fcd) {
      addSofasToAllComponentSofaMap(allComponentSofas, fcd.getKey(), fcd.getSpecifier(), isInput);
    }

    // mark the bound ones with a value which is the aggr sofa they're bound to
    // also, add any that were not spec'd in the delegates (because
    // for instance, they were remote)
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

   * @return Unique key for a newly added descriptor file
   */
  protected String produceUniqueComponentKey(String fileName) {
    // get existing set of delegates from model, with imports
    Set existingKeyNames = new HashSet(getDelegateAnalysisEngineSpecifiersWithImports().keySet());
    FlowControllerDeclaration fcd = getFlowControllerDeclaration();
    if (null != fcd && null != fcd.getKey() && !"".equals(fcd.getKey()))
      existingKeyNames.add(fcd.getKey());
    String keyName = fileName;
    String keyNameLowerCase = keyName.toLowerCase();
    keyName = keyName.substring(0, keyNameLowerCase.indexOf(".xml"));
    if (!existingKeyNames.contains(keyName)) {
      return keyName;
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

      cpd = getAnalysisEngineMetaData().getConfigurationParameterDeclarations();
      for (Iterator it = editor.getResolvedDelegates().entrySet().iterator(); it.hasNext();) {
        addDelegateToGUI((Map.Entry) it.next());
      }
      FlowControllerDeclaration fcd = editor.getResolvedFlowControllerDeclaration();
      if (null != fcd) {
        addDelegateToGUI(fcd.getKey(), fcd.getSpecifier());
      }
      TreeItem[] items = tree.getItems();
      if (items.length > 0)
        // scrolls to top, also
        tree.setSelection(new TreeItem[] { items[0] });
View Full Code Here

Examples of org.apache.uima.analysis_engine.metadata.FlowControllerDeclaration

    asbParams.put(Resource.PARAM_AGGREGATE_SOFA_MAPPINGS, aAnalysisEngineDescription
            .getSofaMappings());

    // Get FlowController specifier from the aggregate descriptor. If none, use
    // default FixedFlow specifier.
    FlowControllerDeclaration flowControllerDecl = aAnalysisEngineDescription
            .getFlowControllerDeclaration();
    if (flowControllerDecl != null) {
      try {
        aAnalysisEngineDescription.getFlowControllerDeclaration().resolveImports(
                getResourceManager());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.