Home > Blogs > VMware vCenter Orchestrator Blog


Example of high level workflow with the SOAP plug-in

In this post we’re going to show an example of a high level workflow composed of simple workflows generated with the SOAP plug-in.

First of all, we need a vCO server with the SOAP plug-in installed on it. The process of installing the SOAP plug-in is quite straightforward, you just have to follow the steps described on the SOAP plug-in User Guide.

Now, the sample scenario that we want to run is the following:

  1. Discover where we are (our country) from our current public IP address.
  2. From our country, get the list of cities where we can get the weather from.
  3. Let the user to pick up a city from that list.
  4. Retrieve the current weather for that city.
Abc

The Web Services that we will use are available on this website http://www.webservicex.net/ and these are:

So, let’s see what we have to do in order to compose our scenario. We are omitting the very basic details about how to do some things since they are described on the SOAP plug-in User Guide as well.

Add the 2 new SOAP hosts, one for each WSDL file

SOAP_sample1

Create 3 new workflows from the SOAP operations we are going to use

These operations are:

  • GetGeoIPContext – to get our country from our public IP address.
  • GetCitiesByCountry – to get the list of cities available for our country.
  • GetWeather – to get the weather from the city chosen by the user.

SOAP_sample2

Create a new workflow that will combine the previously created workflows

SOAP_sample3

The schema of that new workflow will look like this:

SOAP_sample4

And the workflow defines also the following attributes:

SOAP_sample5

Complete the additional scriptable tasks

To connect the different generated workflows we need to add a couple of scriptable tasks in order to adapt the output of one workflow as the input of the next one. Also we need to define a User Interaction node to allow the user to choose a city. And we may add a final scriptable tasks to filter and pretty print the result of our high level workflow.

  • Set country

SOAP_sample6

  • Set cities

SOAP_sample7

  • Choose a city

SOAP_sample8

  • Print weather

SOAP_sample9

We need also to associate the inputs and outputs from all the invoked workflows and scriptable tasks with the attributes of the main workflow, but this is a quite easy task since the names from both, attributes and workflow’s inputs/outputs are very descriptive.

Run the workflow

When we run the workflow we have no inputs to introduce:

SOAP_sample_run1

At some point the workflow waits for a user interaction and we have to answer:

SOAP_sample_run2

SOAP_sample_run3

And at the end the workflow prints the selected info in the log tab:

SOAP_sample_run4

Conclusion

That was just a simple example about how to compose a higher level workflow by combining a set of workflows automatically generated by the SOAP plug-in. As you can see the complex parts are not the different SOAP invocations (the generated workflows handle them) but processing and adapting the different outputs and inputs. And these parts will be more or less difficult depending on the Web Services that you have to use.