Muster Java .Net Perl and Php API

The APIs for the scripting languages behaves in the same way as the Python and C++ ones. Please refer to the Python documentation and examples to learn how to use the API that will be find under the same MClientAPI and MTemplateAPI namespace/packages.

When using the Muster API you must configure your PATH environmental variables on Windows, and the LD_LIBRARY_PATH and DYLD_LIBRARY_PATH on posix platforms to let the API find the Muster .DLL/so files . You'll also need to set the MUSTER environmental variable to the Muster 8 root installation path, this allows the .LIB to find the python installation related to Muster. Don't forget to configure the environmental variables, because, you may end up loading another python installation laying somewhere on your filesystem and this could lead to module import errors very hard to sort out.

A typical example configuration for Window is:

MUSTER=C:\program files\virtual vertex\muster8
A typical example configuration on Linux is:

export MUSTER
A typical example configuration on Mac is:

export MUSTER

Due to namespaces differences, the API exposed under the scripting languages is inside the MClientAPI namespace (instead of MClientLib).

After configuring your environment, you can simply copy the files inside the SDK/Libs inside your scripting language extension folder.

The .NET Api requires you to import all the .cs files distributed with the SDK (sdk/libs/platform) inside your project.
The .NET API does not require any additional configuration.

You do not need to import any module from a .NET project, you just need to make sure the following files are available into your compiled program directory:

  • MBase.dll
  • MClientAPI.dll
  • MClientLib.dll
  • MFramework.dll
  • MTemplate.dll
  • MTemplateAPI.dll

If you're working with Mono on a Unix platform, just use the .so or .dylib files

This is a typical example that pauses JOB ID 1:

using System;
using System.Text;
namespace ConsoleApplication
    class Program
        static void Main(string[] args)
            var session = MClientAPI.InitializeSession();
            var err = MClientAPI.Connect(session, "", 9780);
            if (err.getErrorCode() != 0)
                Console.WriteLine("Failed to connect to the Dispatcher service!");
            MClientAPI.JobActionPause(session, 1);

The .NET Api requires you to import all the relevant .java files inside your project. You may also need to distribute the MClientAPI.dll and MTemplateAPI.dll with your project. The java API does not require any additional configuration.

You can then import the module with:

import MClientAPI.*;
import MTemplateAPI.*;

The Perl Api requires you to copy the Perl modules inside the Perl/lib folder.

You can import the modules in Perl using:

using MClientAPI;
using MTemplateAPI;

The PHP Api requires you to copy the .so files inside your PHP modules directory. You also need to copy the .php files distributed with the installers within your application. Also be sure to enable the modules in your php.ini configuration file.

You can then import the modules using:

include "MClientAPI.php";
include "MTemplateAPI.php";