It's all about the answers!

Ask a question

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


SEC Servizi (97123860) | asked Jan 15 '13, 10:49 a.m.
edited Dec 28 '17, 1:53 p.m. by Geoffrey Clemm (30.1k33035)

We would run our own follow-up action (i.e., operationParticipant) when a Project Area is saved.

When the "Save" button is fired, we see the operation run is "com.ibm.team.process.server.saveProjectArea".
public void run(AdvisableOperation operation, IProcessConfigurationElement participantConfig, IParticipantInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException {
    Object objData = operation.getOperationData();
    if (objData instanceof ProjectAreaSaveOperation) {
        // ...
However, in the Project Configuration view, we can find only "com.ibm.team.dashboard.server.savePersonalDashboard" and "com.ibm.team.dashboard.server.saveProjectDashboard" as extendable project operation ids.
How can we run custom operation advisors/operation partecipants when a Project Area is saved?
Thanks in advance.


Comments
Jared Burns commented Jan 15 '13, 1:54 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Can you give some background on what you're trying to accomplish? What do you want to do in a follow-up action on project area save?


SEC Servizi commented Jan 16 '13, 4:12 a.m. | edited Jan 16 '13, 4:13 a.m.

We are trying to programmatically create a new repository worspace when a user is add to a project area.

Because we don't see any action for membership change, we suppose to use the project area saving action...

Accepted answer


permanent link
SEC Servizi (97123860) | answered Jan 18 '13, 7:23 a.m.
edited Jan 18 '13, 7:25 a.m.
Ok, everything seems to work and we are able to run the partecipant only when membership change:
public void run(AdvisableOperation operation, IProcessConfigurationElement participantConfig, IParticipantInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException {
Object objData = operation;
  if (!(operation instanceof ProjectAreaSaveOperation)) {     return;   }   ProjectAreaSaveOperation data = (ProjectAreaSaveOperation) objData;   List<String> actions = Arrays.asList(data.getActions());   if (!actions.contains(ProjectAreaSaveOperation.ACTION_MODIFY_MEMBERS)) {     return;   }   // ...
Now we would like to know how the client follow-up action "Send Team Invitation to New Members" is invoked since its behaviour is very similar to our new action...
Ralph Schoon selected this answer as the correct answer

Comments
Lukas Steiger commented Dec 27 '17, 2:32 p.m.

Great work, thank you for sharing!

One other answer



permanent link
SEC Servizi (97123860) | answered Jan 15 '13, 11:01 a.m.
edited Jan 15 '13, 11:05 a.m.
Ok, if we manually add:
<behavior>
    <role id="team-member">
        <project-operation id="com.ibm.team.process.server.saveProjectArea">
            <followup-actions>
                <followup-action id="it.secservizi.rtc.admin.server.postop.Foo" />
            </followup-actions>
        </project-operation>
    </role>
</behavior>
	
	
	
	
to the Process Configuration Source of the Project Area, then the operation partecipant is invoked!
But... is this the right way?

Comments
sam detweiler commented Jan 15 '13, 2:34 p.m.

I do not see a save project area event in the process configuration.


SEC Servizi commented Jan 16 '13, 4:04 a.m.

We have to manually modify the Process Configuration Source (i.e., the XML source) to invoke a "com.ibm.team.process.server.saveProjectArea" partecipant.

In fact, this operation id is not available in the Process Configuration view (as I wrote above).


Nate Decker commented Sep 30 '14, 3:41 p.m.

Where are you putting this XML node in your Process Configuration Source? There is a block of "project-operation" settings under the "Permissions" node, but not the "behavior" node. If you try to add the XML you have listed above to the permissions node, "followup-actions" is not a legal element at this location.

Similarly, there are "followup-actions" defined for the behavior, but you evidently cannot define "project-operation" elements in this behavior node. The tool flags this as not being one of {"http://com.ibm.team.process":operation} types.


SEC Servizi commented Oct 01 '14, 3:34 a.m. | edited Oct 01 '14, 3:35 a.m.

The XPath in to Process Configuration Source is: /process-specification/project-configuration/behavior/role[@id="default"]/project-operation [@id="com.ibm.team.process.server.saveProjectArea"]/followup-actions/followup-action[@id="it.secservizi.rtc.admin.server.postop.Foo"].


Nate Decker commented May 27 '15, 9:10 a.m. | edited May 27 '15, 10:04 a.m.

You, sir, are the man! Thanks so much. This will help us a lot in our environment.

Scenario: We have a single process parent that we use to provide configurations for multiple child project areas (i.e., the "Process Sharing" feature). Sometimes end-users don't know what they are doing and they break inheritance from the process parent. We've wanted a tool for a long time that gives us the ability to validate that action and we might have what we need now.

One more question: What do I need to import to have access to the data type "ProjectAreaSaveOperation"?

Never mind, I figured it out. Evidently I needed to add the package "com.ibm.team.process.internal.service" and then import com.ibm.team.process.internal.service.ProjectAreaSaveOperation


SEC Servizi commented May 27 '15, 10:26 a.m.

Glad to know we helped you. :) Cheers.

showing 5 of 6 show 1 more comments

Your answer


Register or to post 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.