Writing your project

This procedure describes how to use Control-M/EM API to write your project.

NOTE: You can use the Sample class as a basis for building your project.

To write your project:

  1. Import Control‑M/EM API into your project by typing the following command:

    import com.bmc.ctmem.emapi.*;

  2. Create a class that uses the Control‑M/EM API functionality that you want to use in your project.
  3. Start Control-M/EM API by using the EMXMLInvoker static method, Init by typing the following command:

    EMXMLInvoker.init();

  4. Select the Control-M/EM GUI Server by typing the following command:

    ComponentType gsr_comp = new GSRComponent();

    For more information, see Sending a request using the EMXMLInvoker or EMBasicXMLInvoker.

  5. Create an EMXMLInvoker instance and submit the following request.

    EMXMLInvoker my_invoker = new EMXMLInvoker(gsr_comp);

    try {

    XMLResponse = my_invoker.invoke(XMLRequest);

    }

    catch(InvokeException i) {

    }

    The class is now ready. You can use it in your project. For more information, see Sending a request using the EMXMLInvoker or EMBasicXMLInvoker.

  6. Compile your project.

    To run your project, you must pass it the relevant Java Virtual Machine variables.

    For more information, see Running your project.

Parent Topic

Control-M/EM API configuration