It's all about the answers!

Ask a question

How to get an IConfiguration from IChangeSet?


Ernest Crvich (19211919) | asked Jan 31 '11, 10:07 p.m.
I have an IChangeSet retrieved from an IWorkItem. I can get the IFileItem from this without a problem. However, in order to get the full path to the file, I need an IConfiguration object so I can use locateAncestors() or determineAncestorsInHistory().

Presumably this would come from the IWorkspace (or rather the IWorkspaceConnection for that workspace) that the IChangeSet is associated with.

So I guess the real question might be...how do I obtain the workspace associated with a changeset?

11 answers



permanent link
Ernest Crvich (19211919) | answered Feb 24 '11, 11:27 a.m.
Unfortunately, the configuration() method in IWorkspaceConnection returns an IWorkspaceConfiguration object instead of an IConfiguration object. The former does not provide the method determineAncestorsInHistory().

Turns out there's another version of configuration() down in IFlowNodeConnection that takes a component handle as an arg and returns a regular IConfiguration object. Thanks to John for pointing this out!

permanent link
Ernest Crvich (19211919) | answered Feb 21 '11, 10:35 a.m.
In other cases, the workspace in which a change-set is created is
associated with the change-set. In those cases, the system can lookup
that workspace (if it hasn't been deleted), and use that to show
pathnames for the files/folders.


Unfortunately, the configuration() method in IWorkspaceConnection returns an IWorkspaceConfiguration object instead of an IConfiguration object. The former does not provide the method determineAncestorsInHistory().

So assuming that you can get the workspace associated with a change set (currently using the getExtraInfo() method), how can one use it to get the ancestor info of a file?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 20 '11, 11:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
To understand why a file/folder in an RTC change set can be given a
pathname only in the context of a configuration, think of the simple
case where a change set modifies a single file, "foo.txt".
You have two workspaces, one in which that file is in a folder named "x"
and the other in which that file is in a folder named "y".
In the first workspace, the pathname of the file is .../x/foo.txt.
In the second workspace, the pathname of the file is .../y/foo.txt.

So given just the change-set, what is the pathname of the modified file?
The answer is, you don't know.

WRT the GUI example, the GUI shows full pathnames for a change set only
by selecting some configuration.

In some cases, the particular view you are using in the GUI implies a
configuration (for example, when the GUI displays a change-set in the
history of some workspace or stream, it uses the current configuration
of the workspace/stream to give the members of that change set pathnames.

In other cases, the workspace in which a change-set is created is
associated with the change-set. In those cases, the system can lookup
that workspace (if it hasn't been deleted), and use that to show
pathnames for the files/folders. But note that those pathnames may be
completely different from those that you see when you accept that
change-set into some workspace ... since it is the configuration of the
workspace that determines the pathnames of files/folders in that workspace.

Cheers,
Geoff

On 2/7/2011 6:38 PM, crvich wrote:
gmclemmwrote:
Note that a change set is a free-standing there is no such things as
"the path" for a file in a change set.


I'm not sure I understand this. If you move a Java source file to a
different package and check in the changes (but don't deliver or
create a new baseline), the RTC GUI is able to show the old path and
the new path to the user. So this info is clearly known, and is
critical to our tool (or at least the new path is). The API doesn't
provide a reliable way to retrieve this?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 20 '11, 11:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that this method takes as an argument the configuration in which
the files/folders are to be given names. So even if you had a
client-side variant of this method (which probably does exist) it does
not provide a way to get a configuration from a change set.

The only way to do so is to lookup the "creating workspace" annotation
on the change-set, which will give you a configuration if that
annotation was created, and if that workspace still exists. (Perhaps
someone on this forum knows how to query for that information?).

Cheers,
Geoff

On 2/14/2011 6:23 PM, crvich wrote:
shufnaglwrote:
I found the solution with IscmService#configurationLocateAncestors.

This appears to be intended for server-side code, whereas my situation
is purely client-side.

permanent link
Ernest Crvich (19211919) | answered Feb 14 '11, 6:14 p.m.
I found the solution with IscmService#configurationLocateAncestors.

This appears to be intended for server-side code, whereas my situation is purely client-side.

permanent link
Stefan Hufnagl (29411920) | answered Feb 13 '11, 11:10 a.m.
Hi,

sometimes the solution is just in front of us...I found the solution with IscmService#configurationLocateAncestors.
After that I recognized that there is still a good example... the "advisor example" https://jazz.net/wiki/bin/viewfile/Main/RTCSDK20_ProcessPreConditionExample?rev=2;filename=advisor-example.zip

permanent link
Stefan Hufnagl (29411920) | answered Feb 13 '11, 3:20 a.m.
Gentlemens,

I have the same problem...find the path to a related ChangeSet File.
The View "Pending changes" is able to display the path.

Any solution to this problem?
Thanks in advance

Stefan

permanent link
Ernest Crvich (19211919) | answered Feb 07 '11, 6:31 p.m.
Note that a change set is a free-standing there is no such things as "the path" for a file in a change set.


I'm not sure I understand this. If you move a Java source file to a different package and check in the changes (but don't deliver or create a new baseline), the RTC GUI is able to show the old path and the new path to the user. So this info is clearly known, and is critical to our tool (or at least the new path is). The API doesn't provide a reliable way to retrieve this?

permanent link
Geoffrey Clemm (30.1k33035) | answered Feb 03 '11, 11:38 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that a change set is a free-standing object (i.e. is not inherently
linked to any particular configuration). John's responses provide ways
of finding some configuration that would give you "a path", but there is
no such things as "the path" for a file in a change set.

Cheers,
Geoff

On 1/31/2011 10:08 PM, crvich wrote:
I have an IChangeSet retrieved from an IWorkItem. I can get the
IFileItem from this without a problem. However, in order to get the
full path to the file, I need an IConfiguration object so I can use
locateAncestors() or determineAncestorsInHistory().

Presumably this would come from the IWorkspace (or rather the
IWorkspaceConnection for that workspace) that the IChangeSet is
associated with.

So I guess the real question might be...how do I obtain the workspace
associated with a changeset?

permanent link
Ernest Crvich (19211919) | answered Feb 03 '11, 4:04 p.m.
Thanks for the detailed response, John. Another apparent concern here is that I just dixcovered that IWorkspaceConnection.configuration() returns an IWorkspaceConfiguration object, which doesn't extend IConfiguration and doesn't offer any ancestor-related methods of its own. How would I construct the path to the file item without them?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.