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

Object ID prefixes

SOLVED
Regular Member

Object ID prefixes

Hi, have a good day.

I'm doing some practices with windchill and  trying to understand how it works. Now I have a doubt.

What is the difference between  these two prefixes in objects ID

VR:wt.part.WTPart & OR:wt.part.WTPart

Thank You for your time.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Object ID prefixes

<class>:<key> : string representation of an ObjectIdentifier.
OR:<class>:<key> : string representation of an ObjectReference.
VR:<class>:<key> : string representation of an VersionReference.

Snippets:

/* ObjectIdentifier string to WTPart */

ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.part.WTPart:20154");

WTPart part = (WTPart) PersistenceHelper.manager.refresh(oid);


/* ObjectReference / VersionReference string to WTPart */

ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("OR:wt.part.WTPart:20154");

WTPartpart = (WTPart) ref.getObject();


ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("VR:wt.part.WTPart:20153");

WTPart part = (WTPart) ref.getObject();

4 REPLIES 4

Re: Object ID prefixes

<class>:<key> : string representation of an ObjectIdentifier.
OR:<class>:<key> : string representation of an ObjectReference.
VR:<class>:<key> : string representation of an VersionReference.

Snippets:

/* ObjectIdentifier string to WTPart */

ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.part.WTPart:20154");

WTPart part = (WTPart) PersistenceHelper.manager.refresh(oid);


/* ObjectReference / VersionReference string to WTPart */

ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("OR:wt.part.WTPart:20154");

WTPartpart = (WTPart) ref.getObject();


ReferenceFactory rf = new ReferenceFactory();

WTReference ref = (WTReference) rf.getReference("VR:wt.part.WTPart:20153");

WTPart part = (WTPart) ref.getObject();

Highlighted

Re: Object ID prefixes

Thank You, Ruegg.

Re: Object ID prefixes

Might be more info than you want, but for objects that are versioned (like WTParts), there are two objects created - the "Master" and the first Version.  Certain operations apply to the Master (e.g. Rename).  Attributes are applicable to either the Master or each Version (if each Version, they are "Instance based attributes" or IBAs).

The URL is either for the Master object or a specific Version.

Re: Object ID prefixes

Thank You for the information, Mike.