It's all about the answers!

Ask a question

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

Bill Taylor (3144) | asked Jun 19 '12, 4:58 a.m.
edited Jul 11 '12, 8:35 p.m. by Jared Burns (4.5k29)
Using RTC, 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

Millard Ellingsworth commented Jun 19 '12, 6:15 p.m.

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)?

Bill Taylor commented Jun 20 '12, 4:14 a.m.

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.

Bill Taylor commented Jun 21 '12, 3:57 a.m.

(function() { var WorkItemAttributes =; dojo.declare("xxxxxx", null, { getValue: function(attribute, workItem, configuration) { var now = 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
Millard Ellingsworth (2.5k12431) | answered Jul 11 '12, 6:30 p.m.
edited Jul 12 '12, 1:39 p.m.
Sorry for the delay in getting back to you, Bill (yes, my vacation was lovely).

I tested this in 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.

Your answer

Register or to post your answer.