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()...
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.Vivek Pandey
Oct 14 '16, 4:16 a.m.Miguel Tomico
Oct 14 '16, 5:53 a.m.