boolean approvalRequired = workflow.getCurrentStep() instanceof Decision;
// If the profile requires approval, redirect user to message page
if ( approvalRequired )
{
throw new DecisionRequiredException( "This profile must be approved before it becomes active" );
}
// If the profile doesn't need approval, then just log the user in
try