It's all about the answers!

Ask a question

Calculated value customization does not fire "on save".


Georgios Antonopoulos (2716) | asked Oct 19 '15, 11:55 a.m.
I created a calculated value customization and associated it with an attribute that is of type "Enumeration".
I used the default template (Fill in example) offered by RTC to create the customization an use it without changes.
I followed the instructions described here to activate and go into Debug mode.
According to the wiki the script of a calculated value is triggered on save.
However this does not happen.
The only way to trigger my event is to create a dependency between the calculated attribute and some other and try to change the value of the dependent attribute.
Only then does the event fire and my break point gets reached.
I tried establishing a dependency with the State attribute (which is the motivation for this calculated value) but still nothing.

I tried to debug on Firefox and Chrome.
I noticed that both browsers give me the following message on the console 3 times when I press "Save":
[Value Conversion]: could not interpret [object Object] as a string. Returning as empty string.
at the file: com.ibm.team.workitem.web.internal.model.types.StringAttributeType, line 74

Also, after the first save, every time I change the State (without pressing save), I get the following warning:
[New API Debug] Attribute changed event emitted on a non-chnaged attribute.
at the file com.ibm.team.workitem.web.mvvm.model.AttributeModel, line 179

I don't know if these messages are relevant but maybe they can give you a hint.

I run RTC 4.0.

I thank you in advance.
Giorgos

Comments
Donald Nong commented Oct 19 '15, 8:47 p.m.

You'd better post your script here, otherwise it's almost impossible to say what's wrong with it.

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Oct 19 '15, 9:08 p.m.
If you have read some related posts on this forum, you will notice it has been mentioned many times that the script is executed on both the client side (browser) and the server side. The first two cases mentioned in the Wiki where the calculated script is executed are on the server side, so you cannot debug it using a browser. You will need to use the "console.log" technique for this purpose. And you can find the output in the CCM/RTC eclipse log file (server/tomcat/work/Catalina/localhost/ccm/eclipse/workspace/.metadata/.log). The third case is on the client side and that is what you have seen.

You should also make sure that there is no error in your script, and those errors are not a good sign.
Georgios Antonopoulos selected this answer as the correct answer

Your answer


Register or 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.