I started to work with the vRealize today, my target is to receive the output from the workflow or from the script in the Drop-down field in Blueprint form.
For the first question I just wanna ask you if it is possible in the vRealize or it is not fited to do that.
For now I have wrote the script with Array return.
The com.commonlab.emapotaa.scripts/getList function is that:
var arg0 = ["test", "test2"];
And my settings are:
My target is to get the JSON content and parse it to the Drop-down list.
For now I have made script running every minute to get the list and save it to file, the script will load content from the file parse it to array and return as dropdown list but its not working even with primitve array and return.
Is it possible at all?
Do you have any ideas how can I get the output of script in Drop-down input?
So what is not working and what is it doing? Do you have the action listed above with the test1 and test2 array defined as what you are using to make sure it works? If not what is the code you are using please
Hi Marek Potargowicz,
what you want to achieve should be way more easy if you directly add your action in the presentation of the workflow and then add the workflow as a new blueprint. The presentation of the workflow will then be overtaken in vRA.
Here is a good tutorial about how to modify the input presentation of workflows and how to use the output of an action as drop down values: http://solutionyst.com/vrealize-automation-using-the-vrealize-orchestrator-presentation-tab/
Hope this helps further.
Hi, I did try to create new Workflow regarding that tutorial but I had some issues:
- Result from script cannot be shown in Drop-down list (it is empty).
- The result was set to output of script task:
As you can see the "res" param has the output of script already, so it is getting correct, but in the blue print is still empty.
The result on the screenshot is the res value.
My goal for one workflow and one blue print are:
1. Get the script task done untill the blueprint is created, script is doing GET under REST and getting all urls needed (the script is showing output of Array contains Strings with URL-s).
2. Get the user to request info.
3. Show the user the Form with Drop-down list of the result of the Array/String from task no1.
4. Send another REST but now POST including some information from Form Drop-down list.
For now, the scripts or the workflows are working complety fine, but I cannot get the value in Drop-down list done.
You can not have the output of a scriptable task (which is part of your workflow) to be shown on the input presentation phase of this workflow (cause it was not executed while you get the input presented).
What you have to do is to:
1. Write an action item, which returns Array containing Strings with URL-s
2. Use the tutorial to map this actions to the input presentation of your workflows input attribute
3. Only execute the POST part as part of your workflow (cause all GET operations will be executed within actions during the presentation phase of your workflow)
That answer is looking good, as I already tried to achive some values in the drop-down field already with no result (1st post with return the args).
I know how to handle the REST operation (GET) in workflow, but for action it wont work, cause I cannot set properly values to send and GET over REST:RESTOperation, in workflow there is no problem, but there is for the action cause the input cannot handle info from the workflow (like history of runing scripts).
We cannot also check if the action script is working or not (there is no debbuger/run button in the action page).
I could achive that while doing the save to file and read from file, but the user to run the script have no permissions, even if I grand them and made dir with 777 chmods its not working, maybe solution of permissions would fix my problems then I could achive it by save / read to file option.
Script which is not showing in the Drop-down list as a action:
var test = ["Chose 1", "Chose 2", "Choose 3"] // creating the Array of string
Its blank in Drop-down list as a Value of external script.
Any ideas ?
If you take a look into the "Invoke a REST operation" workflow, you can nearly copy&paste the code from the scriptable task into a new action. This action now could be used in your workflows input presentation. This should work easily 😉
To check if the action is working, write a "test" workflow for it with the action inside and hardcoded values to test the action and the output.
Yes, but the main problem is while I do the blueprint job, even if I attach the action script to the Drop-down list it is blank, I put the example on post above like:
var test = ["Test","test2"];
That action is showing the blank values instead.