You should use CSTask.chooseTransition().
To the original poster: Look in the javadocs. Make an effort.