Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Can Preconditions Display Warnings Instead of Errors?

I am currently trying to write a precondition that warns users to put in a comment when they add one or more values to an enum list. I am running this precondition on the server side and would want the warning to display after the work item is saved. Here is the code I have running inside my if statement if a new comment has not been added.


IAdvisorInfo createProblemInfo = collector.createProblemInfo("Need New Comment in Discussion!", "You must add a new comment in the Discussion area explaining why this Defect/Feature needs input from the team added in Needs Input From", "warning");
createProblemInfo.setSeverity(IProcessReport.WARNING);
collector.addInfo(createProblemInfo); 

Would this only work with the client side? Can warnings be displayed on workitems on the server side?

0 votes



One answer

Permanent link

Work item save advisors/preconditions work as follows:

  1. The user saves the work item. 
  2. Within the save transaction, the advisor tests if the save should happen or not
  3. The advisor adds all the causes that prevent the save and the save fails
  4. The advisor runs in the server and the fails/warnings/whatever show up in the UI, regardless if browser or Eclipse or any other client. In the browser you get the result as overlay. In Eclipse there is a special process advisor view. 
  5. There is an extension point for work item advisors that run in the Eclipse client, I would suggest to use the server side extension point, if you have the data needed on server side. This avoids the need to deploy client extensions and works for all clients.

It is usually a prevent save. You can see https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/ or other examples on that blog for how to implement this. I am not sure if warning prevents the save. you would have to play around with that. I think that a warning that does not prevent a save is pretty useless. You have a rule to enforce or you don't. 

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,603
× 1,432
× 419
× 3

Question asked: Feb 09, 7:04 p.m.

Question was seen: 81 times

Last updated: Feb 12, 4:21 a.m.

Confirmation Cancel Confirm