private WorkerOp nextOp(){
  if (complete)   return WorkerOp.NO_OP;
  if (isReady()) {
    if (needCommit)     return WorkerOp.COMMIT;
 else     if (needWindow)     return WorkerOp.WINDOW;
 else     if (endOfStream)     return WorkerOp.END_OF_STREAM;
 else     if (!pendingEnvelopQueue.isEmpty())     return WorkerOp.PROCESS;
  }
  return WorkerOp.NO_OP;
}

private WorkerOp nextOp ( ) { if ( complete ) return WorkerOp . NO_OP ; if ( isReady ( ) ) { if ( needCommit ) return WorkerOp . COMMIT ; else if ( needWindow ) return WorkerOp . WINDOW ; else if ( endOfStream ) return WorkerOp . END_OF_STREAM ; else if ( ! pendingEnvelopQueue . isEmpty ( ) ) return WorkerOp . PROCESS ; } return WorkerOp . NO_OP ; }
returns the next operation by this taskworker
