It's all about the answers!

Ask a question

Custom schema editor for follow-up action not displayed


Anthony Krowiak (1111612) | asked Mar 17 '11, 9:55 a.m.
I need to be able to create other types of work items when a particular type of work item is saved. I want to be able to configure the work item types to be created and the class - implements an interface - that provides attribute values for the new work item derived from the work item being saved.

It seems that the best way to do this is to implement a work item save participant extension with a custom schema that can be configured with the work item type(s) and value provider class(es) to be created.

I created an extension for the com.ibm.team.process.service.operationParticipants extension point:


<extension point="com.ibm.team.process.service.operationParticipants">
<operationParticipant
class="com.ibm.sport.rtc.extension.CreateAparAssociatedWorkItemsSaveParticipant"
id="com.ibm.sport.rtc.extension.createAparAssociatedWorkItemsSaveParticipant"
name="SPoRT Create APAR-associated Work Items Save Participant"
operationId="com.ibm.team.workitem.operation.workItemSave"
schema="schema/createAparAssociatedWorkItemTypes.xsd">
<extensionService
componentId="com.ibm.sport.rtc.extension.createAparAssociatedWorkItemsSaveParticipant"
implementationClass="com.ibm.sport.rtc.extension.CreateAparAssociatedWorkItemsSaveParticipant">
<prerequisites>
<requiredService interface="com.ibm.team.process.service.IProcessServerService"/>
<requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/>
</prerequisites>
</extensionService>
</operationParticipant>
</extension>


I created the schema describing how to configure the work item types:

<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://com.ibm.sport.rtc.process.service.operationParticipants/createAparAssociatedWorkItems"
targetNamespace="http://com.ibm.sport.rtc.process.service.operationParticipants/createAparAssociatedWorkItem"
xmlns:process="http://com.ibm.team.process"
attributeFormDefault="unqualified" elementFormDefault="qualified">

<xsd:import namespace="http://com.ibm.team.process"
schemaLocation="platform:/plugin/com.ibm.team.process.common/schema/ProcessSettings.xsd"/>

<xsd:complexType name="aparAssociatedWorkItemTypes">
<xsd:complexContent>
<xsd:restriction base="process:followupActionType">
<xsd:element name="aparAssociatedWorkItemType" maxOccurs="1" minOccurs="0">
<xsd:attribute name="projectArea" type="xsd:string" use="required"/>
<xsd:attribute name="workItemType" type="xsd:string" use="required"/>
<xsd:attribute name="valueProviderClass" type="xsd:string" use="required"/>
</xsd:element>
</xsd:restriction>
<xsd:attribute name="id" type="xsd:string" use="required" fixed="com.ibm.sport.rtc.process.service.operationParticipants.createAparAssociatedWorkItems"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>

<xsd:element name="followup-action" substitutionGroup="process:followup-action" type="aparAssociatedWorkItemTypes"/>
</xsd:schema>



I also created an extension for the com.ibm.team.process.ide.ui.processAspectEditorFactories extension:


<extension
point="com.ibm.team.process.ide.ui.processAspectEditorFactories">
<factory
aspectId="com.ibm.sport.rtc.extension.createAparAssociatedWorkItemsSaveParticipant"
class="com.ibm.sport.rtc.process.ide.ui.processAspectEditors.AparAssociatedWorkItemTypesAspectEditorFactory">
</factory>
</extension>


I created an aspect editor class for supplying the editor controls and an aspect editor factory class that supplies the editor. The relevant code is below:

public ProcessAspectEditor createProcessAspectEditor(
String processAspectId )
{
ProcessAspectEditor editor = null;

if(processAspectId.equals( "com.ibm.sport.rtc.extension.createAparAssociatedWorkItemsSaveParticipant" ) ||
processAspectId.equals( "com.ibm.sport.rtc.extension.workItemSaveParticipant" ) )
{
editor = new AparAssociatedWorkItemTypesAspectEditor();
}

return editor;
}


Lastly, I created an extension for the aspect editor factory that provides the aspect editor for my work item save participant extension schema:


<extension
point="com.ibm.team.process.ide.ui.processAspectEditorFactories">
<factory
aspectId="com.ibm.sport.rtc.extension.createAparAssociatedWorkItemsSaveParticipant"
class="com.ibm.sport.rtc.process.ide.ui.processAspectEditors.AparAssociatedWorkItemTypesAspectEditorFactory">
</factory>
</extension>


I configured permissions for the Team Configuration process in the Process Configuration tab of the process editor and assigned every permission available to the process role assigned to my user id. I rebuilt the update site, shut down my eclipse client and web client, stopped the tomcat server, and deleted the tomcat server work directory.

I fired everything back up and opened the team process editor. I selected the Team Configuration -> Operation Behavior configuration editor. When I scroll down to the Work Items->Work Item Save operation, I see that only the default role column has a selectable icon in it. I select that icon and the Preconditions and follow-up actions editor is enabled. Why do I not see the follow up action I configured in this editor? The Add button is disabled next to the Follow-up actions table, so I can't add it either.

For jollies, I tried adding the schema to a previously existing work item save participant extension and changed the aspect editor factory's aspect ID accordingly. When I select the follow-up action, the schema editor does not get displayed.

A couple of questions I need answered:

    Is this the right approach for what I want to do:
    What else do I need to do to display the editor for the follow-up action?
    What determines which roles can open the follow-up actions editor?
    Why is my Add button disabled for the follow-up actions editor?

6 answers



permanent link
Anthony Krowiak (1111612) | answered May 11 '11, 2:33 p.m.
I resolved this issue. I noticed that the tomcat startup was failing to load my plug-in because its manifest indicated a dependency on com.ibm.team.process.ide.ui which does not exist on the server. I moved my aspect editor factory extension into a client-side plug-in which allowed the server-side plug-in to successfully load. I was then able to successfully edit my operation participant's configuration.

permanent link
Anthony Krowiak (1111612) | answered Mar 31 '11, 11:57 a.m.
I created a simple plug-in based on the Hello World Advisor plug-in. I added a custom schema to the com.ibm.team.process.service.operationAdvisors extension that has one element, with a single attribute value. I also created a com.ibm.team.process.ide.ui.processAspectEditorFactories extension with an aspectId that matches the operation advisor's id.

The advisor precondition does show up in the Team Configuration, Operation Behavior for the work item save action, however; the aspect editor factory's createProcessAspectEditor(String processAspectId) method never gets called.

The operation advisor extension does get invoked when a work item is saved, so I am pretty sure that the plug-in is correctly installed. I tried all suggestions previously mentioned. What am I missing?

permanent link
Eduardo Bello (4401922) | answered Mar 18 '11, 8:59 a.m.
Just complementing the post of huangqf, you can check if yours plug-ins are correctly loaded typing "ss" on your server console. This will show all bundles loaded and it states.

permanent link
Qiong Feng Huang (76911610) | answered Mar 18 '11, 12:55 a.m.
JAZZ DEVELOPER
This is what you mentioned:
I see that only the default role column has a selectable
icon in it. I select that icon and the Preconditions
and follow-up actions
editor is enabled. Why do I not
see the follow up action I configured in this editor? The Add button
is disabled next to the Follow-up actions table, so I can't add it
either.

Firstly, you can click and choose any block on the operation behavior
table. The icon you see in the default column doesn't mean this is
selectable. Instead, that means this configuration for default role has
been configured.

Secondly, please make sure the check box "Preconditions and follow-up
actions are configured for this operation" is checked if you want to
configure this operation. Otherwise, the Add button is disabled.

If you can't see the follow-up action contributed by yourself in the Add
Follow-up Action dialog, that means your follow-up action is not
recognized by the server. So, you need to make sure the plugin which
contain the extension is deployed on server correctly. If the plugin is a
new plugin, you might need to reset the server to load the new plugin.
Invoking the following URL
https://localhost:9443/jazz/admin/cmd/requestReset and restart the server.

permanent link
Anthony Krowiak (1111612) | answered Mar 17 '11, 5:26 p.m.
Here are some useful links you might be intereted in:
https://jazz.net/wiki/bin/view/Main/PreconditionFollowupCreation
https://jazz.net/wiki/bin/view/Main/ProcessAspectEditorCreation

Those are the documents I used to create my extensions. The problem I am having is that after creating the operationParticipant - with custom schema - and the processAspectEditorFactories extensions as described above, I can not get the follow-up action or the editor to show up. I was hoping someone would be able to tell me what I am missing, or what I did wrong, which is why I included all of the pertinent process XML and java code.

permanent link
Qiong Feng Huang (76911610) | answered Mar 17 '11, 9:55 a.m.
JAZZ DEVELOPER
Here are some useful links you might be intereted in:
https://jazz.net/wiki/bin/view/Main/PreconditionFollowupCreation
https://jazz.net/wiki/bin/view/Main/ProcessAspectEditorCreation

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.