It's all about the answers!

Ask a question

Passing configuration data into a Participant?


Susan Hanson (1.6k2190193) | asked Sep 10 '14, 12:31 p.m.
I have several Advisors and Participants and I would like to be able to have a "common" one that can get values passed in that are configured in the project XML.  In this way, the value passed in can be changed without going through the process of redeploying the participant, which for me is a difficult process in production since it requires a restart which doesn't occur very often (cuz it is production).

Is there a way to somehow put something in the Project Area XML that then gets passed into the OperationAdvisor or OperationParticipant that it can get ahold of during the run() method?

Thanks!

One answer



permanent link
sam detweiler (12.5k6189201) | answered Sep 10 '14, 4:17 p.m.
yes,

here is what I pass to my approval injector
<operation id="com.ibm.team.workitem.operation.workItemSave">
<followup-action xmlns="//// description="..." id="..." name="sdApprovalInjector"">                             
     <approvalbyrole workItemType="defect" approvaltype="review" oldSstate="In Progress" newState="Review"  role="reviewer" label="Code Review"/>                       
     <approvalbyrole workItemType="defect" approvaltype="verify" oldSstate="Implemented" newState="Verifying"  role="QA"/>
     <approvalbyrole workItemType="defect" approvaltype="Approve" oldState="Verifying" newState="Verified"  role="Scrum Master"/>
     <approvalbyrole workItemType="story"  approvaltype="review" oldSstate="new" newState="in progress" role="QA"/>                       
     <approvalbyrole workItemType="story"  approvaltype="Approve" oldSstate="in progress" newState="implemented" role="Product Owner" label="Product Owner Approval/>       

     <approvalbyuserid workItemType="defect" approvaltype="review" oldSstate="In Progress" newState="Review"  userid="sam" label="Some weird review"/>                       
     <approvalbyuserid workItemType="defect" approvaltype="verify" oldSstate="Implemented" newState="Verifying"  userid="bob@strawberry.farms.com"/>
     <approvalbyuserid workItemType="defect" approvaltype="Approve" oldState="Verifying" newState="Verified"  userid="pete@foo.com"/>
     <approvalbyuserid workItemType="story"  approvaltype="review" oldSstate="new" newState="in progress" userid="mary@test.net"/>                       
     <approvalbyuserid workItemType="story"  approvaltype="Approve" oldSstate="in progress" newState="implemented" userid="boss@test.net"/>      
               </followup-action>

code
                            // loop thru the approval config records                           
                            for (IProcessConfigurationElement selement : participantConfig.getChildren())
                            {
                                // should only be for one of our specific names
                                if (selement.getName().toLowerCase().startsWith(APPROVAL_NAME.toLowerCase()))
                                {
                                }
                            }

I created a special class to handle user mismatch of cause

Comments
sam detweiler commented Sep 10 '14, 5:28 p.m.

and for sharing info collected with one, you could create a 'service' that the others connect to to retrieve the data. the service is just another plugin. you could package with the participant.

Your answer


Register or to post your answer.