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

Error while executing calculated java script in rtc

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.

0 votes



One answer

Permanent link

 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.

0 votes

Comments

 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 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,122

Question asked: Oct 14 '19, 8:35 a.m.

Question was seen: 1,683 times

Last updated: Oct 15 '19, 3:01 a.m.

Confirmation Cancel Confirm