That is a fair question and I should have provided the problem I was trying to solve at the time I asked it. I can't remember what I was trying to solve when I asked the original question but today I have a feature I'd like to address in the next version of a workflow that I'm unsure which path to follow (function, object.reference, userInput-query, etc). Here is how I would describe this use-case and problem:
BACKGROUND: I have a workflow that uses Incremental Volume naming. After working to get the SQL for search criteria just right this seems to be working correctly and as advertised. But it has raised two further questions which are related and if I could solve one I should be able to solve the other. Those questions are (note: I'm calling arrays filers in the below, sorry :-):
- Q1: I'd like to be able to present to the user what the new volume name will be in some way on the User Inputs form before the workflow is previewed/executed, or before the planning phase. It is not trivially obvious how to do that ... or if it can be done. The best answer I can give right now is to "preview the workflow once" and it'll show what volume name is going to be computed and used. ANY HINTS HOW TO ACHIEVE THIS?
- Q2: But this is the real requirement: we need another aspect of the User Input form to behave in a particular way based on what the newly created and incrementally named volume's name is going to be. Real example: a convention which we'd like the workflow to enforce is that if the volume name ends in an even number the volume should be placed on a filer that ends in an even number, and vis-versus: if volume ends in odd number it should be placed on a filer ending with an odd number. Today the workflow presents the complete list of eligible filers. They want the user to manually select the filer, but they'd like the list of eligible filers to only contain even-ending, or odd-ending filer names based on the volume that is about to be created. This is a general load balancing scheme.
I could try and upload the workflow related to this problem but it is complex and needs a specific dictionary, data source, and some specially named OCUM resGroups to even begin to work. So it would be easier to use a sample simple workflow to test the simpler 'incremental naming' problem and/or a hint to address Q1 or Q2 above. Maybe just a Create Volume with incremental naming and a filer/array User Input selection via a query based on the about to be created volume name (in anyway, just to demonstrate concept).
Abhi, I read the SQL code I think I get the idea. However, to test it I get stuck at the part about creating the 'namevalue' table in playground database. I know what the playground database is. I use a SQL tool called DBVisualizer (from dbvis.com) and when I connect to my WFA server I see the playground database with no tables (normal). But I don't see how to add a table. Since I'm using the standard wfa/wfa123 credentials don't I just have a read-only view of things? Do I need to connect with different cred's to have write access?
NOTE: I'm opening another discussion which seems entirely different but is a question I came up with trying to solve the problem another way. I realized that I could have another userinput field that is a QUERY type field that looks up and determines what the current highest volume name is, like: 'volume78' and returns that. I can hide this userInput field form the user in a un-expanded group of userInputs. This gives me a hint to know that the next one which "WFA Incremental naming" will create is going to be 'volume79' and using MOD-2 functions I can determine even/odd'ness of the next volume name. I think this is a simplier apprach that playground DB (for now) but it raised another SQL focused question ... look for separate thread on that topic