Home | Print | Archive | Blog | Contact
A Quarterly Newsletter for Unisys ClearPath Forward Clients | June 2018

Putting Python to Work

MCP

The recent release of the Rapid Application Development (RAD) paradigm for ClearPath® MCP and OS 2200 environments makes it possible for your developers to author programs in the popular Python language directly within your ClearPath Forward® environment.

And now that your developers have the option to work the Python language into their projects, we wanted to share an example of how it could be put to use in the ClearPath Forward® environment.

So, read on to see how we used Python to create a ClearPath MCP application that manages automated testing activities.

Envisioning the Project

The goal of this project was to enable our compiler team to manage testing that resides on their ClearPath Forward Libra system over the web. To make that possible, we wanted to build a web interface that allows users to either launch specific tests or run all testing at once. Once the parameters are specified, the backend system sets up a WFL parameter string that in turn launches the corresponding WFL job on the ClearPath Forward system.

We chose the popular Django web framework to provide the web services portion of our Python application. We also used a module called Python for .NET (Pythonnet), which allows CLR namespaces to be treated as Python packages. This enabled us to utilize the ClearPath Application Integration Services (AIS) tool – a standard part of the Python RAD – to implement the application.

Note that to get all of this working, AIS requires a library on the MCP side that launches a WFL job based on the string that is passed in. The required WFL proxy library is described in the documentation provided with the Python RAD.

Using Python made for a quick implementation, as much of our existing functionality was utilized to implement key parts of the new application. Best of all, this same approach can help your existing ClearPath Forward applications take advantage of the wealth of functionality available to Python developers.

Executing the Project

After establishing the ability to call into the AIS .NET library, the rest of the development work happened
in Python.

Here’s what we did…

Because Microsoft® Visual Studio® 2017 includes extensive support for Python development across a number of frameworks, getting started with a Django project was extremely easy.

Simply select File>New>Project. Then, choose “Django Web Project.” More information about getting started with Django and Visual Studio 2017 can be found on the Microsoft Developer Network.

Next, you add the Pythonnet module in Visual Studio. In the solution explorer, right click on the Python version, then choose “Install Python Package.”

Then, put “Pythonnet” into the search bar and install Pythonnet.

At this point, your Python environment should look something like this:

After importing the Pythonnet module, you’ll be able to import CLR. Do this in the Python file where you plan on executing the method calls into AIS, then add the references to the AIS DLL and the WFLPROXY DLL described in the documentation. At this point, you may want to refer to the documentation for more detailed information about which methods and parameters are expected to call into AIS.

And here is the end result of this work:

The “test suite” field is used to select a specific suite from all available tests. The “compiler type” field lets us choose the compiler type – released, internal, or prototype. The “level” field indicates which release level to use. And the “email” field allows testers to choose who receives a message containing the test results. You can learn more about the Bootstrap template used for this interface here.