Folllowing exception was an attempt for that, but it does not seem working. I have seen it working in other custom workflows for transitions in activity robots though.
java.lang.Exception e = new Exception("Please make sure all resulting objects are checked in before completing task");
throw new wt.workflow.engine.FailedTransitionException(e);