Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! 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
Hi @HelesicPetr
I need one more help from you that,
How can we programmatically get the comments from resulting item table because we don't get that in change record and not on objects as well.
Yes that was wrong question actually.
Now I am struggling to get formatted text
Actually question was how or HTMLTextFilter works to get formatted description in report because I am using htmltExtFilter.filterHtMLText();
But it's not working getting description with html tags like <p><\p>etc
Hi @_1647
Actually I would start a new thread for your question. PS> formatted text from what?
PetrH