FlowStepDirection flowStepDirection = FlowStepDirection.get(originalIndex, newActivity);
// based on the flowStepDirection. if true, then there another FlowActivity in the same direction as the current flowActivity
boolean canContinue;
do {
if(this.isActive()) {
FlowValidationResult flowValidationResult;
// call passivate even if just returning to the current
// activity. but not if we are going back to a previous step
flowValidationResult = this.passivate(verifyValues, flowStepDirection);
if ( !flowValidationResult.isValid()) {
activateFlowActivity(getCurrentActivity(), FlowStepDirection.inPlace);
throw new FlowValidationException(getCurrentActivity(), flowValidationResult);
}
}
this.setCurrentActivityIndex(next);