Package org.apache.uima.flow

Examples of org.apache.uima.flow.Step


      if (currentStep >= mSequence.size()) {
        return new FinalStep(); // this CAS has finished the sequence
      }

      // if next step is a CasMultiplier, set wasPassedToCasMultiplier to true for next time
      Step nextStep = (Step)mSequence.get(currentStep++);
      if (stepContainsCasMultiplier(nextStep))
      {
        wasPassedToCasMultiplier = true;
      }
View Full Code Here


   */
  public void removeAnalysisEngines(Collection aKeys) throws AnalysisEngineProcessException {
    //Remove keys from Sequence
    int i = 0;
    while (i < mSequence.size()) {
      Step step = (Step)mSequence.get(i);
      if (step instanceof SimpleStep && aKeys.contains(((SimpleStep)step).getAnalysisEngineKey())) {
        mSequence.remove(i);
      }
      else if (step instanceof ParallelStep) {
        Collection keys = new ArrayList(((ParallelStep)step).getAnalysisEngineKeys());
View Full Code Here

      if (currentStep >= mSequence.size()) {
        return new FinalStep(); // this CAS has finished the sequence
      }

      // if next step is a CasMultiplier, set wasPassedToCasMultiplier to true for next time
      Step nextStep = (Step)mSequence.get(currentStep++);
      if (stepContainsCasMultiplier(nextStep))
        wasPassedToCasMultiplier = true;

      // now send the CAS to the next AE(s) in sequence.
      return nextStep;
View Full Code Here

   * @see org.apache.uima.flow.FlowController_ImplBase#removeAnalysisEngines(java.util.Collection)
   */
  public void removeAnalysisEngines(Collection aKeys) throws AnalysisEngineProcessException {
    //Remove keys from Sequence
    for (int i = 0; i < mSequence.size(); ++i) {
      Step step = (Step)mSequence.get(i);
      if (step instanceof SimpleStep && aKeys.contains(((SimpleStep)step).getAnalysisEngineKey())) {
        mSequence.set(i, null);
      }
      else if (step instanceof ParallelStep) {
        Collection keys = new ArrayList(((ParallelStep)step).getAnalysisEngineKeys());
View Full Code Here

        wasPassedToCasMultiplier = false;
        casMultiplierProducedNewCas = false;
      }

      // Get next in sequence, skipping any disabled ones
      Step nextStep;
      do {
        if (currentStep >= mSequence.size()) {
          return new FinalStep(); // this CAS has finished the sequence
        }
        nextStep = (Step) mSequence.get(currentStep++);
View Full Code Here

   * @see org.apache.uima.flow.FlowController_ImplBase#removeAnalysisEngines(java.util.Collection)
   */
  public synchronized void removeAnalysisEngines(Collection aKeys) throws AnalysisEngineProcessException {
    // Remove keys from Sequence ... replace with null so step indices are still valid
    for (int i = 0; i < mSequence.size(); ++i) {
      Step step = (Step)mSequence.get(i);
      if (step instanceof SimpleStep && aKeys.contains(((SimpleStep)step).getAnalysisEngineKey())) {
        mSequence.set(i, null);
      }
      else if (step instanceof ParallelStep) {
        Collection keys = new ArrayList(((ParallelStep)step).getAnalysisEngineKeys());
View Full Code Here

        wasPassedToCasMultiplier = false;
        casMultiplierProducedNewCas = false;
      }

      // Get next in sequence, skipping any disabled ones
      Step nextStep;
      synchronized (AdvancedFixedFlowController.this) {
        do {
          if (currentStep >= mSequence.size()) {
            return new FinalStep(); // this CAS has finished the sequence
          }
View Full Code Here

    return endpoint;
  }

  private void executeFlowStep(FlowContainer aFlow, String aCasReferenceId, boolean newCAS)
          throws AsynchAEException {
    Step step = null;
    try {
      //  Guard a call to next(). Allow one thread and block the rest
      synchronized( flowControllerContainer ) {
        step = aFlow.next();
      }
View Full Code Here

          // record active CASes in case we encounter an exception and need to release them
          activeCASes.add(cas);

          // get next CAS Processor to route to
          Step nextStep = flow.next();

          // repeat until we reach a FinalStep
          while (!(nextStep instanceof FinalStep)) {
            if (nextStep instanceof SimpleStep) {
              String nextAeKey = ((SimpleStep) nextStep).getAnalysisEngineKey();
              AnalysisEngine nextAe = (AnalysisEngine) mComponentAnalysisEngineMap.get(nextAeKey);
              if (nextAe != null) {
                // invoke next AE in flow
                CasIterator casIter;
                casIter = nextAe.processAndOutputNewCASes(cas);
                if (casIter.hasNext()) // new CASes are output
                {
                  // get the first output CAS
                  CAS outputCas = casIter.next();
                  // push the CasIterator, original CAS, and Flow onto a stack so we
                  // can get the other output CASes and the original CAS later
                  casIteratorStack.push(new StackFrame(casIter, cas, flow, nextAeKey));
                  // compute Flow for the output CAS
                  flow = flow.newCasProduced(outputCas, nextAeKey);
                  // now route the output CAS through the flow
                  cas = outputCas;
                  activeCASes.add(cas);
                } else {
                  // no new CASes are output; this cas is done being processed
                  // by that AnalysisEngine so clear the componentInfo
                  cas.setCurrentComponentInfo(null);
                }
              } else {
                throw new AnalysisEngineProcessException(
                        AnalysisEngineProcessException.UNKNOWN_ID_IN_SEQUENCE,
                        new Object[] { nextAeKey });
              }
            } else {
              throw new AnalysisEngineProcessException(
                      AnalysisEngineProcessException.UNSUPPORTED_STEP_TYPE, new Object[] { nextStep
                              .getClass() });
            }
            nextStep = flow.next();
          }
          // FinalStep was returned from FlowController.
View Full Code Here

    return endpoint;
  }

  private void executeFlowStep(FlowContainer aFlow, String aCasReferenceId, boolean newCAS)
          throws AsynchAEException {
    Step step = null;
    try {
      //  Guard a call to next(). Allow one thread and block the rest
      synchronized( flowControllerContainer ) {
        step = aFlow.next();
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.flow.Step

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.