Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Editing Attributes on the Links of Change Relationship Tables


Editing Attributes on the Links of Change Relationship Tables

This is a topic in the Windchill Help:

Anyone ever successfully made this customization to the Affected or Resulting objects tables on the Change Notice? I need help with the data utility.


Did you check out the Tips and Tricks from JeffZemsky

I've gotten part of the way through this but am still having problems with the form delegate. I can enter a value in a textbox for my string attribute on the change task editing page, so it seems like my data utility is working. But once I select finish, the value entered isn't persisted back to the Change Task. I wrote a form delegate and registered it using the property com.ptc.netmarkets.util.misc.defaultActions as described in the help. This seemed like the better-documented part of the example, but I can't get it to work.

package ext.change;

import com.ptc.windchill.enterprise.change2.forms.delegates.ChangeTaskAffectedItemsFormDelegate;
import wt.change2.ChangeItemIfc;
import wt.fc.collections.WTCollection;
import wt.util.WTException;
import com.ptc.windchill.enterprise.change2.ChangeLinkAttributeHelper;
import com.ptc.windchill.enterprise.change2.beans.ChangeLinkAttributeBean;
import wt.util.WTPropertyVetoException;
import com.ptc.core.meta.common.UpdateOperationIdentifier;
import com.ptc.core.lwc.server.PersistableAdapter;
import wt.change2.WTChangeActivity2;
import wt.change2.ChangeRecord2;
import com.ptc.windchill.enterprise.change2.ChangeManagementClientHelper;

import java.util.Iterator;

public class MyAffectedItemsFormDelegate extends ChangeTaskAffectedItemsFormDelegate {

   * This method is used to post-process attributes on the change activity
   * and change records. 
	protected WTCollection processLinkAttributes(ChangeItemIfc item, WTCollection binaryLinks) throws WTException {
		WTCollection modifiedLinks = super.processLinkAttributes(item, binaryLinks);
		if (binaryLinks != null && !binaryLinks.isEmpty() && item instanceof WTChangeActivity2) {
		  // The link bean has knowledge of how of link attributes and supports the JCA interfaces.
		  ChangeLinkAttributeBean linkBean = ChangeLinkAttributeHelper.getChangeLinkAttributeBean();
		  for(Iterator<ChangeRecord2> iter = binaryLinks.persistableIterator(ChangeRecord2.class, true); iter.hasNext(); ) {
			ChangeRecord2 record =;
			// The getTableDataValue() will get the attribute from the FORM data supporting any specific change table handlers
			String value = ChangeLinkAttributeHelper.getTableDataValue("estimated_cost", 
					ChangeManagementClientHelper.getReference(record.getChangeable2()), linkBean);
			// The new LWC API for getting and setting attributes.
			PersistableAdapter lwc = new PersistableAdapter(record, null, null, new UpdateOperationIdentifier());
			Object currentValue = lwc.get("estimated_cost");
			// Only set the attribute if it is different than the current value
			if(( value != null && currentValue != null && !value.equals(currentValue.toString())) || (value == null && currentValue != null) ) {
			  lwc.set("estimated_cost", value);
			  // calling apply() will require verification, however since this form delegate is setting the changes we can set it as verified.
			  try {
			  } catch (WTPropertyVetoException e) {
		return modifiedLinks;

The Windchill java docs show persisting the updated object with:



I see you using the apply() method but not persisting the updated object. Have you tried this?

lwc.set("estimated_cost", value);

PersistenceHelper.manager.modify(record);//add this?



Thanks for the suggestion, but I'm getting the same thing - doesn't persist back to Change Task.

If there is an issue with this documentation please raise a call with Technical Support so it can be corrected.

I've found several small mistakes in the documentation, but it's really the lack of detail that is the problem. I have a TS case open but haven't received much help. The documentation also uses some deprecated code and hasn't changed for many years, even though the API has.

Please send me the call number


Hi Jeff,


I'm hanging in the same problem. 
was the API Doc fixed?


Best Regards



Actually a little bit of details.
I have a working datautility on my change record.


But in my custChangeTaskResultingItemsFormDelegate in the processLinkAttributes() I don't get a value back.

String value = ChangeLinkAttributeHelper.getTableDataValue(internalname of attribute in ChangeRecord, ChangeManagementClientHelper.getReference(record.getChangeable2()), linkBean);

it supposes to work as the example in the documentation.


Has someone on the thread engaged Tech Support.  If so would you PM me your Call # please?

It never enters the for loop. Note sure why. The size of the binaryLinks WTCollection is not zero during my test. No ChangeRecord2?

it seems that the if clause is wrong. The combination "value != null && currentValue == null" is missing. Adding this worked for me.