What Type of RTC Server Extension Should I Use?
I have a requirement that 5 days after a work item is deployed to production all the package, deployment and backup files created during the development of the work item will be deleted. I first looked at Operation Participant(IOperationParticipant) but it didn't seem appropriate. What other type of RTC Server extension could be used?
Accepted answer
Hi Andrew,
one solution approach to this can be to create a new scheduler that searches for such work items and checks whether this +5 days condition is met to perform the cleanup. Look at the extension point com.ibm.team.repository.service.asynchronousTask; your implementation class would extend AbstractAutoScheduledTask.
For the actual finding of the deployed work item, I suggest you to mark it somehow if not already done: certain state or tag for example (tag sounds a better fit). You can automate this using a follow-up, there are some existing ones that does this tagging already that you can use or code your own.
One additional comment regarding the "cleanup" you want to implement, you would normally be archiving elements instead of doing a deletion. Deleting elements from the repository can have side effects (i.e. if referenced by others).
Regards,
Jorge.
one solution approach to this can be to create a new scheduler that searches for such work items and checks whether this +5 days condition is met to perform the cleanup. Look at the extension point com.ibm.team.repository.service.asynchronousTask; your implementation class would extend AbstractAutoScheduledTask.
For the actual finding of the deployed work item, I suggest you to mark it somehow if not already done: certain state or tag for example (tag sounds a better fit). You can automate this using a follow-up, there are some existing ones that does this tagging already that you can use or code your own.
One additional comment regarding the "cleanup" you want to implement, you would normally be archiving elements instead of doing a deletion. Deleting elements from the repository can have side effects (i.e. if referenced by others).
Regards,
Jorge.
Comments
Thanks Jorge, I will look into this solution.
Jorge, I have decided to go with this solution. I found some great information in the QueryDevGuide.
2 other answers
Andrew, that depends on what data needs to be purged and where. See https://jazz.net/library/article/807 for some thoughts related with build artifacts.
Comments
I recently created an extension that creates a team area, stream, workspace,
and all Enterpise Build Definitions when a Work Item state changes. My new extension needs to delete everything I created in the first extension plus all build requests and build results 5 days after the work item is deployed to production.
5 days after the work item is deployed: you mean that this work item that originated all the elements (on state creation), would be the one with the change sets linked, and used for packaging and deployment?
Andrew, is there any logic (state change, attribute value, ...) after the work item has been successfully deployed?