Modifying a workitem with IOperationAdvisor or IOperationParticipant ?
Hi,
I was looking for a way to change the value of a workitem's attribute during the Save phase.
In com.ibm.team.process.common.advice.runtime there are 2 hooks, namely IOperationAdvisor (pre-save) and IOperationParticipant (post-save). I've looked around for some examples of workitem modification, but haven't found any yet. It's not even clear to me if i makes sense to be able to make a change on a workitem during the either pre-save or post-save phase. Would someone please advise?
thanks in advance
John
Accepted answer
Hi John,
here is an example participant: http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/
I would probably use a participant rather than an Advisor, however, I know others have done modifications in an Advisor as well. You might also want to look if you can use a java script based extension e.g. a calculated value provider https://jazz.net/wiki/bin/view/Main/AttributeCustomization .
here is an example participant: http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/
I would probably use a participant rather than an Advisor, however, I know others have done modifications in an Advisor as well. You might also want to look if you can use a java script based extension e.g. a calculated value provider https://jazz.net/wiki/bin/view/Main/AttributeCustomization .
Comments
3 other answers
Ralph I really think that this is a bad idea. . the Advisor (preCondition) should never ever modify anything.
you should change your answers in the future here..
Changes should be done by the Participant. cause thats what it is/does.. it participates in the transaction.
both will fire the save event handler again.
Sam
you should change your answers in the future here..
Changes should be done by the Participant. cause thats what it is/does.. it participates in the transaction.
both will fire the save event handler again.
Sam
Comments
the Advisor (preCondition) should never ever modify anything. Changes should be done by the Participant. cause thats what it is/does.. it participates in the transaction.
We have an advisor which has to retrieve information from an external database to validate the current work-item action. Some of this information has to be saved into custom attributes of the work-item, too.
Could we modfiy the operation data of the advisor to avoid to retrieve this same information even on a participant?
Thanks in advance.