How can I create a configurable Operation Participant?
I want to create an operation participant that is invoked when a work item is saved. I've been able to do that, but what I really want to be able to do is allow the administrator to configure it when they enable it in the Process Configuration tab of the Project Area so they can select which work item types this operation participant will be invoked on.
I see the IOperationParticipant.run() method passes in a IProcessConfigurationElement object which would contain the configuration in XML format, and I can specify a schema to define what XML I expect, but how can I get RTC to provide the UI in the Process Configuration tab to allow the administrator to specify the configuration?
For example the built in operation advisors/participants provide a UI to configure them (for example the E-Signature advisor) but I don't see a way of being able to do the same for a custom operation advisor/participant.
I was hoping that just providing the schema might magically mean a UI is provided, but that didn't make any difference for me so it seems there must be something else that needs to be done to be able to provide a UI to configure the advisor/participant.
Any help would be greatly appreciated as working on a tight RTC deadline to get this into our environment for testing.
Thanks,
Dan Rivett
CICS TS L3 Service
I see the IOperationParticipant.run() method passes in a IProcessConfigurationElement object which would contain the configuration in XML format, and I can specify a schema to define what XML I expect, but how can I get RTC to provide the UI in the Process Configuration tab to allow the administrator to specify the configuration?
For example the built in operation advisors/participants provide a UI to configure them (for example the E-Signature advisor) but I don't see a way of being able to do the same for a custom operation advisor/participant.
I was hoping that just providing the schema might magically mean a UI is provided, but that didn't make any difference for me so it seems there must be something else that needs to be done to be able to provide a UI to configure the advisor/participant.
Any help would be greatly appreciated as working on a tight RTC deadline to get this into our environment for testing.
Thanks,
Dan Rivett
CICS TS L3 Service
4 answers
After further digging, I think I can answer my own post so adding it here in case it's useful for others, or that I'm wrong and I can be rebutted! :)
It looks like we need to implement another extension point: com.ibm.team.process.ide.ui.processAspectEditorFactories providing a IProcessAspectEditorFactory implementation that will provide a ProcessAspectEditor object for the id matching the operationId of the advisor/participant we're implementing in the com.ibm.team.process.service.operation extension point I had already implemented.
For example for the E-Signature advisor I mentioned it implements the following 2 extension points as follows, with the first one specifying how to contribute UI to configure the advisor/participant:
This doesn't seem particularly lightweight, and means it becomes a lot of work to make a configurable rather than a non-configurable operation participant.
It looks like we need to implement another extension point: com.ibm.team.process.ide.ui.processAspectEditorFactories providing a IProcessAspectEditorFactory implementation that will provide a ProcessAspectEditor object for the id matching the operationId of the advisor/participant we're implementing in the com.ibm.team.process.service.operation extension point I had already implemented.
For example for the E-Signature advisor I mentioned it implements the following 2 extension points as follows, with the first one specifying how to contribute UI to configure the advisor/participant:
<extension point="com.ibm.team.process.ide.ui.processAspectEditorFactories">
<factory
aspectId="com.ibm.team.workitem.advisor.eSignature"
class="com.ibm.team.workitem.ide.ui.internal.aspecteditor.teamoperation.WorkItemTeamOperationAspectEditorFactory">
</factory>
</extension>
<extension point="com.ibm.team.process.service.operationAdvisors">
<operationAdvisor
class="com.ibm.team.workitem.service.internal.save.ESigAdvisor"
id="com.ibm.team.workitem.advisor.eSignature"
name="%ESignature.advisor.name"
operationId="com.ibm.team.workitem.operation.workItemSave"
schema="schema/eSignature.xsd">
<description>
%ESignature.advisor.description
</description>
</operationAdvisor>
</extension>
This doesn't seem particularly lightweight, and means it becomes a lot of work to make a configurable rather than a non-configurable operation participant.
After further digging, I think I can answer my own post so adding it here in case it's useful for others, or that I'm wrong and I can be rebutted! :)
It looks like we need to implement another extension point: com.ibm.team.process.ide.ui.processAspectEditorFactories providing a IProcessAspectEditorFactory implementation that will provide a ProcessAspectEditor object for the id matching the operationId of the advisor/participant we're implementing in the com.ibm.team.process.service.operation extension point I had already implemented.
Yes, this is correct.
- Jared
This doesn't seem particularly lightweight, and means it becomes a lot of work to make a configurable rather than a non-configurable operation participant.
Dan,
have you considered to make your participant configurable, but without providing a GUI for the process specification editor? This option only requires that you define a XML schema for the configuration syntax of your participant. However, you (or your admins) would have to configure your participant in the process specification source editor - but, by means of the schema, at least with code completion.
Regards
Markus