It's all about the answers!

Ask a question

How to create a basic advisor in RTC 6.0.6.1


Ryan McBryde (5911233) | asked Sep 16 '20, 1:22 p.m.

 I am trying to follow Bartosz Chrabski video on youtube (from 2015) : 

in which he describes how to create an advisor.  I am trying to do this in a standalone Eclipse editor instead of the RTC Eclipse client like he does but I don't know if that matters.
I have imported the server SDK that I downloaded from jazz.net and I have followed the instructions on importing the package and adding the required plugins.

I am up to the step where I am "coding" the "AbstractService.java and the code is showing an error even before I make any modifications:
2 errors:
import com.ibm.team.repository.service.AbstractService; (The import conflicts with a type defined in the same file.)
AND
public class AbstractService extends AbstractService implements IOperationAdvisor
(Cycle detected: the type AbstractService cannot extend/implement itself or one of its own member types)

Any assistance would be appreciated.


Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Sep 17 '20, 3:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Sep 22 '20, 4:15 p.m.
You can basically follow the extensions workshop setup and then create an extension analogue to the follow up action. The extension point com.ibm.team.process.service.operationAdvisors is slightly different from the one used in follow up actions/participants (com.ibm.team.process.client.operationParticipants). But there are enough similarities to consider the workshop.

Please also see:

I like to start with an example that works. Consider the code available for https://rsjazz.wordpress.com/?s=advisor&submit=Search
Ryan McBryde selected this answer as the correct answer

Comments
Ryan McBryde commented Sep 21 '20, 12:33 p.m.

Thank you Ralph. Please pardon my Java ignorance but when you say to create an "extension analogue" to the participant, I understand that you are referring to creating an advisor. You also mention the extension point, ...operationAdvisors which I have seen in the examples, including Bartosz's but I am uncertain as to how to modify/adapt the existing instructions for building a participant to those for building an advisor.  I was hoping that I could simply follow Bartosz's example but given my limited Java knowledge I can't see how to extrapolate from his to my existing workshop environment.  I do have the participant working.

 


Ralph Schoon commented Sep 21 '20, 1:52 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This is Eclipse not Java. If you follow the work shop that creates a participant (follow up action), at some point the plugin XML shows up. That is where the extension is created. The Extension workshop adds a participant (extension point com.ibm.team.process.client.operationParticipants). An advisor uses the extension point com.ibm.team.process.service.operationAdvisors instead.

Ralph Schoon commented Sep 21 '20, 1:55 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
So all you need to know is to add an extension to com.ibm.team.process.service.operationAdvisors. The class you create has to implement AbstractServer and the extension point explains what else. It is com.ibm.team.process.common.advice.runtime.IOperationAdvisor as interface.

Sorry, can't do training for free. https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ explains a lot of that. Bartosz tells sthe same story with a different angle.

There is a lot of enablement on Eclipse.org. That is how I learned it.

Ryan McBryde commented Sep 22 '20, 2:23 p.m.

Thank you Ralph. I will do my best to get it.   Bartosz shows the advisor being developed in the RTC Eclipse client and so far I have been working in a standalone Eclipse client.  Does it matter if I do this work in one or the other or are they not interchangeable?  And so I am clear,  Eclipse is the IDE and Java is the language and the building of the extension, participant or advisor, is done in, and relies on the features of Eclipse to accomplish.  Is that correct?  I have tried to work through Bartosz example also but it appears that the version of RTC, 6.0.6.1 vs 5.0, is displaying different behavior.  


Ralph Schoon commented Sep 22 '20, 4:05 p.m. | edited Sep 22 '20, 4:24 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ryan,

I think I have, repeatedly, pointed out to follow the RTC Extensions Workshop (article 1000). That pretty clearly explains how you need to set up the Eclipse client (including the RTC extensions) and the SDK. Lab1 is a must for everyone. Lab 2 to the end if you are new to this.

If you don't want to follow that advice for some reason, or you can't, I think you should give up on trying to create server extensions for RTC. Even developing Plain Java Client Library applications is pretty much impossible when you don't setup the client for the SDK. It does not make sense for me to answer questions if you don't follow this basic procedure.

Ralph Schoon commented Sep 22 '20, 4:14 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Here is the link again, in case it was not clear: https://jazz.net/library/article/1000


Ralph Schoon commented Sep 22 '20, 4:17 p.m. | edited Sep 22 '20, 4:18 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

In case you have followed the workshop, I think you need any Eclipse and the RTC client installed into it e.g. using P2 (like in the workshop) or whatever other way you want to use. There are several possibilities, but you need the SDK to get the extension points.


Ralph Schoon commented Sep 22 '20, 4:26 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

WRT versions and different behavior, I have posted some findings on my blog (rsjazz.wordpress.com) but ingeneral they are pretty minor, pretty much unnoticeable, in the areas you ask about here, as far as I recall.


Ralph Schoon commented Sep 22 '20, 4:37 p.m. | edited Sep 22 '20, 4:37 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

And finally, the extension concept is not Java, it is based on OSGI and Eclipse. This was one of the open questions, I think, Ryan.


Ryan McBryde commented Sep 25 '20, 2:22 p.m.

Ralph,

Thank you very much for the information and for all the help that you have provided thus far. To be clear,  I have gone through the workshop, Labs 1-4, and I have the participant working as described.  When you say "extension analogue" I take that to mean that I can add an advisor extension in the Extensions tab of the extensions.service plugin.xml.  (com.ibm.team.process.service.operationAdvisors).  Details: id=net.jazz.rtcext.workitem.extensions.service.operationAdvisor, class=net.jazz.rtcext.workitem.extensions.service.OperationAdvisor, name=Demo Advisor, operationID=com.ibm.team.workitem.operation.workItemSave.
Right click on Demo Advisor(operationAdvisor) and select extension. Extension Element Details: componentID=net.jazz.rtcext.workitem.extensions.service.extensionService, Implementation Class=net.jazz.rtcext.workitem.extensions.service.AbstractService
When I click on the Implementation Class link it takes me into AbstractService.java and this is where I see the 2 errors that I referred to originally, before making any changes to the code. I would expect no errors in generated code.


Ralph Schoon commented Sep 25 '20, 2:47 p.m. | edited Sep 25 '20, 2:52 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ryan, you are expected to create a class say com.company.RyansAdvisor that extends AbstractService and implements IOperationAdvisor. The editor entry field where you select the class mentions the correct details AFAIK.

Class=com.company.RyansAdvisor 

This is really like in the Extensions Workshop, except your class implements IOperationAdvisor and not IOperationParticipant like in the workshop.

Ryan McBryde commented Sep 25 '20, 3:36 p.m.

Thank you very much Ralph,


I will look at that. With the participant the /net.jazz.rtcext.workitem.extensions.service/src/net/jazz/rtcext/workitem/extensions/service/BuildOnStateChangeParticipant.java had already been created for me.

For the advisor I will see if I can create the new class as you suggest and then use that class in the extends statement.  I was looking at that because the participant code showed this:  public class BuildOnStateChangeParticipant extends AbstractService implements IOperationParticipant

BTW, I have eliminated the errors that I was seeing

removed "import com.ibm.team.repository.service.AbstractService;" 

changed

public class AbstractService extends AbstractService implements IOperationAdvisor

to

public class AbstractService extends com.ibm.team.repository.service.AbstractService implements IOperationAdvisor


1
Ralph Schoon commented Sep 25 '20, 5:06 p.m. | edited Sep 25 '20, 5:06 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ryan, you do not want to call our class AbstractService. You want go give it a name that makes sense in your context. E.g. RyansWhateverAdvisor.

Good luck.

1
Ryan McBryde commented Sep 30 '20, 9:26 a.m.

Thank you for all your help Ralph!

I was able to create a new class for the AbstractServcie and use it with com.ibm.team.repository.service.AbstractService.

I can now compile AND run the the simple advisor.

Your help was invaluable!
 

showing 5 of 14 show 9 more comments

One other answer



permanent link
Bartosz Chrabski (3.4k22949) | answered Sep 16 '20, 1:30 p.m.
Hi Ryan,

Please make sure that OSGI version and all the plugin parameters and You should be fine.

As You have seen those videos were recorded some time ago and may be out of date.

I plan to record a new version of those videos with audio and EWM v7.

You can ping me next week about the status bart.chrabski@reqpro.com.

Comments
Ryan McBryde commented Sep 16 '20, 5:14 p.m.

Hi Bartosz,

Thanks very much for this response!
I will see if I can determine the OSGI version, any clues on where to find it?
I will re-check the plugin parameters and see if there is anything out of order.
Glad to hear about the new version in the future.  These are very helpful!
If I can't make any progress I may ping you at that address.
Reqpro.com?  Somewhere I have a 1.0 version of ReqPro, from Intersolv, still in the shrinkwrap!
Thank you again!


Ryan McBryde commented Sep 18 '20, 5:25 p.m.

Hi Bartosz,

Does your video show all the steps or is it based on having the dev environment as described in the Extensibility Workshop configured first?
TY

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.