Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Version: Windchill 12.1
Use Case: To update the workflow activity template on start transition
Description:
I am not able to find any api or workaround on ptc to assign the activity template programmatically on start transition.
This task is to the user to create the change notice. No Change Notice should exist yet so its not possible to assign a template. Are you looking to automate the creation of a change notice for the user? If so, you would not need a template but rather you can create all the elements and fields via code.
I am not looking to create the Change Notice Automatically, I receive this task to create the change notice and there is an action to do so.
But the specific task do not have the complete button, because of the wrong activity template. I cannot set it from the UI because it I need to check for certain validations on start of the activity. Let me know if you need more clarity on it.
Right, at this point, your are outside of the workflow template. You can set defaults on what template comes up but any logic would need to be added to a data utility that influences the template drop down that appears preselected.
Right, I do not see any api to update that logic.
if you enable jcaDebug=true, you might be able to see the data utility that drives the template dropdown list. From there you can overwrite it and replace with your logic.
We cannot do jcaDebug in workflow, the activity's template is set from workflow.
Sry for my last reply below. I just saw your reply above. Thinking...
As another method, you could have the same task with the various templates, and then route the workflow to the correct task template.
Yes, I have thought of this workaround but I have was looking for customization.
So we are clear, you are looking to have this drop down that selects the change notice template to default to a specific one based on some custom logic, correct? Where would be the source information for this decision maintained?
This is the information on that drop down:
This is setting the template for Change Notice, I want to update it for task that we receive from the workflow and not for the change notice.
I checked the database. If possible, there should be a reference to the TaskFormTemplate instance called out. I only see that in the Workflow task template definition. This would mean that the WfAssignedActivity, which is your runtime task does not contain a reference to the TaskFormTemplate and it looking back to the workflow template for this information. That would negate making this updatable via some code logic. I think @joe_morton might be your only option to do what you want. And it should also be the preferred method since it is the most flexible, least amount of customization. I know it makes workflows messy.
You mentioned something about not having a complete button. Was this removed since in most templates, its there by default? What is the larger goal here by wanting to choose different task form templates?
Even i thought that there was no reference of it the database and thereby we cannot customize it, I actually took the configuration approach of making multiple tasks. The larger goal is that the above workflow is being called from CR and CN in both the case primarybusinessObject will be different thereby the missing of complete buttons. I only needed those buttons so that I can mark the task complete and proceed.
Thank you for all the effort.
I think the missing complete button is a separate issue. I am assuming that this task template is customized. If you return to the OOTB, is there a complete button there? Perhaps there is a bug in that template? Screen shot of what you see? Are you able to post the code for your task template?