It's all about the answers!

Ask a question

Can't edit work item save participant with custom schema


Anthony Krowiak (1111612) | asked Mar 16 '11, 2:46 p.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.

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


<extension>
<operationParticipant>
<extensionService>
<prerequisites>
<requiredService>
<requiredService>
</prerequisites>
</extensionService>
</operationParticipant>
</extension>


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


<extension>
<factory>
</factory>
</extension>


The code for my aspect editor factory is:

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;
}


My schema file looks like:

<xml>
<xsd>

<xsd>

<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
</xsd>
</xsd>
<xsd>
</xsd>
</xsd>
</xsd>

<xsd>
</xsd>


I configured permissions for the Team Configuration in the Process Configuration tab 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 select 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?

4 answers



permanent link
Anthony Krowiak (1111612) | answered Mar 16 '11, 2:55 p.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.

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


<extension>
<operationParticipant>
<extensionService>
<prerequisites>
<requiredService>
<requiredService>
</prerequisites>
</extensionService>
</operationParticipant>
</extension>


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


<extension>
<factory>
</factory>
</extension>


The code for my aspect editor factory is:

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;
}


My schema file looks like:

<xml>
<xsd>

<xsd>

<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
</xsd>
</xsd>
<xsd>
</xsd>
</xsd>
</xsd>

<xsd>
</xsd>


I configured permissions for the Team Configuration in the Process Configuration tab 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 select 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?


Sorry, I forgot to turn off HTML, so the guts of the xml did not show up in my original post. Here it is:


<extension>
<operationParticipant>
<extensionService>
<prerequisites>
<requiredService>
<requiredService>
</prerequisites>
</extensionService>
</operationParticipant>
</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>



<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>

permanent link
Anthony Krowiak (1111612) | answered Mar 16 '11, 2:58 p.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.

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


<extension>
<operationParticipant>
<extensionService>
<prerequisites>
<requiredService>
<requiredService>
</prerequisites>
</extensionService>
</operationParticipant>
</extension>


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


<extension>
<factory>
</factory>
</extension>


The code for my aspect editor factory is:

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;
}


My schema file looks like:

<xml>
<xsd>

<xsd>

<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
<xsd>
</xsd>
</xsd>
<xsd>
</xsd>
</xsd>
</xsd>

<xsd>
</xsd>


I configured permissions for the Team Configuration in the Process Configuration tab 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 select 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?


And for some reason, the work item save participant extension still did not show up. Here it is:


<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>

permanent link
Anthony Krowiak (1111612) | answered Mar 16 '11, 3:23 p.m.
I previously posted this question, but it took several replies to get the code inserts formatted correctly. I am recreating the post so that it is easier to navigate.

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?

permanent link
Anthony Krowiak (1111612) | answered May 11 '11, 2:34 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.

Your answer


Register or to post your answer.