houghtp
Contributor
Contributor

Call Workflow to execute Powershell Plugin from Web App

Hi,

I'm trying to call the Powershell plugin from a Web App, but having difficulties converting the powerShellHost parameter type from String to the correct vCO type

I've followed this post and think I'm close, but can't seem to get the scripting part correct

http://www.vcoteam.info/articles/learn-vco/266-making-vco-workflow-wrappers.html

I've removed the powershell:powershellHost paramter and replaced it with a String called stringPowershellHost in my input to the workflow. In the visual binding I have stringPowerShellHost "In" and the powerShellHost type "Out".  Then in the scripting task I've got:

if (PowerShellHost.name == stringPowerShellHost){

  host = stringPowerShellHost

}

system.log("PowerShellHost is " + PowerShellHost.name)

but its not working -  can anyone advise?

0 Kudos
4 Replies
tschoergez
Leadership
Leadership

Hi,

I have not checked in the lab, but just from reading your code:

Change the 2. line to:

host = PowerShellHost;

and you should be fine!

Joerg

0 Kudos
houghtp
Contributor
Contributor

hi, thanks for reply, but didn't work.

Host is now "not set" when I look at the variables.

0 Kudos
anoopvb
Enthusiast
Enthusiast

You shouldn't need to convert or change anything.

Your workflow should accept as an input, a parameter of type PowerShellHost and that should let you choose the value of it.

I'm assuming you've already successfully added a powershell host to your vCO configuration?

0 Kudos
houghtp
Contributor
Contributor

well, we are using a 3rd party app called Cloudbolt which calls the vCO workflow. Cloudbolt has no knowledge of which type of input vCO requires and so passes the input along as a string, so it has to be converted in vCO to the correct type.

Yes, vCO Powershell host is all working fine from within vCO.

0 Kudos