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.0
Use Case: Requirement : Need to set Release Target Programmatically for Resulting Objects.
Description:
setTargetTrasition() is there but not getting a way to set Release Target.
Solved! Go to Solution.
Hi @_1647
you should use the persistence manager to store the change. You just change it in the memory of the java transaction and it is not stored.
// save the change on the existing record
PersistenceHelper.manager.save(recordToUpdate);
// save the new record
PersistenceHelper.manager.store(newRecord);
PS: if you write a code in the workflow, you have to define full class definition
wt.fc.PersistenceHelper
PetrH
Article - "How to obtain programatically a Release Target (Transition) of a Changeable in a Change Notice in Windchill PDMLink": https://www.ptc.com/en/support/article/CS184486
Thank you Vladimir for article.
That is for to get value not to set.
To set Release Target using setTargetTrasition().
But after setting the Transition as " CHANGE "on Wc UI changes are not reflecting.
Is there any method to save or propagate the changes which madhe on Change Record.
Hi @_1647
It is really good idea to share some snip code.
The class cast exception can be thrown because you expect some object type and use wrong retype object, but there is a different type. For example an Array.
PetrH
To set Release Target using setTargetTrasition().
But after setting the Transition as " CHANGE "on Wc UI changes are not reflecting.
Is there any method to save or propagate the changes which madhe on Change Record.
wt.fc.QueryResult links = wt.change2.ChangeHelper2.service.getChangeablesAfter(CA);
while (links.hasMoreElements())
{
wt.change2.ChangeRecord2 newChangeRecord = (wt.change2.ChangeRecord2) links.nextElement(); newChangeRecord.setTargetTransition(wt.lifecycle.Transition.CHANGE); wt.lifecycle.Transition trans = newChangeRecord.getTargetTransition(); System.out.println("Release Target Transition is :" + trans.getDisplay()); }
Hi @_1647
you should use the persistence manager to store the change. You just change it in the memory of the java transaction and it is not stored.
// save the change on the existing record
PersistenceHelper.manager.save(recordToUpdate);
// save the new record
PersistenceHelper.manager.store(newRecord);
PS: if you write a code in the workflow, you have to define full class definition
wt.fc.PersistenceHelper
PetrH