Given a WorkItem ID (e.g. "tcm:x-y-131200"), what is the proper way to get the workflow version of the item (component) in TOM.NET framework?
The following does not seem to return the workflow version. The compUri (Line 3) returns the non-workflow version number, and consequently the component (Line 4) is not the workflow version of the item.
TcmUri workItemUri = new TcmUri(workItemId); WorkItem workItem = new WorkItem(workItemUri, new Session()); TcmUri compUri = workItem.Subject.Id; Component component = (Component)session.GetObject(compUri);
It was previously done successfully in a Process Definition VBScript using the following:
Dim oComp Set oComp = CurrentWorkItem.GetItem(1) Dim oCompEdit Set oCompEdit = TDSE.GetObject(oComp.ID, 2)