Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.

1 vote

Comments

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?

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

1 vote

Comments

Great work, thank you for sharing!


One other answer

Permanent link
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?

0 votes

Comments

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

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).

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.

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"].

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

Glad to know we helped you. :) Cheers.

showing 5 of 6 show 1 more comments

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 411
× 89
× 51
× 27

Question asked: Jan 15 '13, 10:49 a.m.

Question was seen: 8,241 times

Last updated: Dec 28 '17, 1:53 p.m.

Confirmation Cancel Confirm