VMware Cloud Community
Fede_O_WIIT
Contributor
Contributor

Deployed workflow output in service broker

Hello everyone,

I've created a vRO workflow and made it available within the Service Broker.

When I run it from the vRO interface, I get the output log with all the related information. However, if I execute the deployment from the Service Broker, I only see that the execution has been completed and the values of the variables.

In this particular case, the script is a PowerShell script, and I would like to show the output logs of my script during the workflow deployment within the Service Broker.

How could I do this? Could someone give me some guidance on which direction to take?

Thanks!

0 Kudos
3 Replies
xian_
Expert
Expert

You need to assign the information you want to show to a workflow output variable (in your case, capture the output of your PS script and assign it to an output variable.

Here is an example workflow:

xian__0-1706779419062.png

Here is the output in the deployment details:

xian__1-1706779499252.png

 

 

Fede_O_WIIT
Contributor
Contributor

Hi Xian,

Thank you for your response. I've tried various methods to output the contents of my variable, but I can't seem to make it work. I've experimented with different approaches, such as converting it to a string, using custom PS objects, and then outputting as properties, etc., as suggested in other discussions.

Unfortunately, I just can't grasp how vRO interprets these data, which, when printed to the console, are correctly assigned to my PS variable.

Do you have any suggestions for me?

Thank you!

Fede_O_WIIT_0-1707133110416.png

 

0 Kudos
xian_
Expert
Expert

You are returning an array of objects ($out_log) so set the output variable type as array of Properties:

xian__0-1707170729775.png

 

Printing the resulting variable in a plain JS step:

System.log("\n" + JSON.stringify(outlog, null, 2));
 
xian__1-1707170811240.png

 

You'll still have to convert this to string so that Service Broker can display it, I think it can display basic types (number, string, boolean, ...) only.

0 Kudos