Modifying a workitem with IOperationAdvisor or IOperationParticipant ?
Accepted answer
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
Thanks so much for your prompt response Ralph...
Hi John,
Update
You should use a Participant/followup action to modify a work item, not do it in a precondition.
Update
Old Answer
I am aware of the difference and have thought about its implications. I would assume that it is save to modify and save the work item itself in the precondition. What will happen is that the save triggers the preconditions again. So you might want to pass a cue that the precondition is triggered by a prior precondition save (as described in the example).
Other than that, I would be more concerned about what the user sees in the UI. Does it refresh the change? I have not done this myself, but I would definitely try it out - on a test system as described in the Extension workshop.
Old Answer
Please, can you share your experience here?
3 other answers
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
+1. Preconditions shouldn't make modifications to the data.
Sam, Jared thanks for the hints. I updated the answer with your input.
Are there any underlying reasons/implications why? The reason why I am asking is that there are other activities going on before the save. For example value providers.
I am aware that precondition really says condition - which is a test and not a manipulation. However, I can see reasons why someone would want to modify items before they are saved. For example to set dependent values. I am also aware that there are value providers available and you can create such extensions. They only appear to be much more complex than Advisors.
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.