Start a Job via PRO API using C#

Prerequisites

  1. Get a C# environment for developing applications. Here we assume you’re using Visual Studio.

    If you don’t have Visual Studio installed, you may get it on Microsoft’s website: Install Visual Studio.

  2. Get AIMMS PRO API via AIMMS PRO Portal

    1. Log into AIMMS PRO
    2. Go to Help > getting started
    3. Download AIMMS PRO API
    4. Move it to a convenient location, and unzip the archive

Running the example

  1. First publish the example application.

    You can find the example model in .\pro-api-complete\examples\AimmsModel\PROApiExampleApplication.aimms. Create an aimmspack, say PROApiExampleApplication.aimmspack, and publish it on your AIMMS PRO system, for instance using the name PROApiExampleApplication and version 1.

    Adapt application details presented on lines 14 - 30.

    • Line 14, PRO_ENDPOINT: this might also be wss://your-cloud-name.cloud.aimms.com

      1. when connection encrypted, start with wss (cloud systems are always encrypted).
      2. when connection not encrypted, start with ws
    • Lines 32-34, PRO_ENVIRONMENT, USERNAME, and USER_PASSWORD should have been supplied by your AIMMS PRO administrator.

    • Lines 38-39, PRO_APPLICATION_NAME, PRO_APPLICATION_VERSION, the name and version of the app as it is published.

  2. Build the application using Visual Studio Menu > Build > Build.

  3. Run the application.

Output

The output is the same as when using Java. See Starting AIMMS Job via the AIMMS PRO API using JAVA.

Further reading

See also the manual

Last Updated: August, 2019