Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Fetch current userProperties for a file

Hi,

I have the following precondition/advisor code that displays all user properties when a delivery takes place. What I find is that, the code always gets - for lack of a better word - the "beforestate" of the user properties.
So for instance, if I have a custom property 1 set on a file and I deliver it - it does not display any user property at all. If I modify the file and deliver it again, now I see the custom property set previously, but not any other new properties created just before the second delivery.

I am sure I am missing something in my code. Any help is greatly appreciated. Thanks!!


IItem[] changeSets = getService(IRepositoryItemService.class)
.fetchItems(
(IItemHandle[]) deliverData.getChangeSetHandles()
.toArray(new IChangeSetHandle[0]),
IRepositoryItemService.COMPLETE);

for (int i = 0; i < changeSets.length; i++) {
IChangeSet changeSet = (IChangeSet) changeSets[i];
changeSetList.add(changeSet);
}

for (IChangeSet changeSet : changeSetList) {
List<IChange> changes = changeSet.changes();

for (int j = 0; j < changes.size(); j++) {
IVersionableHandle versionableHandle = changes.get(j).item(); //tried getting afterstate(), no difference
ServiceConfigurationProvider scp = ServiceConfigurationProvider.FACTORY.create(deliverData
.getDestWorkspace(), changeSet.getComponent());
IVersionable[] items = scmService.configurationFetch(scp, new IVersionableHandle[] {versionableHandle},
IScmService.COMPLETE, null, null);

for (IVersionable iVersionable : items) {
System.out.println("Name:" + iVersionable.getName());
Map<String> properties = iVersionable.getUserProperties();
printMap(properties);
}
}
}

0 votes



One answer

Permanent link
Update:

I think I found out what was going on. I should have used getSourceWorkspace instead of getDestWorkSpace when I created the ServiceConfigurationProvider. Hope this helps someone else!

-AJ

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952

Question asked: Mar 21 '12, 11:29 a.m.

Question was seen: 4,515 times

Last updated: Mar 21 '12, 11:29 a.m.

Confirmation Cancel Confirm