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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Cannot link part and document with ConfigurableDescribeLink without document getting iterated.

Johan_Mattsson
3-Newcomer

Cannot link part and document with ConfigurableDescribeLink without document getting iterated.

I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.2.7

We are trying to link a part and a document using Supplementary Link, subtype of Configurable Describe Link, with a stand-alone utility. When we do the link, the document always gets iterated. Is there a way to do it without the document getting iterated?

We have done similar link, using Reference Link and Describe Link, with no issues.

We have tried several fixes, but have found no solution.

Here are some of the errors that I faced using different solutions:
"WorkInProgressException: Part should be checked out and cannot be modified".

"Configurable Link should be Stored, not inserted."

And more...

The current code that I'm using is this:

theDocument = (WTDocument) ContentServerHelper.service.updateHolderFormat(theDocument);
thePart = (WTPart) PersistenceHelper.manager.refresh(thePart);
TypeIdentifier typeIdentifier = TypeIdentifierHelper.getTypeIdentifier(SUPPLEMENTARY_LINK_TYPE_DEFAULT_VALUE);



WTCollection configurableDescribeLink = ConfigurableLinkHelper.service.createConfigurableDescribeLink(
new ReferenceFactory().getReference(theDocument),
typeIdentifier,
CollectionsHelper.singletonWTList(thePart),
false);

This links the part and the document in "Supplementary Non-CAD Documents", but iterates the document.
3 REPLIES 3

Hello JM_10527524,

I'm Charles from PTC Technical Support in Europe, I will provide you assistance on this question.

Is it possible to share the full error message?

I remain at your disposal for any questions or concerns.

Kind Regards,

Charles Gautier.

Hi Charles! 

The thing is, that we don't get an error message. The part and the document is getting linked, but the document gets iterated. However, I think that we found the solution recently. 

If we use this code, everything seems to work fine: 

 

TypeIdentifier typeIdentifier = TypeIdentifierHelper.getTypeIdentifier(ext.vce.SupplementaryLink);

ConfigurableDescribeLink link = new ConfigurableDescribeLink();
link.setRoleAObject(theDoc);
link.setRoleBObject(thePart);
link.setTypeDefinitionReference(TypedUtility.getTypeDefinitionReference(typeIdentifier.getTypename()));
Date date = new Date();
Timestamp timestamp2 = new Timestamp(date.getTime());
PersistentObjectManager.getPom().insert(link, timestamp2, timestamp2);

 

If you see that you might have a better solution, please provide that. Otherwise, we can close this case.

 

Best regards,

Johan Mattsson

Hello Johan,

Thanks for your feedback, and congrats to you for figuring out the resolution.

Note PersistentObjectManager is not marked as being a supported API.

This question will be closed today.

KR,

Charles.

Announcements



Top Tags