It's all about the answers!

Ask a question

Operation Advisor - Custom Precondition for Work Items


Phillip Piper (15812424) | asked Sep 29 '11, 3:58 p.m.
edited Aug 03 '12, 7:28 p.m. by Jared Burns (4.5k29)
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


13 other answers



permanent link
sam detweiler (12.4k6180201) | answered Nov 19 '11, 8:45 p.m.
I don't use that, so sorry no help

Sam

permanent link
Qiong Feng Huang (76911610) | answered Nov 20 '11, 10:00 a.m.
JAZZ DEVELOPER
So one challenge I am having is in creating the Aspect Editor.

I keep getting null returned for this call:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, new RunnableWithProgress() {....

Is there any reason for why this happens or how to avoid? I am following the pattern in the getWorkItemsType call of the 3.0.1 Extensions Workshop labs which is consistent with what I see in the out of the box preconditions.

Thanks.


What do you mean when you say "I keep getting null returned for this call"? Do you mean you get NullPointerException exception? If so, can you please provide the exception stack? Or, did you see any error log in the console?

I know nothing about the Extensions Workshop. I am just trying to figure our the problem from the basic technical view.

permanent link
Robin Bobbitt (59679) | answered Nov 21 '11, 12:34 a.m.

2. I am not sure I understand how I can determine exactly what services I require for what I want to do.

FWIW when writing future extensions, I've posted the following on my blog about one approach to figuring out which services you require: http://ryehle.wordpress.com/2011/11/21/finding-the-right-service-api-for-your-process-extension/

permanent link
Phillip Piper (15812424) | answered Nov 22 '11, 8:20 p.m.

What do you mean when you say "I keep getting null returned for this call"? Do you mean you get NullPointerException exception? If so, can you please provide the exception stack? Or, did you see any error log in the console?

I know nothing about the Extensions Workshop. I am just trying to figure our the problem from the basic technical view.

I get a pop-up error box when trying to use the UI config for the precondition in the operation behavior editor that gives a NullPointerException. And when I debugged it looks like either the getWorkbench() or getActiveWorkbenchWindow() returned null. I googled and it looks like it's possible to for the latter call to return null. Every other precondition editor I looked at had it coded the same way.

Eventually, in my attempts to figure this out, it went away but I am not sure why. I never changed that code either. It was quite strange.


2. I am not sure I understand how I can determine exactly what services I require for what I want to do.

FWIW when writing future extensions, I've posted the following on my blog about one approach to figuring out which services you require: http://ryehle.wordpress.com/2011/11/21/finding-the-right-service-api-for-your-process-extension/

Thanks Robin! I'll check this out because I have a few more extensions to write after working my way through this one which is almost complete.

Your answer


Register or to post your answer.