Yes.
In the Complete transition of your workflow task, check for whatever you
want to check for, then throw an error if you don't want the task to
complete because something isn't filled out yet.
Like this.
if (myVariableThatShouldBeTrue != true) {
String msg="Please complete the missing field";
java.lang.Exception e = new java.lang.Exception(msg);
throw e;
}
Throwing the exception will cause the transition to fail to complete, and
the task will remain on the user's worklist. He will also get a nice
error message that you can tailor to whatever you want it to read.
Al Anderson
"Stephen Drzewiczewski" <steve@stevedandrebecca.com>
03/11/2009 01:28 PM
Please respond to
"Stephen Drzewiczewski" <steve@stevedandrebecca.com>
To
-
cc
Subject
[solutions] - Workflow Task, Require the Comment to be filled out?
Caterpillar: Confidential Green Retain Until: 04/10/2009
Can a Transition be used to ensure that the comment on a default task page
is not left blank?
My use case is if somebody Rejects something, I want them to provide a
justification, but if they approve it they do not need to provide a
justification.
If it can be done, how do you address the comment field on the task page?
Thanks,
Steve D.