Passing configuration data into a Participant?
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!
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
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
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