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;
Comments
Lukas Steiger
Dec 27 '17, 2:34 p.m.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
Parveen Patel
Dec 28 '17, 1:16 a.m.Hi Lukas,
By default in RTC this operation is not available, we need to add this in XML source manually
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 10 '18, 9:19 a.m.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.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 10 '18, 10:09 a.m.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.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 10 '18, 10:17 a.m.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.
Parveen Patel
Jan 11 '18, 1:36 a.m.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!!