It's all about the answers!

Ask a question

Error while executing calculated java script in rtc


Pallavi Deore (38148) | asked Oct 14 '19, 8:35 a.m.

Hello Everyone,


I am using CLM 6.0.6.
I have written a calculated script which return result to attribute of type decimal.
So same script I have to applied on more than one attribute as calculation are same for all but I am getting below error.
Error:
undefined: The provided number is incorrectly formatted. The number may contain an integral part followed by a fractional part which is separated by a '.'. The number may contain up to 24 integral digits and up to 4 decimal digits.

Script is:

dojo.provide("com.acn.adt.workitem.calculatedvalue.totalcount1");

(function() {
dojo.declare("com.acn.adt.workitem.calculatedvalue.totalcount1", null, {

    getValue: function(attributeId, workItem, configuration) {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
var blockedCount=workItem.getValue("com.blockedcount");
             var passedCount=workItem.getValue("com.passedCount");
             var partiallyPassedCount=workItem.getValue("com.partiallyPassedCount");
             var inprogressCount=workItem.getValue("com.inprogressCount");
             var failedCount=workItem.getValue("com.failedCount");
             var descopedCount=workItem.getValue("com.descopedCount");
             var moveToPreprodCount=workItem.getValue("com.moveToPreprodCount");
         var var2=blockedCount+passedCount+partiallyPassedCount+inprogressCount+failedCount+descopedCount+moveToPreprodCount;

if(attributeId == "com..partiallyPassedPercentage")
{
var v=(partiallyPassedCount/var2)100
return parseFloat(v);
}
else if(attributeId == "com.moveToPreprodPercentage")
{
var v1=(moveToPreprodCount/var2)100
return parseFloat(v1);
}
else if(attributeId == "com.inprogressPercentage")
{
var v2=(moveToPreprodCount/var2)*100
return parseFloat(v2);
}
}
});
})();

Kindly provide me solution.

One answer



permanent link
Ralph Schoon (63.2k33646) | answered Oct 14 '19, 9:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Read your code, it is quite easy to spot where you missed the multiplication operators which results in a variable that can not be parsed as number.


Comments
Pallavi Deore commented Oct 15 '19, 3:01 a.m.

 Hi Ralph,


By mistakely, * got removed while putting the java script code in question but in my environment I have written code with multiplication operator but still getting above error.

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.