As stated in my other post, I am working on a self-service provisioning portal.
I want to be able to update a "cost" field on the webview as the user adds vCPU's, vRAM, and additional hard disks.
Is this possible with vOrchestrator?
Thanks!
Jason
There are different way to address this:
- Do different steps in your workflow presentation : Fields are recalculated by steps.
- If I recall well if you use an action to update a field it will refresh if the first parameter of the action is updated in another field.
Christophe.
It is possible to call in an action in the presentation text that would use the other fields as input and return a string being the cost. I cannot get the syntax on top of my head, I need to find an example.
Christophe.
OK found an example to call in an action within the presentation text:
${#exist=GetAction("com.vmware.lcm.presentation","existAvailableTemplate").call( #location , #organization , #serverEnvironment , #serviceLevel , #performance )? "This defines the type of server that is installed, if the server is started after being provisioned." :
"<font color=\"#FF0000\">Warning: there is no available server type for your criteria. Return to the previous step and change your criteria.</font>"}
This one is a bit complex and display text based on the boolean returned by the action. A much easier way is to add an input call cost, use presentation to calculate a default value from an action getting the other fields used to calculate the cost as input. Once you check this works you hide the field and in the presentation text you add a "This is going to cost you ${cost}".
Christophe.
Thanks!
That was very helpful. I got the logic to work, mostly.
However, the values selected in the drop down box only update when the form is submitted.
Any idea how I can get the values to update every time I change the drop down box?
Jason
There are different way to address this:
- Do different steps in your workflow presentation : Fields are recalculated by steps.
- If I recall well if you use an action to update a field it will refresh if the first parameter of the action is updated in another field.
Christophe.
This seems to be working.
How do I hide the text field that I palced the default value in?
There is a hide parameter input property you can set in the presentation on this input.
Christophe.
yeah I added the "Hide parameter input" property, and set the value to TRUE, but that hides the description as well..
Oh. I think i misunderstood what you said when you mentioned "Presentation Text"
I can add the text to the description of the whole "Presentation" form , or the billing "Step", rather than the string field that I enter my default value on.
duh.
Thanks!
Jason
Yep this is right. You use the field to calculate the value and test, then you hide it and reference it in the presentation text of a section. If not end user would be able to change the cost
Christophe.
I am ressurecting this thread, as something seems to have broken in Orchestrator 4.2.
This code in the Description field previsouly worked:
VM Cost: $ ${#exist=GetAction("org.company.VirtualServices","vs_calcvmcost").call( #numCPU, #numMem, #SecondHardDisk,#vmCost)} per year.
This would call my custom action, and return the VM's cost.
Now all I get back is "NaN"
Not sure what changed in Orchstrator. My code did not change.
any ideas?
Thanks
Jason
Hi Jason,
Is this with Windows 4.2 version or with the appliance ?
Christophe.
This is with the appliance.
Thanks!
Jason
The 4.2 appliance went through additional security tests than the 4.2 Windows version. As part of this security was enhanced and one of the effect is the one you are observing. ATM you should use the 4.2 Windows version until a new version of vCO. At this point the default behavior will be the most secure one and there will be an option settable at the server level that will allow compatibility with the 4.1 behavior.
Christophe.
Hi Jason,
Unfortunatelly, this feature was disabled in the appliance as well in the upcoming update 1 of vCO4.2 (not relevent but also in vCO4.1 Update2) based on recommendations from the security group.
The good news is that you can revert back the old behavior by setting two properties:
Is there a prefered "new" method of achieving the same result?