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

How can I stop an RTC Value Provider with no value to return from reporting an error

Using RTC 3.0.1.3, I have a value provider that records the date when a work item changes its state to "In Progress". The field it updates is dependent on "Status". It is working fine, but I am getting:

Error invoking value provider 'lbg.valueproviders.inProgressDateProvider'

The error occurs when I have no value to return, e.g. when the work item is created or when it first enters the "New" state. I can avoid the error when the state changes to "Done" by returning the current value.

How can I avoid the error? I have ten similar value providers and it doesn't look good to the customer to have dozens of entries in the Error Log

0 votes

Comments

What are you returning in the cases where you don't have a Date to return? Are you comfortable posting the script here (or a snippet of it that might help us debug)?

I am returning the old value (workItem.getValue(attribute)), which is null when the work item is first created. I have no problem sending the script, but I foolishly wasted too many of the character limit in my first posting.

(function() { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("xxxxxx", null, { getValue: function(attribute, workItem, configuration) { var now = dojo.date.stamp.toISOString(new Date(), {milliseconds:true, zulu:true}); var state = workItem.getValue(WorkItemAttributes.STATE); var myOldValue = workItem.getValue(attribute); if (state) {
switch (state) { case 'taskworkflow.state.s2': //In Progress if (myOldValue == null) { return now; } break;
} } return myOldValue; } }); }) ();



One answer

Permanent link
Sorry for the delay in getting back to you, Bill (yes, my vacation was lovely).

I tested this in 3.0.1.3 and I see the errors -- and the stack trace isn't very helpful.

When I test in 4.0, I still see the errors, but they now report a Null Pointer Exception -- which is largely accurate because you are returning a null from getValue() which may have a right to expect you to return something. I'm working on clarifying the actual requirements (i.e., should you be expected to return a non-null value) and how we should better handle this on our end -- dumping an exception to the log doesn't seem particularly useful.

UPDATE: An error should not be getting thrown. I have filed a defect for the issue. https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=217542

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
× 6,121
× 369

Question asked: Jun 19 '12, 4:58 a.m.

Question was seen: 5,751 times

Last updated: Jul 12 '12, 1:39 p.m.

Confirmation Cancel Confirm