How to run operation advisor/participant when a project area is saved
![]() Hi All, I am trying to run custom participant on SaveProjectArea operation, I am referring below question asked on forum: I am testing this on jetty server but this participant is not working on jetty, do I need to deploy this directly on server. Also I am unable to find API to read IIteration , please refer below code snippet:
public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
// TODO Auto-generated method stub
//Get object of current Operation Data
Object objData = operation;
if (!(operation instanceof ProjectAreaSaveOperation)) {
return;
}
ProjectAreaSaveOperation projectAreaData = (ProjectAreaSaveOperation) objData;
List<String> actions = Arrays.asList(projectAreaData.getActions());
if(!(actions.contains(ProjectAreaSaveOperation.ACTION_MODIFY_ITERATION))) {
return;
}
Here I want to check current modified iteration. How can we check current saved Item is Iteration and it's value as we are doing for work items given in below snippet:
public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
Object data = operation.getOperationData();
if ((data instanceof ISaveParameter))
{
ISaveParameter param = (ISaveParameter)data;
IAuditable auditable = param.getNewState();
if ((auditable instanceof IWorkItem)) {
IWorkItem sourceworkItem = (IWorkItem)auditable;
showing 5 of 6
show 1 more comments
|
Be the first one to answer this question!
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.
Comments
Is the participant available? Are there any errors in the CCM log?
You should format your source code (the editor is crap, i know) in order to get an answer
Hi Lukas,
By default in RTC this operation is not available, we need to add this in XML source manually
If this does not work in Jetty, it will definitely not work in a production environment. If the participant can not be selected in the process configuration, it is not deployed or otherwise available.
With resprect to
com.ibm.team.process.server.saveProjectArea
This is not published in https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable#operations and it does not show up as configurable. Not sure if we can help much then.
So if it does not show up in the Eclipse process configuration you have to manually add it and you have to make sure to do that right. If you fail it will never work. It will in Jetty, if you do it right.
Hi Ralph,
Have you tried adding such type of custom operation in XML, I am referring the link which I mentioned above, followed same steps but no luck!!