Movex_M3 Cloud MI and WS generator User guide
  • 26 Aug 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Movex_M3 Cloud MI and WS generator User guide

  • Dark
    Light

Article summary


Introduction

Get and Put data to M3 Cloud via API is usually done through REST MI or REST Web-Service.

To use the REST API you can generate a java class per MI program or Web-service with Comflow. The generator creates a java class with one method per API method and all fields as arguments. This simplifies the coding for the programmer.

Before you start

Ensure that you have the following projects in your Comflow studio:

  • MovexComponents
  • MovexAPIComopnents
  • MovexAPIJar (Note – you have to get this from the customer environment to have the correct version.)

MI-class generation

Open the source MIWSGenerator.java in project: MovexAPIComponents and package: net.comactivity.movex.miws.generator

Prepare the MI-Class template

Go to the main method (at the end of the class).

Change the IP address or computer name, MI port, user, and password for the environment to create the MI class for. Then specify the MI program you want to generate a class for, package name for the generated class, and class name. Ensure that the user is allowed to use MI-Test and MRS001 in Movex. The generator is using MRS001MI to generate the class.

See example below:

String apiServerName = "ik4t7017.swedwoodgroup.com";

int apiPortNumber = 44010;

String apiUserName = "user";

String apiPassword = "password";

The recommendation is to use the MI-program name as class name.

Save the source.

Run the MI-Class template to create the MI-Class

Now you shall run the java class. You are doing this by marking the class in the project and select Run/Run As/2 Java Application or by clicking the Run button if you are in the source.

The new source will be generated in the package net.comactivity.movex.mi.cust in the project MovexAPIComponents.

Copy the file to the customer project.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.