Examples of FinalStep


Examples of org.apache.uima.flow.FinalStep

      // if CAS was passed to a CAS multiplier on the last step, special processing
      // is needed according to the value of the ActionAfterCasMultiplier config parameter
      if (wasPassedToCasMultiplier) {
        switch (mActionAfterCasMultiplier) {
          case ACTION_STOP:
            return new FinalStep();
          case ACTION_DROP:
            return new FinalStep(internallyCreatedCas);
          case ACTION_DROP_IF_NEW_CAS_PRODUCED:
            if (casMultiplierProducedNewCas) {
              return new FinalStep(internallyCreatedCas);
            }
            // else, continue with flow
            break;
          // if action is ACTION_CONTINUE, just continue with flow
        }
        wasPassedToCasMultiplier = false;
        casMultiplierProducedNewCas = false;
      }

      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
      // TODO: optimize
      AnalysisEngineMetaData md = (AnalysisEngineMetaData) getContext()
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

        // null is a special flag saying the previous component result spec is still good
        return new SimpleStepWithResultSpec(node.getCasProcessorKey(), null);
//        return new SimpleStepWithResultSpec(component, neededResultSpec); // for testing with caching disabled
      }
//    }
    return new FinalStep();
  }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

    public Step next() throws AnalysisEngineProcessException {
      if (i < keys.size()) {
        return new SimpleStep(keys.get(i++));
      }

      return new FinalStep();
    }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

    }
  }

  public static class TestFlowObject extends CasFlow_ImplBase {
    public Step next() throws AnalysisEngineProcessException {
      return new FinalStep();
    }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

    public Step next() throws AnalysisEngineProcessException {
      if (i < keys.size()) {
        return new SimpleStep(keys.get(i++));
      }

      return new FinalStep();
    }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

          // send to last delegate only
          currentStep = mSequence.size() - 1;
          }
        }
        // No Workitem FS in CAS, WI-CAS is at end of flow
        else return new FinalStep();
      }

      if (currentStep >= mSequence.size()) {
        return new FinalStep(); // this CAS is cooked
      }

      // Send to next component in pipeline
      return new SimpleStep((String)mSequence.get(currentStep++));
    }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

        // null is a special flag saying the previous component result spec is still good
        return new SimpleStepWithResultSpec(node.getCasProcessorKey(), null);
//        return new SimpleStepWithResultSpec(component, neededResultSpec); // for testing with caching disabled
      }
//    }
    return new FinalStep();
  }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

                    new Object[] { getComponentName(), casStateEntry.getCasReferenceId(),
                        casStateEntry.getSubordinateCasInPlayCount() });
          }
          casStateEntry.setReplyReceived();
          // Force the CAS to go to the Final Step where it will be dropped
          finalStep(new FinalStep(), casStateEntry.getCasReferenceId());
          return true; // Done here
        }
      } else if (casStateEntry.isFailed()) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(
                  Level.FINE,
                  CLASS_NAME.getName(),
                  "abortProcessingCas",
                  UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_forcing_cas_to_finalstep__FINE",
                  new Object[] { getComponentName(), casStateEntry.getCasReferenceId(),
                      casStateEntry.getSubordinateCasInPlayCount() });
        }
        casStateEntry.setReplyReceived();
        // move this CAS to the final step
        finalStep(new FinalStep(), casStateEntry.getCasReferenceId());
        return true;
      }

    } catch (Exception e) {
      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

      currentStep = startStep;
    }

    public Step next() throws AnalysisEngineProcessException {
      if (currentStep >= mSequence.length) {
        return new FinalStep(); // this CAS has finished the sequence
      }
      // If CAS was segmented, do not continue with flow. The individual segments
      // are processed further but the original CAS is not.
      // TODO: should be configurable.
      if (wasSegmented) {
        return new FinalStep();
      }

      // otherwise, we just send the CAS to the next AE in sequence.
      return new SimpleStep(mSequence[currentStep++]);
    }
View Full Code Here

Examples of org.apache.uima.flow.FinalStep

      // if CAS was passed to a CAS multiplier on the last step, special processing
      // is needed according to the value of the ActionAfterCasMultiplier config parameter
      if (wasPassedToCasMultiplier) {
        switch (mActionAfterCasMultiplier) {
          case ACTION_STOP:
            return new FinalStep();
          case ACTION_DROP:
            return new FinalStep(internallyCreatedCas);
          case ACTION_DROP_IF_NEW_CAS_PRODUCED:
            if (casMultiplierProducedNewCas) {
              return new FinalStep(internallyCreatedCas);
            }
            // else, continue with flow
            break;
          // if action is ACTION_CONTINUE, just continue with flow
        }
        wasPassedToCasMultiplier = false;
        casMultiplierProducedNewCas = false;
      }

      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)) {
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.