It's all about the answers!

Ask a question

Fetch Contributor Name In a Save Operation Participant.


Arun Batra (14612427) | asked Sep 01 '11, 3:38 p.m.
Hi,
I am trying to write an operation participant for a Work Item save operation.
In the code of the Participant, I am able to get the value of the creation time attribute. (return type is TimeStamp)

Object data = operation.getOperationData();
ISaveParameter saveparam= null;
IWorkItem newstate = (IWorkItem) saveparam.getNewState();
newState.getCreationDate();

But i am having trouble to get the value of the Owned By attribute.
Can someone suggest an approach.

I am very new at this and hence require help.
I would be very grateful if someone could suggest some sort of tutorials where Extending RTC using java can be studied in depth. I have already tried the HelloJazz/ Hi Jazz tutoriials but they are clearly not sufficient.
Please help.

5 answers



permanent link
David Van Herzele (10121) | answered Sep 02 '11, 6:40 a.m.
I think you have trouble transforming the handle into an actual Contributor object. You should use the RepositoryItemService for that.

IContributorHandle contribHandle = newState.getOwner();

IContributor contrib = (IContributor) repositoryItemService.fetchItem(contribHandle, null);


If you wonder how to get repositoryItemService:
IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);


Cheers!

permanent link
Arun Batra (14612427) | answered Sep 02 '11, 7:52 a.m.
Thanks a lot David. This was exactly what I required. U made my day...
Thanks :)

permanent link
Arun Batra (14612427) | answered Sep 02 '11, 8:05 a.m.
Could you tell me where to learn all this from. I am kind of lost. But i am very interested to dive into the concepts. I mean what's next after going through the tutorials on jazz.net (HiJazz/Hello Jazz etc..).

permanent link
David Van Herzele (10121) | answered Sep 02 '11, 8:48 a.m.
Oh I feel you! It's a pain to get started and I won't tell you it gets any better after that. I figured it out by using the RTCSDK wiki extensively, this very forum and trial/error programming.

RTCSDK wiki:
https://jazz.net/wiki/bin/view/Main/RtcSdk20

Since you try to create an OperationParticipant you should have a look at:
https://jazz.net/wiki/bin/view/Main/CustomPreconditionFollowup

It has a focus on OperationAdvisor, but they are quite similar! And it has sample code! (look at the list at the bottom of the page)
You can also search the RTCSDK source code for the default Advisors/Participants packaged with RTC.

Another advise I would give is to use the search functionality of the wiki! Some pages are orphans (I think) and are not referenced anywhere. So just typing "Advisor" in the search you should get all pages about Advisors (and some more). Also participants are rarely used as examples on the wiki, so you should search on Advisors for better results.

Don't search for the Javadoc, it is on a IBM only site somewhere... which is sad. You can always try to extract it from the source files yourself

Ask questions (be specific) on the forum and with a bit of luck you should have an answer soon.

Good luck & have fun!

permanent link
Arun Batra (14612427) | answered Sep 02 '11, 9:42 a.m.
Thank you David for understanding and replying. (It Gives Me hope)
:)

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.