Skip to main content
1-Visitor
October 24, 2016
Solved

Object ID prefixes

  • October 24, 2016
  • 1 reply
  • 3432 views

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.

Best answer by BjoernRueegg

<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();

1 reply

17-Peridot
October 24, 2016

<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();

1-Visitor
October 24, 2016

Thank You, Ruegg.

22-Sapphire I
October 25, 2016

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.