Operation Advisor - Custom Precondition for Work Items
Phillip Piper (158●1●25●24)
| asked Sep 29 '11, 3:58 p.m.
edited Aug 03 '12, 7:28 p.m. by Jared Burns (4.5k●2●9)
I am just starting with extending our RTC server. I downloaded the SDK and started reviewing the following links:
https://jazz.net/wiki/bin/view/Main/CustomPreconditionFollowup https://jazz.net/library/article/495/ What I would like to do is require that change sets have been delivered prior to transitioning a work item to a specific state. I thought this could be achieved via an extension to the com.ibm.team.workitem.operation.workItemSave operation ID. There are aspects of this that I'd like to model off existing preconditions. Is there a way to pull the existing precondition code to review? I am not sure if they are in the source that comes with the SDK or where it would be located. Also, is there any article that discusses custom preconditions which modify the UI? I'd like people to be able to select states similar to the "Prevent Editing" precondition. Finally, on another note, it might be nice if RTC provided a plug-in template which could be used for different ways to extend it. Anyway, I'll take any assistance from anybody that has coded up their own custom preconditions. Thanks in advance. |
Accepted answer
here is my complete, and operating PreCondition OperationAdvisor..
this enforces 'Depends On' links to actually DEPEND on the remote end item being resolved.. This works on 3.0 ifix1 and 3.0.1 and thru 5.2 in binary form. package xxxxx;; // set your package name import org.eclipse.core.runtime.IProgressMonitor; import com.ibm.team.links.common.IReference; import com.ibm.team.process.common.IProcessConfigurationElement; Ralph Schoon selected this answer as the correct answer
Comments 1
Sam, one observation. You always want to add extends AbstractService to the class.
sam detweiler
commented Aug 03 '12, 5:56 p.m.
good catch thanks, fixed here.. this was a cut/paste from some workshop sample I think.
Ralph Schoon
commented Aug 03 '12, 7:07 p.m.
| edited Aug 03 '12, 7:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
@sam, it is a great plasure to work with you and your contributions anre just extraordinary. Thank you so much! I had the same C&P issue and it got me into a lot of trouble. 8-)
sam detweiler
commented Oct 11 '12, 2:35 p.m.
hey, we found a bug.. this advisor only works if the terminal state of the other workitem is 'Resolved'.. Stories terminate in 'Done'.. so, I gotta update the code..
sam detweiler
commented Nov 17 '12, 11:45 p.m.
I updated the code to resolve the bug when the end of the links closed state was not 'resolved' (but done or complete).. this also handles if the target was invalidated.
Binoy D'costa
commented Nov 05 '14, 11:15 a.m.
Hi Sam,
If you are using Eclipse, then create a new line, type WorkItemEndPoints
showing 5 of 7
show 2 more comments
|
13 other answers
Hi Philip, Ralph, thanks. I take a look in the coming days here and see if I am still having problems. |
Ralph Schoon (63.1k●3●36●45)
| answered Oct 07 '11, 12:57 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Philip,
you might also want to have a look at the Extensions workshop in the library. It is for 3.0 and I am in the process of upgrading it, but it is still helpfull to understand the setup for development. |
I think I figured out some of this based on the video in Part 1 at this link:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample This was extremely helpful to me in terms of finding how to search the source, etc. It may have been obvious to everyone else but it wasn't to me since I only found binaries when I looked at the SDK on the file system. I was able to locate the existing precondition source code. This information also seemed to be missing from the other articles I saw. I think it would be extremely helpful to merge and streamline the precondition articles or setup. It seems like each article has its own environment setup instructions along with the SDK having their own as well. I've had to read a number of articles and have had trouble determining which steps I need to follow. |
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.