Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello,
Has anyone used checklists as part of a Windchill Workflow task? We want to use a checklist in the assigned activity to verify that the assignee has done everything they need to before the task moves on. This seems like something that would be useful to many organizations, but I can't find anything for it. I'm hoping someone out there has done this and can tell me where to start.
Thank you
-ddmartin3-
Solved! Go to Solution.
Hi ddmartin3,
Have you tried to add boolean variables to the workflows task? If you mark them as visible, the workflow task should show them in the UI.
You can initialize them to false, and add a Java code in the complete transition of the task to check if all of them have been changed to true to throw an WTException with a custom message for the user if not.
Regards
![]() | Iker Mendiola - Prambanan IT Services |
That would be indeed very interesting! Unfortunately I think the workflow UI is very stiff and not customizable.
Hi ddmartin3,
Have you tried to add boolean variables to the workflows task? If you mark them as visible, the workflow task should show them in the UI.
You can initialize them to false, and add a Java code in the complete transition of the task to check if all of them have been changed to true to throw an WTException with a custom message for the user if not.
Regards
![]() | Iker Mendiola - Prambanan IT Services |
Thank you! This sounds like exactly what I need. I'll try it and report back with my findings.
-Dee-
This is exactly what I wanted. For any other newbies reading, the code to make it work is pretty minimal too.
This is my actual working code:
if (excelReviewedBool == false || natDataBool == false)
result = false;
else
result = true;
Are you talking about an honor system check meaning just check a box with no verification that the user actually did what they're suppose to do? Kind of like the "By Checking this box you agree that you have read and understand this agreement".
Or something that actually means something like running code that checks/verifies the user did what is required before proceeding.
Both are can be included. My rule of thumb is if it is possible you write code and verify. If it is not possible to write code to verify but you want to add a checkbox as nothing more than a reminder to the user then you do that.
I don't even ask if the customer wants verification anymore (they ALL do). I just get their specs and set it up. SOP.
David
Basically just the "By Checking this box you agree that you have read and understand this agreement" kind of check box. There is too much variability in the number of uploaded documents per job to say verify they were all uploaded programmatically. But we would prefer if we didn't have rework because someone forgot to sign or check the date on the form they're reusing. We end up losing a lot of back and forth time for silly reasons, and maybe if a little more time was taken upfront we could save a lot of time overall and trust the system.
-Dee-
I added this acknowledge check box and a bit of javascript. Does not let complete task button to be checked unless they check the box.
Oh? Using Javascript is an interesting decision. Also, how did you do that? There are places in tasks that accept Java. Where does one add Javascript?
It required using a custom JSP task template. That is where you can put the JavaScript. The next piece was to override the complete button jsp since that is what generates the complete button. Below is from my initial task template:
<tr>
<td></td><td></td><td valign="middle" align="left">
<FONT class=wizardbuttonfont><jsp:include page="/netmarkets/jsp/customtemplates/ccbReviewCompleteButton.jsp"/>
</FONT>
</td>
</tr>
There is a bit of JSP in the JSP called out above to refer to the javascript function:
if(isShow.equals(Boolean.TRUE))
{
am = NmActionServiceHelper.service.getActionModel("complete Custom workitem",myNmWorkItem);
NmAction completeTask = (NmAction)am.getActions().get(0);
completeTask.setButton(true);
completeTask.setTitle("Complete");
completeTask.setDesc("Complete");
//completeTask.setEnabled(true);
completeTask.setEnabled((!myNmWorkItem.isCompleted() && !myNmWorkItem.isSuspended() && myNmWorkItem.isMine()));
//addition - Parent JSP page must contain this validtion script
completeTask.setOnClick("validate_Complete()");
actionBean.setAction(completeTask);
NmContext context = nmcontext.getContext();
context.pushElement(myNmWorkItem);
NmAction.actionjsp( actionBean, linkBean, objectBean, localeBean, urlFactoryBean,nmcontext, sessionBean, out, request, response);
context.popElement(); actionBean.setAction(null);
}
I also had a custom action command inserted for other things.