Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Version: Windchill 12.1
Use Case: We have 2 versioning schemes, numeric for NPD and alpha for production. With promotions items can be auto revised when promoting to the production gate, which in turn moves them to production released. A requirement I have is to only enable the revise action within a change context. A promotion is not considered inside of the change context so the auto revise is not working if I have the "Revise in Change Process" preference enabled.
Description:
How can I auto revise the objects moving from the development state to production state (and ultimately the production released) within the change context? I cannot find anything in the API to revise in a change notice/activity similar to how a promotion can revise objects.
I considered creating a promotion inside the cn workflow but I am unsure if that will work. I also considered trying to turn off the preference in the promotion workflow then turning it back on though not ideal. Is there a way around this issue besides revising objects manually or using a script after the fact?
I should add I only care about restricting revisions in production released state to the change management process but the preference is broad. Objects in the npd states can go either way with the restriction if that matters at all
Solved! Go to Solution.
Hi @ZC_10909252
You have to write own code to do so.
Here is an example how to revise.
var0 = (WTPart)VersionControlHelper.service.newVersion(Versioned object, true);
var0 = (WTPart)PersistenceHelper.manager.store(Persistable var0);
A main point is to collect resulting objects and then create new version.
QueryResult changeablesAfter = ChangeHelper2.service.getChangeablesAfter(sourceChangeActivity);
PS> in the workflow you have to use full package definition so WTPart = wt.part.WTPart, VersionControlHelper =wt.wc.VersionControlHelper wt.change2.ChangeHelper2 etc.
PetrH
Can you explain "Change context"? Did you create a separate product area only for changes? Where do the objects under change actually reside?
Sorry should've said change process like in a cn
the change notices is going to manage things against a change task. Now, you are looking to release things and have them auto-revise so this will all be custom robots in that workflow. I would assume that you put your items in the affected data section, do some validation and review steps and once its good to do, change their states and revise (adding them to the resulting items section of the change task. A bit of a non-standard approach but you will have to code the logic to do the revise I believe.
Right. I am able to auto revise in a promotion request. There is a help page on that even. However, I need to be able to do that same workflow in a change task, however I cannot find api to do it. The promotion requestion uses:
com.ptc.windchill.enterprise.maturity.PromotionNoticeWorkflowHelper.revisePromotables(
pn, pn.getCreator(), locale);
However since I am not in a promotion I do not think that will work. I need help finding the API to do what i need. Or change the preference to allow for revisions in a promotion or with an admin account. I think its wild that as a site/org admin I have no option to revise with that preference set.
Hi @ZC_10909252
You have to write own code to do so.
Here is an example how to revise.
var0 = (WTPart)VersionControlHelper.service.newVersion(Versioned object, true);
var0 = (WTPart)PersistenceHelper.manager.store(Persistable var0);
A main point is to collect resulting objects and then create new version.
QueryResult changeablesAfter = ChangeHelper2.service.getChangeablesAfter(sourceChangeActivity);
PS> in the workflow you have to use full package definition so WTPart = wt.part.WTPart, VersionControlHelper =wt.wc.VersionControlHelper wt.change2.ChangeHelper2 etc.
PetrH
Thanks. I was searching for revise not version.
Hi @ZC_10909252
new Version = new Revision 😄
Knowledge base CS390946 - How to programmatically revise an object in Windchill PDMLink
PetrH