Active IQ Unified Manager Discussions

One or more values in a field

olson
2,807 Views

So I am building a workflow to build one or more volume using a repeat loop. This works fine however, I would like to be able to provide a single volume size or multiple volume sizes comma separated.

Can someone help me with a java if statement I can use to accomplish this?

my volume name is extracted from the share name  field

splitByDelimiter($ShareName,",",ShareIndex1-1)

this works but expects a one to one

actualVolumeSize(splitByDelimiter($VolumeSize,",",ShareIndex1-1) * 1024, volume4.snapshot_reserved_percent)

what I want is a if clause

(getSize($Volumesize)  == 1?$Volumesize:splitByDelimiter($VolumeSize,",",ShareIndex1-1)

this is not working.

Ideally I would like to account for a incorrect number of values as well.

Thanks In advance

John

2 REPLIES 2

sinhaa
2,807 Views

John

What error are you getting? Is it possible to share your workflow?

Expressions for size:

getSize($volSize) == 1?$volSize: (splitByDelimiter ($volSize,",",Index1-1)

work fine if at execution the $volSize is provided as: "10240"

or for multiple values: "10240, 2048, 4096"

i.e. Inputs at execution to be provided with double quotes.

@Ideally I would like to account for a incorrect number of values as well.

-----

Its fine if you provide number of values > Num. of looping cycles. If less then this passes in planning ( bug?), but execution will fail as mandatory parameter size_mb for one of the cycles will become empty.

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

sinhaa
2,807 Views

actualVolumeSize(splitByDelimiter($VolumeSize,",",ShareIndex1-1) * 1024, volume4.snapshot_reserved_percent)

The problem is passing parameter of volume definition object in a function call as arguments. Though WFA GUI auto-complete will show this as correct, this is an incorrect MVEL expression.

Use it like:

actualVolumeSize(splitByDelimiter($VolumeSize,",",ShareIndex1-1) * 1024, volume4["snapshot_reserved_percent"])

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public