validator for iteration name
Accepted answer
As discussed, I really would consider other options before going this route. Nevertheless,
The operation he should be looking at is:
<project-operation id="com.ibm.team.process.server.saveProjectArea">
Here's some code to start with:
public class IterationSaveOperationParticipant extends AbstractService implements IOperationParticipant {
@Override
public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
if (operation instanceof ProjectAreaSaveOperation)
{
ProjectAreaSaveOperation operationData = (ProjectAreaSaveOperation) operation;
List<IProcessItem> savedItems = Arrays.asList(operationData.getSavedItems());
for (IProcessItem savedItem : savedItems)
{
if (savedItem.getProcessItemType() == IProcessItem.ITERATION)
{
IRepositoryItemService itemService = getService(IRepositoryItemService.class);
IIteration newIteration = (IIteration) savedItem;
...validate here newIteration.getName()...
Comments
Good one. Not sure why I missed it. Agree with your assessment.
1 vote
If you want to follow Miguel's suggestion, start here: https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/
One other answer
In general, it is possible to write process advisors. But you need an operation that you can use. I am not sure there is such an operation. These are the ones available: https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable#operations
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 12 '16, 7:13 a.m.What would be the purpose/use case for such a validator? See How should I ask a question in the Forum if I want to receive useful answers?
Vivek Pandey
Oct 14 '16, 4:16 a.m.thanks for the notes Ralph , I did not want to make question too lengthy for it to be ignored for complexity.
Miguel Tomico
Oct 14 '16, 5:53 a.m.Well... implementing a validation is technically possible by developing a server-side script, but that requires development effort + testing + deployment, etc.
The point here is... is it worth it?
Bear in mind that only a subset of your user-base should have permission to modify Team Areas and Iterations, so maybe it would be easier to educate them in the naming convention you want to use.