private void run(){
switch (state.nextOp()) {
case PROCESS:
    process();
  break;
case WINDOW:
window();
break;
case COMMIT:
commit();
break;
case END_OF_STREAM:
endOfStream();
break;
default :
break;
}
}

private void run ( ) { switch ( state . nextOp ( ) ) { case PROCESS : process ( ) ; break ; case WINDOW : window ( ) ; break ; case COMMIT : commit ( ) ; break ; case END_OF_STREAM : endOfStream ( ) ; break ; default : break ; } }
invoke next task operation based on its state
