uima-ducc-common/src/main/java/org/apache/uima/ducc/common/uima/DuccJobProcessFC.java [150:184]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Step next() throws AnalysisEngineProcessException {

      // If this is a work item CAS in a pipeline with an initial CM that has just been
      // to the CM then check if it should be sent to the last step, e.g. the CC.
      if (mStartsWithCasMultiplier && !internallyCreatedCas && currentStep == 1) {
        // Parent CAS has been to the initial CM, so see if a special flow has been requested.
        // Get an iterator only if the Workitem type is in the CAS's typesystem 
        // (avoids JCAS_TYPE_NOT_IN_CAS error)
 
    	FSIterator<FeatureStructure> it = this.getCas().getIndexRepository().getAllIndexedFS(mWorkitemType);
        if (it.isValid()) {
          FeatureStructure wi = it.get();
          it.moveToNext();
          if (it.isValid()) {
            throw new IllegalStateException("More than one instance of Workitem type");
          }
          if (wi.getBooleanValue(mSendToAllFeature)) {
        	// send WI-CAS to all delegates 
          }
          else if (wi.getBooleanValue(mSendToLastFeature)) {
        	// 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++));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



uima-ducc-user/src/main/java/org/apache/uima/ducc/FlowController.java [150:184]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Step next() throws AnalysisEngineProcessException {

      // If this is a work item CAS in a pipeline with an initial CM that has just been
      // to the CM then check if it should be sent to the last step, e.g. the CC.
      if (mStartsWithCasMultiplier && !internallyCreatedCas && currentStep == 1) {
        // Parent CAS has been to the initial CM, so see if a special flow has been requested.
        // Get an iterator only if the Workitem type is in the CAS's typesystem 
        // (avoids JCAS_TYPE_NOT_IN_CAS error)
 
    	FSIterator<FeatureStructure> it = this.getCas().getIndexRepository().getAllIndexedFS(mWorkitemType);
        if (it.isValid()) {
          FeatureStructure wi = it.get();
          it.moveToNext();
          if (it.isValid()) {
            throw new IllegalStateException("More than one instance of Workitem type");
          }
          if (wi.getBooleanValue(mSendToAllFeature)) {
        	// send WI-CAS to all delegates 
          }
          else if (wi.getBooleanValue(mSendToLastFeature)) {
        	// 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++));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



