2011-08-23 09:42 PM
i need to put some conditional logic in a workflow. hopefully someone can show me a better way than i have devised...
here are the rules
here is my FindChart right now:
in a previous FindChart i set the prefix for the volume name as follows:
theVolPrefix => 'pwl_' + (( $Size >= defaultNewSharedVolSizeGB ) ? '_unshared' : '_shared') + snapLabel
this means i should get a prefix like: "pwl_unshared_nosnap_" or "pwl_shared_nosnap_" or suchlike
the giveTrueIfValuesMatch finder basically does this:
...in other words i'm using a bogus sql query to act as an "if" compare.
the two Defines in the workflow set the same variable (newVolume) and differ only in the volume name.
(the first is nextNamePadded(previousVolume.name) , the second is theVolPrefix + '001' )
ideally i would work the logic so that i just set a string variable (e.g. newVolumeName)
i'm starting to this i might be able to work around the need to have multiple Defines (which would help for maintenance), but i can't work out how avoid an "IF" conditional around the size of the volume.
any thoughts or comments?
2011-08-30 02:48 PM
That was a long one to keep track of but let me try to break it down.
The purpose is to setup a new NFS export on a qtree that will be created. It will be created in either:
1) Existing Shared volume
2) New shared volume
3) New Unshared volume.
So there will be a user input to determine whether the share would be in a "shared" or "unshared" vol.
I would use a function to determine the volume name prefix. Would be the most elegant solution.
What else I would do (You can consider it):
Create 2 createVolume commands, one for shared and one for unshared.
You know according to size whether a shared or unshared is needed, and you can set the enable flag accordingly.
In the unshared, just create the volume (Search for existing and use nextNamePadded to increment name).
In the shared, do the same (Create or find and create the succeeding one).
Do my ideas make any sense?