Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: Requiring comments to be entered in a task before allowing complete task

$
0
0

Greg, I think this code will work just fine for non-change objects too.  Can you give it a try.

 

In my case, I wanted to capture the comments and assign them to a workflow variable, "detailedChangeDescription".  But if you're not interested in that, you can possibly try something like this:

 

wt.workflow.work.WfAssignedActivity activity = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.ProcessData actData = activity.getContext();
if (actData.getTaskComments().length() < 10) {  throw new wt.util.WTException(new Throwable(new String("Hey user - please type something into the Comments field!")));
}

 

Of course you can adjust the quantity of characters it looks for too, based on your need.  I wanted the user to enter at least 10 characters.  Therefore .length() < 10.  You can change that if you wish.


Viewing all articles
Browse latest Browse all 8876

Trending Articles