Attribute customizations implemented in java
![]()
Hi,
I'd like to set an attribute value of a work item based on other attribute of other work items. I'm implementing this customization in java and I've followed at the end of Page the instructions in https://jazz.net/wiki/bin/view/Main/AttributeCustomization My test have been developed and tested with RTC version 3.0.1.2 This is what I have discovered so far. 1. Editing the plug-in configuration I've added the following dependencies:
So I had to manually configure its mandatory attributes. 2. Just to test, I've created a simple plugin (without make reference to any services) that return just a List of strings. I've provisioned the RTC server and Eclipse clients and configured attribute to use the new customization. Until now the attribute customization implemented in Java works fine. 3. To retrieve Summary attribute of other work items that my class should return I've modified my class: package com.ibm.team.workitem.customization; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import com.ibm.team.common.ProcessProperty; import com.ibm.team.process.common.IProjectAreaHandle; import com.ibm.team.repository.common.TeamRepositoryException; import com.ibm.team.repository.service.AbstractService; import com.ibm.team.workitem.common.IQueryCommon; import com.ibm.team.workitem.common.IWorkItemCommon; import com.ibm.team.workitem.common.expression.AttributeExpression; import com.ibm.team.workitem.common.expression.IQueryableAttribute; import com.ibm.team.workitem.common.expression.IQueryableAttributeFactory; import com.ibm.team.workitem.common.expression.QueryableAttributes; import com.ibm.team.workitem.common.internal.attributeValueProviders.IConfiguration; import com.ibm.team.workitem.common.internal.attributeValueProviders.IValueSetProvider; import com.ibm.team.workitem.common.model.AttributeOperation; import com.ibm.team.workitem.common.model.IAttribute; import com.ibm.team.workitem.common.model.IWorkItem; import com.ibm.team.workitem.common.query.IQueryResult; import com.ibm.team.workitem.common.query.IResolvedResult; import com.ibm.team.workitem.service.IQueryServer; public class SetValueApplicazione extends AbstractService implements IValueSetProviderThen I've manually updated the plugin.xml adding an extensionService with prerequisite: The getservice does not work and I get this error: ERROR com.ibm.team.workitem.common - 'com.ibm.team.workitem.valueproviders.VALUE_SET_PROVIDER._fyQ-4DpREeKUUtygZ9ae3g' java.lang.IllegalArgumentException: The service 'com.ibm.team.workitem.customization.SetValueApplicazione@333c333c' failed to find the required service 'interface com.ibm.team.workitem.common.IQueryCommon'. CheckHave someone else try it? Is it possibile to add an extension service with prerequisites like IQueryCommon to the extension point com.ibm.team.workitem.common.attributeValueProviders ? Thanks for your time, Saverio |
2 answers
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Dec 06 '13, 9:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Saverio, Dimitrios, it worked for me. See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ the code is attached.
There was a small issue with the schema, which I reported and should be fixed already. I can only speak about 4.0.x and it works there. I can't say why I won't work with the 3.0.1.2 version. Comments Hi Ralph,
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Dimitrios,
Hi Dimitrios,
Hi Ralph,
Hi Ralph,
Some might only run on the server. I'd look up if I published which ones in the process enactment workshop in the library. I have also seen that different attribute types behave different with calculated values. E.g. I think work items only show after the save.
I will try to find out more. You can reach a good amount of services already, but I think not all. Maybe you can code providers for the client and for the server. i have not tried that, and I don't think I want to go that route either.
Far as I can tell, there is no structure for executing the java eclipse plugin extensions while running a Plain Java client application. you don't have the full eclipse and osgi frameworks available.
showing 5 of 8
show 3 more comments
|
![]()
Hi All,
I had recently the same task - I needed to work with IQueryCommon service inside com.ibm.team.workitem.common.attributeValueProviders extension point. At last I have found a quite simple solution, which doesn't need 'prerequisites' section in the plugin.xml: IQueryCommon queryService = (IQueryCommon)workItemCommon.getAuditableCommon().getPeer(IQueryCommon.class); The getPeer() method in the IAuditableCommon interface is marked as Deprecated, but this method is still used in several non-deprecated methods (see, for instance, com.ibm.team.workitem.common.internal.AuditableCommon class). The IQueryCommon service retrieved as described above works fine in my ICondition component, but the extra testing would be quite appropriate of course. I would like to apologize in advance if this solution has any latent downsides. |
Comments
Hi, have you found a solution to this problem yet?
Regards,
Dimitrios