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 put this in my Transitions tab.  detailedChangeDescription is a global String variable in the workflow.  But serves as an example for what you're after.  In the example, I am checking to make sure the string length is at least 10 characters.  You could check for only 1 if you wish - or use whatever logic you want to.

 

wt.workflow.work.WfAssignedActivity activity = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.ProcessData actData = activity.getContext();
detailedChangeDescription = actData.getTaskComments();

if (detailedChangeDescription.length() < 10) {  throw new wt.util.WTException(new Throwable(new String("Please enter a detailed description in the Comments field.")));
}

 

This is a leverage of these 2 articles:

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS185827

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS182596


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>