Workload Manager Policy in XML Format - Part I
MartinPacker 11000094DH Comments (4) Visits (5953)
This isn't particularly new - but I'm guessing most people who work with WLM don't know about this...
For some time now you've been able to download a java application that enables you to convert your WLM Service Definition to and from XML. Perhaps more importantly, the application provides a nice way to edit the Service Definition - and
You can get the program from here. Unfortunately - from my perspective as someone who aspires to migrate to Linux over time - it is packaged for Windows. (I
To retrieve the ISPF-based Service Definition, to convert it to and from XML, and to update it on z/OS a pair of batch jobs are used, submitted via FTP. If you get the setup right - and this is quite easy - the whole round-trip works well.
In any case the java application is a nice way to edit the Service Definition.
Now to the main purpose of this blog entry.
Manipulating the XML WLM Service Definition using PHP
The java application saves a copy of the XML Service Definition to your local workstation.XML is really nice as you can manipulate it in so many different ways.
Consider PHP, as an example. I may blog about this some more one day but I've installed Apache, with PHP support, on my Thinkpad. And this webserver is permanently up but only accessible via "localhost" URLs. (I've written a few scripts that automate most of the tedious parts of retrieving performance reports from the mainframe and displaying them.)
PHP is a good webserver scripting language, well suited to lots of tasks, and with an active development community. One of the things it's good at is processing XML. The following code example does some basic processing that's useful
In XML terms the root node is <Ser
The "wlm" in the above XPath expression refers to the need to register a namespace. The line
does that. Using this XPath expression yields a list of <Classification> nodes, which the code stores in the PHP variable
This is all simple PHP. I chose this small part of the WLM Service Definition to format as it's an example of something that's
I'm hoping this code fragment will get you thinking about the value of having the WLM Service Definition in XML form. (By the way the XML form is saved on z/OS as part of the conversion and download process - and the conversion code is very visible if you nose around a bit.)
I've written "Part I" in the title of this blog post because I think I'm going to play with some more XML-related technologies - just to show the flexibility of the approach.