update task phase, state value accordingly.