Package org.apache.uima.analysis_engine.metadata

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


      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)
        nodesModel.setFlow(nodes = stringArray0);
      // add them to the list
      for (int i = 0; i < nodes.length; i++) {
        TableItem item = new TableItem(flowList, SWT.NONE);
        item.setImage(TAEConfiguratorPlugin.getImage(TAEConfiguratorPlugin.IMAGE_ANNOTATOR) //$NON-NLS-1$
                );
        item.setText(0, nodes[i]);
      }
      packTable(flowList);

      if (null == fcd) {
        // Not a custom, user-defined flow
        FixedFlow ff;
        if (null == flowConstraints) {
          // force fixed flow if nothing is specified
          getAnalysisEngineMetaData().setFlowConstraints(
                  flowConstraints = ff = new FixedFlow_impl());
          ff.setFixedFlow(stringArray0);
        }
        String modelFlowType = flowConstraints.getFlowConstraintsType();

        flowControllerChoice.setText(modelFlowType
                .equals(CapabilityLanguageFlow.FLOW_CONSTRAINTS_TYPE) ? CAPABILITY_LANGUAGE_FLOW
                : FIXED_FLOW);
View Full Code Here


      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;
        }
View Full Code Here

   *
   * @param node
   *          the key of the delegate
   */
  public void addNode(String node) {
    FlowConstraints flowConstraints = getModelFlow();
    if (null == flowConstraints) {
      // no constraints declared
      // set up Fix Flow style of constraints
      //   This can happen if the style is user-defined flow
      flowConstraints = UIMAFramework.getResourceSpecifierFactory().createFixedFlow();
View Full Code Here

  public Button getUpButton() {
    return upButton;
  }

  public void removeAll() {
    FlowConstraints flow = getModelFlow();
    if (flow != null) {
      flow.setAttributeValue("fixedFlow", new String[0]); //$NON-NLS-1$
      editor.setFileDirty();
      editor.getAggregatePage().getAggregateSection().refresh();
    }
  }
View Full Code Here

              ResourceInitializationException.AGGREGATE_AE_TYPE_SYSTEM,
              new Object[] { getSourceUrlString() });
    }
   
    //Keys in FixedFlow or LanguageCapabilityFlow must be defined
    FlowConstraints fc = getAnalysisEngineMetaData().getFlowConstraints();
    String[] keys = null;
    if (fc instanceof FixedFlow) {
      keys = ((FixedFlow)fc).getFixedFlow();
    }
    else if (fc instanceof CapabilityLanguageFlow) {
View Full Code Here

      // If there's a standard flow type, use that order, then call components not in flow
      // at the end in arbitrary order.  If there's no standard flow type
      // (a custom FlowController must be in use), the entire order is arbitrary.
      String[] orderedNodes = null;
      Map<String, AnalysisEngine> components = new HashMap<String, AnalysisEngine>(this._getASB().getComponentAnalysisEngines());
      FlowConstraints flow = getAnalysisEngineMetaData().getFlowConstraints();
      if (flow != null) {
        if (flow instanceof FixedFlow) {
          orderedNodes = ((FixedFlow)flow).getFixedFlow();
        }
        else if (flow instanceof CapabilityLanguageFlow) {
View Full Code Here

  public static List<String> abortedDocuments = new ArrayList<String>();
  public static List<String> failedAEs = new ArrayList<String>();

  public void initialize(FlowControllerContext aContext) throws ResourceInitializationException {
    super.initialize(aContext);
    FlowConstraints flowConstraints = aContext.getAggregateMetadata().getFlowConstraints();
    mSequence = ((FixedFlow) flowConstraints).getFixedFlow();
    Boolean paramVal = (Boolean)aContext.getConfigParameterValue(PARAM_CONTINUE_ON_FAILURE);
    mContinueOnFailure = paramVal != null && paramVal.booleanValue();
  }
View Full Code Here

public class SegmentDroppingFlowController extends CasFlowController_ImplBase {
  String[] mSequence;

  public void initialize(FlowControllerContext aContext) throws ResourceInitializationException {
    super.initialize(aContext);
    FlowConstraints flowConstraints = aContext.getAggregateMetadata().getFlowConstraints();
    mSequence = ((FixedFlow) flowConstraints).getFixedFlow();
  }
View Full Code Here

      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)
        nodesModel.setFlow(nodes = stringArray0);
      // add them to the list
      for (int i = 0; i < nodes.length; i++) {
        TableItem item = new TableItem(flowList, SWT.NONE);
        item.setImage(TAEConfiguratorPlugin.getImage(TAEConfiguratorPlugin.IMAGE_ANNOTATOR) //$NON-NLS-1$
                );
        item.setText(0, nodes[i]);
      }
      packTable(flowList);

      if (null == fcd) {
        // Not a custom, user-defined flow
        FixedFlow ff;
        if (null == flowConstraints) {
          // force fixed flow if nothing is specified
          getAnalysisEngineMetaData().setFlowConstraints(
                  flowConstraints = ff = new FixedFlow_impl());
          ff.setFixedFlow(stringArray0);
        }
        String modelFlowType = flowConstraints.getFlowConstraintsType();

        flowControllerChoice.setText(modelFlowType
                .equals(CapabilityLanguageFlow.FLOW_CONSTRAINTS_TYPE) ? CAPABILITY_LANGUAGE_FLOW
                : FIXED_FLOW);
View Full Code Here

      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;
        }
View Full Code Here

TOP

Related Classes of org.apache.uima.analysis_engine.metadata.FlowConstraints

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.