- Print
- DarkLight
Movex_M3 MI generator User guide
Introduction
Connecting to Movex / M3 via API is usually done through so-called MI programs. You can access them via java interfaces available from Infor. The interfaces are at a fairly low level and require a lot of knowledge of the programmer.
To simplify this, you can generate a java class per MI program with Comflow. The generator creates a java class with one method per MI call and all fields as arguments in the method. This simplifies the coding against MI programs 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 MIGenerator.java in project: MovexAPIComponents and package: net.comactivity.movex.mi.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, AS400 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.
See example below:
public static void main(String[] args) {
try {
String ret = generateMISource("123.12.123.12", 11800, "USER", "Password", "CRZ610MI", "net.comactivity.movex.mi.cust", "CRZ610MI");
System.out.println(ret);
} catch (MIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
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.