It's all about the answers!

Ask a question

How to run operation advisor/participant when a project area is saved


Parveen Patel (77113) | asked Dec 27 '17, 6:36 a.m.
edited Dec 28 '17, 1:14 a.m.

Hi All,

I am trying to run custom participant on SaveProjectArea operation,

I am referring below question asked on forum:

https://jazz.net/forum/questions/99222/how-to-run-operation-advisorpartecipant-when-a-project-area-is-saved

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 commented 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 commented 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 commented Jan 10 '18, 9:18 a.m. | edited Jan 10 '18, 9:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented Jan 10 '18, 10:09 a.m. | edited Jan 10 '18, 10:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented Jan 10 '18, 10:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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

showing 5 of 6 show 1 more comments

Be the first one to answer this question!


Register or to post your answer.