Server Side Plugin : Plugin is not called on Save operation when the Workitem state is not changed.
Hello Team,
We are implementing a server side advisor which works on Workitem save operation. It checks whether all the workitems linked using the "Tracks" link are closed or not. If not closed it doesnt allow to save the workitem.
The plugin is working as expected here but there is a second usecase where the "Workitem" shouldnt be allowed to link when the Workitem is in closed state.
I have workitem in closed state, for which i link the new workitem which is in open state. Here the Advisor is not called at all.
What is the reason for the advisor not getting called here ?
Below is a short code snippet:
public class LinkCalculator extends AbstractService implements
IOperationAdvisor {
String selectedResolution;
ArrayList<ParsedConfig> xmlConfiguredData=new ArrayList<ParsedConfig>();
ArrayList<String> xmlLinkedWIList = new ArrayList<String>();
String newType;
@Override
public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
try{
Object data = operation.getOperationData();
if (!(data instanceof ISaveParameter)){
return;
}
ISaveParameter saveParameter = (ISaveParameter) data;
IAuditable auditable = saveParameter.getNewState();
if (!(auditable instanceof IWorkItem)){
return;
}
IWorkItem workitem = (IWorkItem) saveParameter.getNewState();
Thanks in advance.
|
One answer
Ralph Schoon (63.6k●3●36●46)
| answered Jul 19, 3:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jul 19, 4:25 a.m. This works as designed. There are different kinds of links including.
Links like OSLC links that can span multiple repositories do not trigger operational behavior when being changed (add or delete the link).
I tried to develop a similar extension in the past, and it is just not possible to detect the link change for these kinds of link types.
|
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.