get IVersionable(Handle) from UUID
How do I get IVersionable(Handle) from the UUID on the server.
I'am implementing a RPC service which can only take certain parameters when called from a client(https://jazz.net/wiki/bin/view/Sandbox/JAFServiceFramework)
I am passing a UUID object for a versionable and want to resolve that to a IVersinable(handle) instance.
I have asked a similar question earlier, but that was for resolving a UUID to a WorkItem. I have resolved that(See https://jazz.net/forum/questions/94483/get-workitem-from-uuid )
Anyone knows how to do that ?
Accepted answer
IAuditableHandle
createAuditableHandle(IItemType itemType, UUID itemUuid, UUID stateUuid)
in IAuditableCommon
here is a different approach, without needing to know the type in advance
if u have the UUID object
IItemHandle handle = IComponent.ITEM_TYPE.createHandle(uuid, null);
if u only have a String
IItemHandle handle = IComponent.ITEM_TYPE.createHandle(UUID.valueOf(uuid_string), null);
for example
IComponentHandle compphandle = (IComponentHandle) IComponent.ITEM_TYPE.createItemHandle(UUID.valueOf(compuuid), null);
or
IWorkItemHandle workitemhandle = (IWorkItemHandle) IWorkItem.ITEM_TYPE.createItemHandle(UUID.valueOf(uuid), null);
ITeamRepository repo = ...;
IItem item = repo.itemManager.fetchCompleteItem(handle, IItemManager.DEFAULT, null);
IItemType type = item.getItemType();
System.out.println("Simple type name: " + type.getName());
System.out.println("Type's namespace: " + type.getNamespaceURI());