Active IQ Unified Manager Discussions

Doing Concatenation and not addition

Adai
4,353 Views

I am using cDOT Resize volume command to resize a volume by specifying a increment size and not the absolute size.

resizeVolume is my Command Variable.

In the other parameters tab, for attribute TargetSize I am having an expression as follows

resizeVolume.size_mb+$IncrementSizeInGB*1024

 

 

The above expresion is getting evalueated as string and getting concatenated and not added as integers.

 

So if my resizeVolume.size_mb is 1024 which is 1GB and my $IncrementSizeInGB is 50GB then the result I get in the execution plan is 

102451200 which is (1024+50*1024) 102551200

 

Am I missing something ? How to get this as addition and not concatenation

 

Regards

adai

1 ACCEPTED SOLUTION

ag
NetApp
4,340 Views

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

View solution in original post

5 REPLIES 5

trentino123
4,340 Views

Here is an example of resize function ( check for the (int) when returning a result so it does not concatenate as a string ) :

 

def setNewVolSize(growVolume, addSize, rateOfChange) {
  if (addSize=='')
     return growVolume.size_mb;
  else
     return ((int) growVolume.size_mb) + calculateVolumeSizeFromDataSize(convertFromGB(addSize),rateOfChange);
}

paragp
4,337 Views

Adai, I am checking to see if this is a bug. In the meanwhile you can use this expression to make sure the numbers get added instead of concatenated.

 

Long.valueOf(resizeVolume.size_mb)+$IncrementSizeInGB*1024

 

ag
NetApp
4,341 Views

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

AdaikkappanArumugam
4,100 Views

Hi WFA Team,

Is this bug fixed in WFA 3.0 GA or atleast in 3.1 RC thats coming soon ?

 

Regards

Adai

Adai
4,325 Views

Hi Anil and Parag,

Thanks for your quick replies, both your solution works.

 

Regards

adai

Public