Exception thrown when trying to create WTPartUsage using Info*Engine API
Version: Windchill 12.1
Use Case: Using a DAO class that extends com.infoengine.connector.DataAccessObject to link 2 parts: public com.ptc.windchill.ws.GenericBusinessObject [] Link ( java.lang.String parentUfid, com.ptc.windchill.ws.GenericBusinessObject [] associations, java.lang.String [] propertyNames ) throws Exception { String [] ie$dao$names = { "parentUfid", "associations", "propertyNames", }; Object [] ie$dao$vals = { parentUfid, associations, propertyNames, }; Object ie$dao$ret = execute ( "Link", ie$dao$names, ie$dao$vals ); return (com.ptc.windchill.ws.GenericBusinessObject [])ie$dao$ret; }
Description:
Exception thrown when trying to create WTPartUsage between 2 parts. Same call works in other WC installations (11, 12, 13, etc...) but failed in 12.1.2. The settings are the same for all the WC servers tested.
2025-01-27 19:15:35,902 ERROR [ajp-nio-127.0.0.1-8010-exec-3] wt.adapter.exception aphung - WTAdapterImpl com.ptc.core.command.common.CommandException: EXCEPTION DURING SAVE[ SOURCE: @@@ BEGIN TYPE INSTANCE @@@ Identifier: WCTYPE|wt.part.WTPartUsageLink~~NEW|-8287685863323502768 @@@ BEGIN ATTRIBUTE CONTAINER @@@ @@@ ID: WCTYPE|wt.part.WTPartUsageLink~~NEW|-8287685863323502768 @@@ : ~MBA|usedBy^WCTYPE|wt.part.WTPart~~WCP|168971|-1 @@@ Content: WCTYPE|wt.part.WTPart~~WCP|168971|-1 @@@ State: NEW @@@ @@@ ID: WCTYPE|wt.part.WTPartUsageLink~~NEW|-8287685863323502768 @@@ : ~MBA|uses^WCTYPE|wt.part.WTPartMaster~~WCP|168948|-1 @@@ Content: WCTYPE|wt.part.WTPartMaster~~WCP|168948|-1 @@@ State: NEW @@@ @@@ ATTRIBUTE IDENTIFIER COUNT = 2
....
@@@ REPLACEMENTS : NONE @@@ @@@ END ATTRIBUTE CONTAINER @@@ END TYPE INSTANCE ]EXCEPTION DURING SAVE Nested exception is: com.ptc.core.command.common.CommandException: (wt.part.partResource/QUANTITY_UNIT_EMPTY_VALUE_MSG) com.ptc.core.command.common.CommandException: The unit cannot be empty Nested exception is: (wt.part.partResource/QUANTITY_UNIT_EMPTY_VALUE_MSG) com.ptc.core.command.common.CommandException: The unit cannot be empty at wt.part.PartUsesLinkValidationeHelper.validateQuantityUnitForEach(PartUsesLinkValidationeHelper.java:86) at com.ptc.core.foundation.occurrence.server.impl.SavePartUsesSubCommandDelegate.validateUsageLink(SavePartUsesSubCommandDelegate.java:646) at com.ptc.core.foundation.occurrence.server.impl.SavePartUsesSubCommandDelegate.updatePartUsageLink(SavePartUsesSubCommandDelegate.java:713) at com.ptc.core.foundation.occurrence.server.impl.SavePartUsesSubCommandDelegate.doExecution(SavePartUsesSubCommandDelegate.java:418)
...

