Hello,
I'm currently working on an upgrade from Windchill 8.0 to 9.1. Part of this task requires that I go in and update all of the existing workflows for our business to the new system. The issue I'm having is in regards to the new comments field in Windchill workflow tasks.
Specifically I am having trouble trying to adapt one of our end-user's requirements to the new system. There is a case where, on a workflow task with three routing options (in this case approve, reject, and place on hold) they want to make it so the workflow will not advance if the comments field is left blank when the user selects either of two of the three options and leave comments optional on the third. (As you may guess the requirement is to have the comments required on a rejection or place on hold and to let approvals sail on through without them.)
In version 8.0 I'd do this by taking the comments variable and in the appropriate transition of the workflow task add a conditional to check if the variable was either null or empty and if so to throw an error message using the WTException class to prevent the task from completing. However when I use this method in 9.1 I don't get reliable behavior. In some cases the task will not advance at all even if comments are input, in others the error message will behave properly the first time you click the "Task Complete" button but the second time you click the task will advance without any comments despite the fact that one of the paths where comments are required are selected.
Has anyone had any experience doing this in version 9.1 of windchill? I've tried several different combinations of code to grab the comments from the new field, copy them into a variable, and perform the appropriate checks but nothing seems to reliably achieve what the end user desires in terms of behavior. Any assistance would be most appreciated!
--Richard