Control-M/EM API Guide
Control-M/EM API Guide
Control-M/EM API Guide
8.0.00.900
Control-M/EM API Guide
October2016
Contacting BMC Software
You can access the BMC Software website at http://www.bmc.com. From this website, you can obtain
information about the company, its products, corporate offices, special events, and career opportunities.
United States and Canada
Address BMC SOFTWARE INC Telephone 713 918 8800 Fax 713 918 8000
2101 CITYWEST BLVD 800 841 2031
HOUSTON TX
77042-2827
USA
Telephone (01) 713 918 8800 Fax (01) 713 918 8000
2
U.S. Government Restricted Rights to Computer Software. UNPUBLISHED -- RIGHTS RESERVED UNDER
THE COPYRIGHT LAWS OF THE UNITED STATES. Use, duplication, or disclosure of any data and
computer software by the U.S. Government is subject to restrictions, as applicable, set forth in FAR
Section 52.227-14, DFARS 252.227-7013, DFARS 252.227-7014, DFARS 252.227-7015, and DFARS
252.227-7025, as amended from time to time. Contractor/Manufacturer is BMC SOFTWARE INC, 2101
CITYWEST BLVD, HOUSTON TX 77042-2827, USA. Any contract notices should be sent to this address.
Customer support
You can obtain technical support by using the BMC Software Customer Support website or by contacting
Customer Support by telephone or e-mail. To expedite your inquiry, see Before contacting BMC.
Support website
You can obtain technical support from BMC 24 hours a day, 7 days a week at
http://www.bmc.com/support. From this website, you can:
Read overviews about support services and programs that BMC offers
Find the most current information about BMC products
Search a database for issues similar to yours and possible solutions
Order or download product documentation
Download products and maintenance
Report an issue or ask a question
Subscribe to receive proactive e-mail alerts when new product notices are released
Find worldwide BMC support center locations and contact information, including e-mail addresses, fax
numbers, and telephone numbers
Support by telephone or e-mail
In the United States and Canada, if you need technical support and do not have access to the web, call
800 537 1813 or send an e-mail message to [email protected]. (In the subject line, enter
SupID:<yourSupportContractID>, such as SupID:12345). Outside the United States and Canada,
contact your local support center for assistance.
Before contacting BMC
Have the following information available so that Customer Support can begin working on your issue
immediately:
Product information
Product name
Product version (release number)
License number and password (trial or permanent)
Operating system and environment information
Machine type
Operating system type, version, and service pack or other maintenance level such as PUT or PTF
System hardware configuration
3
Serial numbers
Related software (database, application, and communication) including type, version, and service
pack or maintenance level
Sequence of events leading to the issue
Commands and options that you used
Messages received (and the time and date that you received them)
Product error messages
Messages from the operating system, such as file system full
Messages from related software
License key and password information
If you have questions about your license key or password, contact BMC as follows:
(USA or Canada) Contact the Order Services Password Team at 800 841 2031, or send an e-mail
message to [email protected].
(Europe, the Middle East, and Africa) Fax your questions to EMEA Contracts Administration at +31 20
354 8702, or send an e-mail message to [email protected].
(Asia-Pacific) Contact your BMC sales representative or your local BMC office.
Third party Software
For the provisions described in the BMC License Agreement and Order related to third party products or
technologies included in the BMC Product, see
https://docs.bmc.com/docs/display/workloadautomation/Control-M+Workload+Automation+Documentati
on and click Third-party software (TPS).
4
Contents
Introduction to Control-M/EM API .................................................................................... 7
Control-M/EM API flowchart ............................................................................................................7
Running sample GUI client ..............................................................................................................8
5
EMXMLInvoker class ..................................................................................................................... 42
Sending a request using the EMXMLInvoker or EMBasicXMLInvoker ................................................ 44
Response types received when using the EMBasicXMLInvoker ......................................................... 46
Response types received when using EMXMLInvoker ...................................................................... 47
6
1
1
Introduction to Control-M/EM API
Control-M/Enterprise Manager (Control-M/EM) API is an open interface for external applications that
enables you to use the capabilities of Control-M Workload Automation. It is a set of Java classes that
allows you to send requests from your own applications to the Control-M Workload Automation.
Installation includes a sample GUI client, which you can use to familiarize with the API before you develop
your own custom client applications. It enables you to use Control-M/EM API, submit requests and get the
responses. See Running sample GUI client (on page 8).
Control-M/EM API enables users of your application to perform various functions in the Control-M Business
Integrated Scheduling environment, such as creating jobs and SMART Folders in Control-M Active Jobs,
ordering jobs and SMART folders, performing job actions and changing Alert status. For practical
examples, see Control-M/EM API flowchart (on page 7).
The following topics describe how to install, upgrade and uninstall Control-M/EM-API, send requests and
receive responses from Control-M/EM, and error codes and exceptions.
Control-M/EM API Installation (on page 10): Enables you install Control-M/EM API on Microsoft
Windows and UNIX. This topic also includes a sample GUI client which you can use to familiarize with
the API or with EMAPI before you develop your own custom client application.
Control-M/EM API upgrade (on page 19): Enables you to upgrade from previous versions of
Control-M/EM API.
Control-M/EM API configuration (on page 13): Enables you to configure Control-M/EM API for use in
your environment.
Control-M/EM API Class references (on page 25): Defines class reference information about the
functions that you can access when using Control-M/EM API in your project.
Control-M/EM API requests (on page 36): Defines the different methods for creating, sending, and
handling requests together with responses received from Control-M/EM.
Request and response parameters (on page 48): Defines the Control-M/EM API request and response
parameters. Requests are sent using the invoke (on page 31) method of EMXMLInvoker or
EMBasicXMLInvoker.
Diagnostics and troubleshooting (on page 189): Enables you to analyze the Control-M/EM API
products performance and prevent conflicts before they arise.
Error codes and exceptions (on page 197): Defines the errors and exceptions, which may occur when
the Control-M/Enterprise Manager API is being used.
7
Control-M Workload Automation Control-M/EM API Guide
8
Control-M Workload Automation Control-M/EM API Guide
You can complete these fields or they can be completed when a relevant request is submitted
(such as register_request).
In the Request pane, type the XML request to submit. You can use the following variables in the
XML request which is translated as a specified field in the window:
o $USER_TOKEN$ - Defines user token for the request
o $RESPONSE_TOKEN$
o $CONTROL_M$ - Enables Control-M to submit the request
o $ORDER_ID$ - Indicates job order id to submit the request
For an example of XML request, see: Sample GUI client XML variables (on page 34)
You can use some predefined requests, such as Register, Unregister, Poll and Create_Simple_Job for
distributed systems. To use one of these requests, select it and click Invoke predefined.
The predefine register request, uses emuser as user and empass as the password.
9
2
2
Control-M/EM API Installation
Control-M/EM API can be installed on Microsoft Windows and UNIX in any location from which you can
connect using TCP/IP to the selected Control-M/EM installation. Control-M/EM API is supplied as a
compressed file and when decompressed, this file creates a directory structure containing the
Control-M/EM API files. You need to ensure that Control-M/EM API is compatible (on page 10) with your
system.
The following procedures describe how to install, and configure Control-M/EM API:
Installing Control-M/EM API (on page 11)
Configuring Control-M/EM API (on page 13)
Compatibility
The following table describes the compatibility of Control-M/EM API with versions of Control-M/EM:
Component Version
Control-M/EM 8.0.00
The following table describes the compatibility of Control-M/EM API with versions of Control-M:
Component Version
10
Control-M Workload Automation Control-M/EM API Guide
11
Control-M Workload Automation Control-M/EM API Guide
Directory Description
emapi-800\xmldata Contains the schema files that validate the XML formatted
request strings sent and received using the API.
12
3
3
Control-M/EM API configuration
This topic describes how to configure Control-M/EM API for use in your project development environment.
Before using the Control-M/EM API in your project, you must initialize the API. You start and stop the
Control-M/EM API by initializing the CORBA services. CORBA is an architecture and specification for
creating, distributing, and managing distributed program objects in a network. In Control-M/EM API,
CORBA is implemented through the use of JacORB, a third-party product that brokers requests among the
components of distributed applications (acts as middleware).
API services start by using the EMXMLInvoker (on page 42) static method, Init (on page 29). When you
finish using the Control-M/EM API use EMXMLInvoker static method, done (on page 27). It stops when
the Control-M/EM API stops using the CORBA services. When your application finishes using the API, you
can stop the API.
The Control-M/EM API uses services that need to be initialized and terminated only once. There is no
need to initialize and stop for every new user session or call.
The following topics describe how to configure the Control-M/EM API, and prepare, write and run your
project:
Configuring Control-M/EM API (on page 13)
Preparing the Control-M/EM API project environment (on page 15)
Writing your project (on page 15)
Running your project (on page 17)
13
Control-M Workload Automation Control-M/EM API Guide
You are now ready to prepare your project and its environment to use the Control-M/EM API. See:
Control-M/EM API configuration (on page 13).
Configuration files
The following table describes the configuration files for Windows and UNIX:
14
Control-M Workload Automation Control-M/EM API Guide
15
Control-M Workload Automation Control-M/EM API Guide
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 (on page 44).
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 (on page 17).
Sample class
The following example describes a sample class:
import com.bmc.ctmem.emapi.*;
public class EMAPISample {
public EMAPISample() {
}
/** run once before submitting requests */
public void do_init(String[] args) {
EMXMLInvoker.init(args);
}
/** run once before exiting the program */
public void do_terminate() {
EMXMLInvoker.done();
}
/** This submits the XMLRequest received as a parameter
* and returns the response */
public String submit_request(String XMLRequest) {
String XMLResponse="";
// Creates a component
ComponentType gsr_comp = new GSRComponent();
// Creates a new EMXMLInvoker instance
EMXMLInvoker my_invoker = new EMXMLInvoker(gsr_comp);
try {
// Submits the request given as a parameter
XMLResponse = my_invoker.invoke(XMLRequest);
}
16
Control-M Workload Automation Control-M/EM API Guide
catch(InvokeException i) {
// must handle InvokeException
}
return XMLResponse;
}
}
17
Control-M Workload Automation Control-M/EM API Guide
-Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton
-classpath
$CLASSPATH projectMainClass
projectMainClass is your project main class.
These parameters are needed by Control-M/EM API. Pass them to your project as the first and second
runtime parameters. The command must be entered as a single line.
Optionally, you can pass these parameters by using one of the alternative methods described in Error
in Java virtual machine parameters (on page 192).
18
4
4
Control-M/EM API upgrade
This topic describes the changes to Control-M/EM API version 8.0.00. To update Control-M/EM, see:
Control-M Workload Automation Upgrade.
The following sections describe how to update Control-M/EM API and any changes that are necessary to
update your applications and XML requests from previous versions of Control-M/EM API.
Updating Control-M/EM API (on page 19)
Changes from version 7.0.00 to version 8.0.00 (on page 19)
Changes from version 6.4.01 to version 7.0.00 (on page 20)
Changes from version 6.3.0x to version 6.4.01 (on page 21)
19
Control-M Workload Automation Control-M/EM API Guide
Control-M/EM version 8.0.00 introduces new terminology: "folder" and "SMART Folder," which
replaces the terms "table" and "SMART table." The new terminology is reflected in requests/responses
that are described in the XML schema for version 8.0.00 (EMAPI_800.xsd).
The following table lists the elements that have been renamed in version 8.0.00 to reflect the new
terminology:
autoedit variable
sysout output
owner run_as
author created_by
group sub_application
over_lib override_path
user_daily order_method
force_ok set_to_ok
20
Control-M Workload Automation Control-M/EM API Guide
request_def_add_jobs
The above requests replaced "request_def_create_jobs" and "request_def_create_sched_group" that
were provided by Control-M/EM API for versions 6.3.00 and 6.4.00. The XML schema for version
7.0.00 does not support "request_def_create_jobs" and "request_def_create_sched_group."
Control-M/EM version 7.0.00 introduced new terminology: "table" and "SMART Table," which replaced
the terms "scheduling table" and "group scheduling table." The new terminology is reflected in
requests/responses that are described in the XML schema for version 7.0.00 (EMAPI_700.xsd).
The following table lists the elements that have been renamed in version 7.0.00 to reflect the new
terminology:
sched_table table
scheduling_group_info table_info
group_rba table_rba
into_group into_table
group_id table_id
is_group is_table
21
Control-M Workload Automation Control-M/EM API Guide
interval_sequence
specific_times
tolerance
attach_sysout
You can use these parameters when submitting the following requests:
request_create_aj
request_def_create_jobs
request_create_sched_group
NOTE: To use the parameters set the xmlns:ctmem namespace declaration to
http://www.bmc.com/ctmem/schema640.
22
Control-M Workload Automation Control-M/EM API Guide
<ctmem:rule_based_cal_name>
rule_based_cal_name
</ctmem:rule_based_cal_name>
</ctmem:sub_rule_based_cal>
</ctmem:sub_table_rule_based_cals>
</ctmem:table_attributes>
</ctmem:sub_table>
</ctmem:request_def_add_table>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The following example is an XML request using the current format:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_def_add_folder
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>$USER_TOKEN$</ctmem:user_token>
<ctmem:parent_folder>
<ctmem:control_m>$CONTROL_M$</ctmem:control_m>
<ctmem:folder_name>smart</ctmem:folder_name>
<ctmem:folder_library/>
<ctmem:order_method>user_daily</ctmem:order_method>
</ctmem:parent_folder>
<ctmem:sub_folder>
<ctmem:folder_name>sub</ctmem:folder_name>
<ctmem:folder_attributes>
<ctmem:application>apiWinApp3</ctmem:application>
<ctmem:sub_application>apiGroup3
</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:sub_folder_rule_based_cals>
<ctmem:sub_rule_based_cal>
<ctmem:rule_based_cal_name>
23
Control-M Workload Automation Control-M/EM API Guide
rule_based_cal_name
</ctmem:rule_based_cal_name>
</ctmem:sub_rule_based_cal>
</ctmem:sub_folder_rule_based_cals>
</ctmem:folder_attributes>
</ctmem:sub_folder>
</ctmem:request_def_add_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
24
5
5
Control-M/EM API Class references
This section describes class reference information about the functions that you can access when using
Control-M/EM API in your project.
The following table describes the Control-M/EM API classes:
Class Description
ComponentType class
An abstract base class, which represents a Control-M/EM component used with Control-M/EM API.
When you send a request, the Control-M/EM component (which the request is refers to) is not indicated in
the request. Instead, the ComponentType instance refers the request instance to the appropriate
component.
The GSRComponent class (on page 32) is derived from the ComponentType class. This class is used when
creating an instance of the EMXMLInvoker or the EMBasicXMLInvoker. For more information about
the EMXMLInvoker and EMBasicXMLInkover see the following:
EMXMLInvoker class (on page 42)
EMBasicXMLInvoker class (on page 40).
25
Control-M Workload Automation Control-M/EM API Guide
Method Description
done (on page 27) Stops Control-M/EM API services by breaking the
connection with the CORBA processes.
getProperties (on page 27) Obtains for example, the Control-M/EM GUI Server names
from the ctmem.properties file.
setProperties (on page 28) Specifies, for example, the Control-M/EM GUI Server names
and a location from which to obtain them.
Init (on page 29) Starts the Control-M/EM API services and initializes CORBA
with default values or with values specified with its optional
parameters.
invoke (on page 31) Enables you to send a request to Control-M/EM as a XML
text string. When the invoke method is used with the
EMBasicXMLInvoker class, polling for responses from
Control-M/EM is automatic. When the invoke method is
used with the EMXMLInvoker class, the user must
activate polling to receive a response from Control-M/EM
26
Control-M Workload Automation Control-M/EM API Guide
BuildPasswordString
Enables you to prepare a text string for use as a user password in the User Registration request.
The BuildPasswordString() function must be called immediately before sending every API Register
request because a different string is used for each request in some modes.
Syntax: Public String BuildPasswordString(password_string) throws
InvokeException
Parameters: password_string. Text string, subject to all limitations that apply to a Control-M/EM
password
Return codes: The prepared string to be used in the password field of the registration request.
See User Registration (on page 51)
done
Enables you to stop the Control-M/EM API services by breaking the connection with the CORBA processes
(EMXMLInvoker static method).
Syntax: Public static void done()
Parameters: None
Return codes: None
See Configuring Control-M/EM API (on page 13) and Init (on page 29).
getProperties
Enables you to obtain the Control-M/EM GUI Server name from the ctmem.properties file. This method
returns the properties object that you specify with the setProperties (on page 28) method. If you have not
set the Control-M/EM API properties by using setProperties, it returns the properties object containing
the values in the ctmem.properties file under your project/application working directory.
Each call to getProperties reads the ctmem.properties file. Any modifications made to this file while
the application is running affect subsequent calls to getProperties.
Syntax: Public Properties getProperties();
Parameters: The following describes the parameters for getproperties:
host_of_the_GUI_Server: Name of the Control-M/EM GUI Server. Default:
com.bmc.ctmem.emapi.GSR.hostname
path_to_XML_data_files: Location of the XML schema. Default:
com.bmc.ctmem.emapi.XMLDATAPAT
Return codes: properties
27
Control-M Workload Automation Control-M/EM API Guide
setProperties
Used to specify the Control-M/EM Global Alerts Server or GUI Server host names and the source from
which to obtain them.
Syntax: Public void setProperties(Properties props);
Parameters: The following table describes the parameters for SetProperties:
Parameter Description
28
Control-M Workload Automation Control-M/EM API Guide
Init
Starts the Control-M/EM API services and initializes CORBA with default values or with values specified
with its optional parameters (an EMXMLInvoker static method). The init method must be run at
program startup. The following table describes the three different prototypes.
init Description
29
Control-M Workload Automation Control-M/EM API Guide
init Description
30
Control-M Workload Automation Control-M/EM API Guide
EMXMLInvoker.init(args, props);
...
}
}
The following is a run example:
java HelloWorld
This run example is used for illustrative purposes. To run it, you must add Java virtual machine (JVM)
parameters and the Control-M/EM API CLASSPATH. These concepts are discussed in Control-M/EM API
Installation (on page 10) . This CORBA configuration information is contained in the jacorb.properties
file located in the emapi-800\etc directory.
By using both values for props and args, you can supply values for props that can be overridden by values
that are supplied for args.
invoke
Enables you to send a request to Control-M/EM. The request is sent as an XML text string. The invoke
method is used with either the EMBasicXMLInvoker class or EMXMLInvoker class. A request in XML
format (xml request), specifying the action that Control-M installation is to perform, is required for
each call.
Syntax: public String invoke(String xmlRequest) throws InvokeException
Parameters: The xmlrequest string is a request that you send to Control-M/EM. The string is a text
file in an XML format that the Control-M/EM API can accept and interpret.
Return codes: Response in XML format. Response data that addresses the request that was sent. It is
returned as an XML formatted string.
See invoke and Request and response parameters (on page 48)
31
Control-M Workload Automation Control-M/EM API Guide
setPollRequestIntervalMilli
(EMBasicXMLInvoker only) Sets the interval between automatically-sent poll requests. This time is
measured from the end of the current poll request. This value must be less than or equal to the value
specified with the setPollRequestTimeoutMilli (on page 32) method. See Polling interval timeout
configuration (on page 31).
Syntax: Public void setPollRequestIntervalMilli (final long interval)
Parameters: interval. Time, in milliseconds.
Default: 5000 milliseconds (5 seconds)
Return codes: None
setPollRequestTimeoutMilli
(EMBasicXMLInvoker only) Sets the total time that is allotted for polling for a response to a request. This
value must be greater than or equal to the value specified with the setPollRequestIntervalMilli (on page
32) method.
Syntax: Public void setPollRequestTimeoutMilli(final long timeout)
Parameters: timeout. Time, in milliseconds
Default: -1 milliseconds (the -1 value indicates that polling is carried on until a response is received.
There is no timeout value).
Return Codes: None
See Polling interval timeout configuration (on page 31).
GSRComponent class
Represents the GUI Server. When creating an instance of EMXMLInvoker (or EMBasicXMLInvoker)
with a reference to a GSRComponent type, the request is sent to the specified Control-M/EM GUI Server.
For more information, see ComponentType class (on page 25).
32
Control-M Workload Automation Control-M/EM API Guide
The GSRComponent class uses the constructors listed in the following table:
Constructor Description
GSRComponent Using this constructor, the request is sent to the GUI Server name
(prototype 1) specified under com.bmc.ctmem.emapi.GSR.name=name in the
ctmemapi.properties file.
Syntax: GSRComponent();
Parameters: None
Return codes: None
GSRComponent Using this constructor, the request is sent to the GUI Server name
(prototype 2) specified with the name parameter.
Syntax: GSRComponent(String name);
Parameters: name. This is the GUI Server name.
Return codes: None
InvokeException class
Enables Control-M/EM API user to obtain error information when an exception is thrown.
For error codes and exceptions see Error codes and exceptions (on page 197).
33
Control-M Workload Automation Control-M/EM API Guide
The InvokeException class includes the methods listed in the following table:
Method Description
getMajorCode Enables you to obtain the Major Code that identifies the error family to
which an error belongs.
Syntax: Public int getMajorCode()
Parameters: None
Return codes: int. An integer that identifies the error family to
which the error belongs.
getMinorCode Enables you to obtain the Minor Code of an error. The Minor Code
provides a unique identifier for the error in the family to which it
belongs.
Syntax: Public int getMinorCode()
Parameters: None
Return codes: int. An integer that provides a unique identifier for
the error in its family.
34
Control-M Workload Automation Control-M/EM API Guide
<ctmem:odate>ODAT</ctmem:odate>
</ctmem:condition>
</ctmem:request_add_condition>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
35
6
6
Control-M/EM API requests
Control-M/EM API supports two types of requests:
Synchronous Requests (on page 37): Synchronous requests are processed by Control-M/EM and
responses are received directly from Control-M/EM.
Asynchronous Requests (on page 38): Asynchronous requests are sent through Control-M/EM to
Control-M/Server. By sending a polling request that includes the tracking ID, the user can retrieve
feedback about what action Control-M/EM takes, or notice that the request is still being processed.
Before sending requests, Control-M/EM API must be initialized. Control-M/EM supports two methods
for creating, sending and handling requests. See Control-M/EM API programming methods (on page
38) for more information.
36
Control-M Workload Automation Control-M/EM API Guide
Synchronous Requests
Synchronous requests are processed by Control-M/EM. Responses are received directly from
Control-M/EM. These include some of the following:
Request Description
user registration request (on page 51) Sends the username and password of the user
to the target server component.
Check user token validity (on page 53) Checks if the specified user identification is
still valid.
User Unregistration (on page 57) Enables an unregister request to send the user
token to the server component when the
application finishes using the API.
Retrieve jobs in the active jobs database (on page 164) Enables you to retrieve jobs that are in the
active jobs database.
Change alert status (on page 179) Changes the status (for example, from
not_noticed to handled) of an alert.
Job tracking (on page 157) Tracks the progress of existing jobs in
Control-M installation.
create job and SMART folder definitions (on page 59) Creates a new outer-most folder (regular or
SMART Folder) definitions.
Delete job definitions (on page 86) Deletes one or more jobs from a folder
according to the user defined deletion criteria.
SMART Folder or sub-folder entities are not
deleted.
Retrieve BIM Services list (on page 182) Retrieves the list of services active in the
Batch Impact Manager Server.
Request list conditions (on page 150) Retrieves a list of conditions for a job.
37
Control-M Workload Automation Control-M/EM API Guide
Asynchronous Requests
Asynchronous requests are sent through Control-M/EM to Control-M/Server. These requests receive a
tracking ID as a response. By sending a polling request that includes this tracking ID, the user can
retrieve feedback about what action Control-M/EM takes, or a notice that the request is still being
processed. The following table describes asynchronous requests:
Request Description
Order or Force Request (on page 96) Enables you to force an individual job or all jobs in a
folder to be placed in Active Jobs.
add (on page 143) condition Delete Enables you to add or delete prerequisite conditions
condition (on page 146) request to jobs.
Job creation (on page 108) Enables you to create a job or a SMART Folder and
inserts the job into Active Jobs.
Upload folder (on page 92) Enables you to upload an outermost folder.
Job actions in active jobs (on page Enables you to perform actions on jobs that are
153) currently in the active jobs database.
38
Control-M Workload Automation Control-M/EM API Guide
39
Control-M Workload Automation Control-M/EM API Guide
EMBasicXMLInvoker class
The EMBasicXMLInvoker class eliminates the need for polling by not returning the response until either
the final response is available from the server, or the API times out. The advantage is that you do not
have to process the responses or place additional requests. The EMBasicXMLInkvoker uses an XML
schema to validate XML formatted request and response strings. See XML string validation (on page 41).
The EMBasicXMLInvoker class has the following limitations:
The API call might be blocked for several seconds, until the final response is available or the call times
out. The time out period is configurable.
After receiving the response, the EMBasicXMLInvoker class performs additional processing to
determine its course of action.
Because the EMBasicXMLInvoker class performs XML parsing, this class makes it more resource
intensive than the EMXMLInvoker class.
The following flowchart illustrates the EMBasicXMLInvoker request session:
40
Control-M Workload Automation Control-M/EM API Guide
41
Control-M Workload Automation Control-M/EM API Guide
The XML standard does not include support for the following characters. If these characters are used,
they are translated in the XML file as listed in the following table:
apostrophe '
For information about using the EMXMLInvoker and EMBasicXMLInvoker see Control-M/EM API requests
(on page 36).
EMXMLInvoker class
The EMXMLInvoker class sends XML formatted requests to Control-M/EM and returns responses to the
program that issues requests. This class does not process response data. Certain asynchronous requests
(such as the Job Creation request) take time for Control-M to process and only indicates if the request has
been submitted successfully.
An application using the EMXMLInvoker class may make several requests to check whether the expected
response is available by sending a poll request. To identify the original request (for which polling is being
performed) the poll request includes a tracking ID, which is supplied in a response from Control-M/EM
immediately after certain asynchronized requests are submitted. The program can submit this tracking ID
in a poll request several times, until the required response is available.
The following flowchart illustrates an EMXMLInvoker request session:
42
Control-M Workload Automation Control-M/EM API Guide
The following figure illustrates the polling process in detail. The advantage of the polling process is that
the API always replies immediately to the request. No extra time or resources are spent processing the
responses.
43
Control-M Workload Automation Control-M/EM API Guide
44
Control-M Workload Automation Control-M/EM API Guide
2. Send a request to the specified Control-M/EM server component according to the different class:
EXAMPLE: EMXMLInvoke or EMBasicXMLInvokerr:
String xmlRequest = "<?xml?>..."; // xml request
String xmlResponse;
try{
xmlResponse = gsrInvoker.invoke(xmlRequest);
}
catch(InvokeException ex){
// handle invoke failures
}
// handle xml response
NOTE: A request in XML format (xmlRequest), specifying the action that the Control M installation is
to perform, is required for each call. The various types of requests that you can make are described in
Request and response parameters (on page 48).
45
Control-M Workload Automation Control-M/EM API Guide
46
Control-M Workload Automation Control-M/EM API Guide
47
7
7
Request and response parameters
This topic describes Control-M/EM API request and response parameters. Many XML elements in this
section are Control-M job parameters. To create a successful request, such as a Job Creation request or
an Order Job request, you should become familiar with Control-M job parameters. See General
parameters.
For Control-M/EM API request parameters, see Request XML parameters (on page 50).
NOTE: Control-M/EM API does not support non-English characters in request and response parameters.
Every time a request is made, Control-M/EM replies by sending one or more response strings. You can
parse the contents of these response strings for use in your project. Control-M/EM API responses are
wrapped by the SOAP envelope. For more information, see SOAP envelope for Control-M/EM requests and
responses (on page 48).
48
Control-M Workload Automation Control-M/EM API Guide
49
Control-M Workload Automation Control-M/EM API Guide
Name Description
User Registration (on page Sends the username and password of the user to the target
51) server component.
Check user token validity (on Checks to see if the specified user identification is valid.
page 53)
Client Keep Alive (on page Resets the registration timeout counter to zero.
55)
User Unregistration (on page Enables you to see if the specified user identification is valid.
57)
Add jobs to folder definitions Enables you to add job definitions into an existing outermost
(on page 79) folder or sub-folder.
Add folder to folder Enables you to add sub-folder definitions into an existing
definitions (on page 83) outermost SMART folder or sub-folder.
Delete job definitions (on Deletes job definitions from the specified outermost or
page 86) sub-folder.
Order (on page 96) Inserts a job or folder into Active Jobs immediately (force)
or subject to scheduling criteria (order).
Job creation (on page 108) Creates a job, SMART Folder, or sub-folder into the Active
Jobs database.
Add condition (on page 143) Enables you to add conditions for a job
Delete condition (on page Enables you to delete conditions for a job.
146)
List conditions (on page 150) Retrieves a list of conditions for a job.
50
Control-M Workload Automation Control-M/EM API Guide
Name Description
Job actions in active jobs (on Performs actions on jobs that are currently in the active jobs
page 153) database.
Job tracking (on page 157) Enables you to Poll the Response repository in the
Control-M/EM GUI Server to receive completion confirmation
from earlier job processing requests.
Retrieve jobs in the active Enables you to retrieves jobs that are currently in the active
jobs database (on page 164) jobs database.
Change alert status (on page Enables you to change the status of an alert (for example,
179) from not_noticed to handled).
Retrieve BIM Services list (on Retrieves the list of services active in the BMC Batch Impact
page 182) Manager server.
User Registration
Sends the username and password of the user to the target server component. The server component
returns a user token, which must accompany all subsequent requests made during the session.
Each Control-M/EM API request must contain a user token. This token is obtained using a register
request, containing Control-M/EM user name and password. Upon successful authentication a new session
is created for this user. This session is identified by the returned user token. When the session finishes,
send an unregister request to log out and release resources allocated for this user session.
NOTE: A program can use multiple user tokens and issue several requests at once (for example, for a
multi-threaded program). However, you should not issue another request with the same user token if the
previous request is still in session.
The following topics describe the request user registration parameters, the response from Control-M/EM,
together with examples:
request_register XML parameters (on page 52)
request_register XML example (on page 52)
response_register parameters (on page 53)
response_register XML example (on page 53)
51
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
component For Control-M for Web Services, Java, and Messaging only. See the
relevant product documentation for more information.
password Defines the Control-M/EM user password of the person making the
request.
NOTE: This password must be sent as an encrypted string.
Therefore, you must use the BuildPasswordString method to
encrypt the password prior to making the User Registration
request. For more information see, BuildPasswordString (on page
27).
timeout Indicates a length of time, in seconds, until the users current user
token is automatically invalidated. Integer. Default: 720. Optional.
You should synchronize the value of this parameter with that of the
EM_REFRESH_INTERVAL environment variable in
Control-M/Enterprise Manager. For more information, refer to
Preparing the Control-M/EM API project environment (on page 15).
NOTE: Use the Timeout Reset Request to restart the count from 0.
For an example of the Request, see request_register XML example (on page 52).
52
Control-M Workload Automation Control-M/EM API Guide
</SOAP-ENV:Envelope>
response_register parameters
The following table describes the response_register XML parameters:
Parameter Description
For an example of the response, see response_register XML example (on page 53). For error codes: See
Authorization request errors (Major code 407) (on page 208).
NOTE: XML parameters for fault_register, and a sample fault response are described in Fault Response
(on page 187).
53
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
component For Control-M for Web Services, Java, and Messaging only. See the
relevant product documentation for more information.
user_token Defines the serial identification number supplied to the user during
registration. String.
For an example of a request, see request_check_user_token XML example (on page 54).
54
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see response_check_user_token XML example (on page 55). For error
codes: See Authorization request errors (Major code 407) (on page 208).
NOTE: The XML parameters for fault_check_user_token, and a sample fault response are described in
Fault Response (on page 187).
55
Control-M Workload Automation Control-M/EM API Guide
The following topics describe the request client keep alive parameters, the response from Control-M/EM,
together with examples:
request_client_keep_alive XML parameters (on page 56)
request_client_alive XML example (on page 56)
response_client_keep_alive XML parameters (on page 57)
response_client_alive XML example (on page 57)
Parameter Description
component For Control-M for Web Services, Java, and Messaging only.
See the relevant product documentation for more
information.
For an example of a request, see request_client_alive XML example (on page 56).
56
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see response_client_alive XML example (on page 57). For error codes: See
Authorization request errors (Major code 407) (on page 208).
NOTE: XML parameters for fault_client_keep_alive, and a sample fault response are described in Fault
Response (on page 187).
User Unregistration
When the application finishes using the API, you send an Unregister request, which in turn, sends the
user token to the server component. The server component erases the user from its active users list. The
user token is invalidated when the request is complete.
The following topics describe the request user unregistration parameters, the response from
Control-M/EM, together with examples:
request_unregister XML parameters (on page 58)
request_unregister XML example (on page 58)
response_unregister XML parameter (on page 58)
response_unregister XML example (on page 59)
57
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
component For Control-M for Web Services, Java, and Messaging only.
See the relevant product documentation for more
information.
For an example of the request, see request_unregister XML example (on page 58).
Parameter Description
For an example a response, see:response_unregister XML example (on page 59). For error codes: See
Authorization request errors (Major code 407) (on page 208).
XML parameters for fault_unregister, and a sample fault response are described in Fault Response (on
page 187).
58
Control-M Workload Automation Control-M/EM API Guide
59
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For examples of requests, see Create folder definitions examples (on page 73).
Parameter Description
folder_library (Control-M for z/OS only) Defines the name of the library in
which the table is located. String
jobs Defines a sequence of job elements. See Job and SMART Folder
XML parameters (on page 62) for a list of the parameters that
can be used or specified in job elements.
60
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_m Name of the Control-M installation that processes the request. String.
folder_attributes The SMART Folders attributes. See Job and SMART Folder XML parameters.
sub_folders A sequence of sub-folder elements. See Job and SMART Folder XML parameters
for a list of the parameters that can be used/specified in sub-folder elements.
jobs A sequence of job elements. See Job and SMART Folder XML parameters for a
list of the parameters that can be used/specified in job elements.
Parameter Description
folder_attributes Defines the sub-folders user defined attributes. See Job and
SMART Folder XML parameters (on page 62).
jobs Defines a sequence of job elements. See Job and SMART Folder
XML parameters (on page 62) for a list of the parameters that
can be used or specified in job elements.
61
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
active_from Indicates the start of a period of time during which the job or
SMART Folder can be ordered.
active_till Indicates the end of a period of time during which the job or
SMART Folder can be ordered.
application Provides a logical name for sorting groups of jobs. This parameter
is used to supply a common descriptive name to a set of related
job groups. The jobs do not necessarily have to run at the same
time.
arch_max_days (Control-M for z/OS only) Defines the maximum number of days to
retain the SYSDATA archive data set for jobs that ended
NOTOK.
arch_max_runs (Control-M for z/OS only) Defines the maximum number of job
runs to retain the SYSDATA archive data set for jobs that ended
NOTOK.
62
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
command (Optional) Defines the command string supplied when the job
Task Type (the task_type element) is Command.
control_resources (on page (From Forecast only) Indicates the resources required by the job
125) during execution and the type of control (shared or exclusive) the
job requires over each resource. The Control Resources parameter
is used to control parallel execution of jobs.
count_cyclic_from Indicates whether the interval between runs of a cyclic job or until
the start of a rerun job is measured from the start or the end of
the previous job run.
ctld_category (Control-M for z/OS only) Defines the name of a Control-D Report
Decollating Mission category to be scheduled whenever the job is
run.
cyclic Indicates that the job must run at a designated time, interval of
time.
cyclic_type Indicates how the intervals for running the job are specified, if job
is cyclic (cyclic equal yes). Valid values are:
interval: Job is run at fixed interval. See rerun_interval.
interval_sequence: Job is run according to a list of time
periods. See interval_sequence.
specific_times: Job is run according to a list of specific
times. See specific_times.
Only for jobs running in Control-M/Server version 6.4.01 and
above and Control-M for z/OS version 7.0.01 and above.
63
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
days_due_out_offset Defines the number of days that job execution can be extended
after the ODAT.
Only for jobs running in Control-M for z/OS version 6.2.00 and
above.
in_conditions (on page 125) (From Forecast only) Specifies prerequisite conditions that must
be satisfied before the job is submitted for execution. The In
Conditions parameter makes the submission of the job dependent
on the existence of one or more prerequisite conditions.
64
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
file_path For non-z/OS jobs, File Path indicates the location of the file that
contains the script. For z/OS jobs, Member Library indicates the
location of the Member that contains the JCL, started task
procedure, or Warning message.
file_name Defines the name of the folder. In the Properties pane this
parameter indicates the folder where the job belongs.
month_days Indicates the days of the month on which the job should be
scheduled for processing.
host_id Defines the Host ID of the host on which the job was recently run.
Not for Control-M for z/OS jobs.
pds (Control-M for z/OS only) Defines the name of a partitioned data
set to check for free space. If the Partition Data Set has fewer
than the minimum number of required free tracks (as specified for
the Minimum number of tracks parameter), the job is executed.
prevent_nct2 (Control-M for z/OS only) Performs data set cleanup before the
original job run.
65
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
quantitative_resources (on (From Forecast only) Indicates the name and quantity of
page 126) Quantitative resources required by the job.
request_nje (Control-M for z/OS only) Defines the node in the JES network
where the job executes.
rerun_member (Control-M for z/OS only) Defines the name of the JCL member to
use when the job automatically reruns.
run_as Identifies the user name with the authorization to execute the job.
This parameter is used by the Control-M security mechanism.
SAC (Control-M for z/OS only) Determines whether to adjust the logical
date for a job converted from a scheduling product other than
Control-M.
66
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
shift Enables you to schedule the job if the date is not confirmed.
(Option) Valid values are:
ignore_job: Do not shift the job to a different date. The job
is not scheduled.
next_day: Shift to the next working date.
prev_day: Shift to the previous working date.
no_confcal:. Tentatively schedule the job for the current day
(even if not a working day). Additional shifting may or may
not be performed, depending on the value indicated in the
shift_num parameter.
shift_num Defines the number of working days that a job can be shifted.
Values from -62 to 62 can be entered. This function is also called
Extended Shift.
sub_application Defines the name of the sub application to which the job belongs.
Used as a descriptive name for related groups of jobs.
sys_db (Control-M for z/OS only)Indicates that a single data set is used
for archiving the SYSDATA of all jobs until it is full, when another
data set is started.
Valid values:
yes: Single data set created for the SYSDATA of each job run.
no: Separate data set created for the SYSDATA of each job
run.
67
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
output_from_class (Control-M for z/OS only) Limits the output handling operation to
only outputs from the specified class.
system_affinity (Control-M for z/OS jobs only) Indicates the identity of the system
in which the job must be initiated and executed (in JES2).
Indicates the identity of the processor on which the job must
execute (in JES3).
68
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
time_from_days_offset Defines the number of days after the original scheduling date of
the job during which execution of the job can begin.
Only for jobs running in Control-M for z/OS version 6.2.00 and
above.
time_until_days_offset Defines the number of days after the original scheduling date of
the job during which execution of the job can end.
Only for jobs running in Control-M for z/OS version 6.2.00 and
later
69
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
time_zone Indicates the global time zone used to calculate the interval for
time-related conditions.
week_days Indicates the days of the week on which the job should be
scheduled for processing.
JAN Indicates whether to run the job in the relevant month. Valid
values are:
yes
FEB no
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
70
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
keep_active Defines the maximum number of days that the job can wait to be executed after
its original scheduling date has passed.
and_or Indicates the relationship between Month Days parameter values and Week
Days parameter values. Optional.
days_cal Defines the name of a user-defined calendar containing a list of days of the
month, used with Month Days, to determine a set of working days.
weeks_cal Defines the name of a user-defined, week-based calendar used together with
parameter Week Days to specify a set of working days.
retro Indicates whether the job should be scheduled for possible execution after its
original scheduled date has passed.
shift Defines when to schedule the job if the date is not confirmed. (Option) Valid
values are:
ignore_job: Do not shift the job to a different date. The job is not
scheduled.
next_day: Enables you to shift to the next working date.
prev_day: Enables you to shift to the previous working date.
no_confcal: Enables you to tentatively schedule the job for the current day
(even if not a working day). Additional shifting may or may not be
performed, depending on the value indicated in the shift_num parameter.
shift_num Defines the number of working days that a job can be shifted. Values from -62
to 62 can be entered. This function is also called Extended Shift.
active_from Indicates the start of a period of time during which the job or SMART Folder can
be ordered.
active_till Indicates the end of a period of time during which the job or SMART Folder can
be ordered.
month_days Indicates the days of the month on which the job should be scheduled for
processing.
71
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
week_days Indicates the days of the week on which the job should be scheduled for
processing.
dates Defines a sequence of date, which indicates a specific date, in either mmdd or
ddmm format (depending on the site standard), on which the job should be
scheduled.
Control-M for z/OS:
A maximum of 12 date elements can be specified.
JAN Indicates whether to run the job in this month. Valid values are:
yes
no
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
72
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_m Indicates the name of the Control-M installation that processes the
request. String.
folder_library (Control-M for z/OS only) Indicates the name of the library in which
the table is located. String.
For examples of responses, see: Create folder definitions examples (on page 73). For error codes: See
Create job/SMART Folder definitions request errors (Major code 412) (on page 211).
XML parameters for fault_def_create_smart_folder and a sample fault response are described in Fault
Response (on page 187).
<ctmem:user_token>115B95A7FA4B787B924A2BEA8CE3121A</ctmem:user_token>
<ctmem:SMART_folder>
<ctmem:control_m>my700</ctmem:control_m>
73
Control-M Workload Automation Control-M/EM API Guide
<ctmem:folder_name>apiTestSMARTFolder</ctmem:folder_name>
<ctmem:order_method>SYSTEM</ctmem:order_method>
<ctmem:folder_attributes>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:smart_folder_rule_based_cals>
<ctmem:rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal1</ctmem:rule_based
_cal_name>
<ctmem:month_days>ALL</ctmem:month_days>
<ctmem:MAR>yes</ctmem:MAR>
</ctmem:rule_based_cal>
</ctmem:smart_folder_rule_based_cals>
</ctmem:folder_attributes>
<ctmem:sub_folders>
<ctmem:sub_folder>
<ctmem:folder_name>subFolder_1</ctmem:folder_name>
<ctmem:folder_attributes>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:group>apiGroup</ctmem:group>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:sub_folder_rule_based_cals>
<ctmem:sub_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal1</ctmem:rule_based_cal_name>
</ctmem:sub_rule_based_cal>
</ctmem:sub_folder_rule_based_cals>
</ctmem:folder_attributes>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-SubFolder_1</ctmem:job_name>
<ctmem:mem_name>In-SubFolder_1</ctmem:mem_name>
<ctmem:task_type>command</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
74
Control-M Workload Automation Control-M/EM API Guide
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:command>ls -l</ctmem:command>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:job_rule_based_cals>
<ctmem:job_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal1</ctmem:rule_based_cal_name>
</ctmem:job_rule_based_cal>
</ctmem:job_rule_based_cals>
</ctmem:job>
</ctmem:jobs>
</ctmem:sub_folder>
</ctmem:sub_folders>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-Smart-Folder</ctmem:job_name>
<ctmem:mem_name>INGROUP</ctmem:mem_name>
<ctmem:mem_lib>INGROUP</ctmem:mem_lib>
<ctmem:task_type>dummy</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
</ctmem:job>
</ctmem:jobs>
</ctmem:SMART_folder>
</ctmem:request_def_create_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
75
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Body>
<ctmem:response_def_create_folder
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder</ctmem:folder_name>
</ctmem:response_def_create_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<ctmem:user_token>115B95A7FA4B787B924A2BEA8CE3121A</ctmem:user_token>
<ctmem:folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestFolder</ctmem:folder_name>
<ctmem:order_method>SYSTEM</ctmem:order_method>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-Folder-1</ctmem:job_name>
<ctmem:mem_name>In-Folder-1</ctmem:mem_name>
<ctmem:task_type>dummy</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:month_days>ALL</ctmem:month_days>
<ctmem:MAR>yes</ctmem:MAR>
</ctmem:job>
</ctmem:jobs>
76
Control-M Workload Automation Control-M/EM API Guide
</ctmem:folder>
</ctmem:request_def_create_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
77
Control-M Workload Automation Control-M/EM API Guide
<ctmem:user_token>115B95A7FA4B787B924A2BEA8CE3121A</ctmem:user_token>
<ctmem:folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestFolder</ctmem:folder_name>
<ctmem:order_method>SYSTEM</ctmem:order_method>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-Folder-2</ctmem:job_name>
<ctmem:mem_name>In-Folder-2</ctmem:mem_name>
<ctmem:task_type>dummy</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:month_days>ALL</ctmem:month_days>
<ctmem:MAR>yes</ctmem:MAR>
</ctmem:job>
</ctmem:jobs>
</ctmem:folder>
</ctmem:request_def_create_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
78
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Error response from EM Server.</faultstring>
<detail>
<ctmem:fault_def_create_folder
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:error_list ctmem:highest_severity='Error'>
<ctmem:error ctmem:major='412' ctmem:minor='7'
ctmem:severity='Error'>
<ctmem:error_message>Folder already
exist.</ctmem:error_message>
</ctmem:error>
</ctmem:error_list>
</ctmem:fault_def_create_folder>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
79
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_m Defines the name of the Control-M installation that processes the
request. String.
folder_library (Control-M for z/OS only) Defines the name of the library in which
the table is located. String.
jobs Defines a sequence of job. For a list of the parameters for job,
refer to Job and SMART Folder XML parameters
For example of requests, see request_def_add_folder XML example (sub folder to sub folder) (on page
80) and request_def_add_jobs XML example (job to sub folder) (on page 82).
<ctmem:user_token>D71B430E6A1B00071D4BE91A64E41AA4</ctmem:user_token>
<ctmem:parent_folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1</ctmem:folder_name>
</ctmem:parent_folder>
<ctmem:sub_folder>
80
Control-M Workload Automation Control-M/EM API Guide
<ctmem:folder_name>subFolder_2</ctmem:folder_name>
<ctmem:folder_attributes>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:sub_folder_rule_based_cals>
<ctmem:sub_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal2</ctmem:rule_based_cal_name>
</ctmem:sub_rule_based_cal>
</ctmem:sub_folder_rule_based_cals>
</ctmem:folder_attributes>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-SubFolder_2_job1</ctmem:job_name>
<ctmem:mem_name>In-SubFolder_2_job1</ctmem:mem_name>
<ctmem:task_type>command</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:command>ls -l</ctmem:command>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:job_rule_based_cals>
<ctmem:job_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal2</ctmem:rule_based_cal_name>
</ctmem:job_rule_based_cal>
</ctmem:job_rule_based_cals>
</ctmem:job>
</ctmem:jobs>
</ctmem:sub_folder>
</ctmem:request_def_add_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
81
Control-M Workload Automation Control-M/EM API Guide
<ctmem:user_token>83FE7394E4D10220EF99C3D55B79EFB4</ctmem:user_token>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1</ctmem:folder_name>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-SubFolder_job2</ctmem:job_name>
<ctmem:mem_name>In-SubFolder_job2</ctmem:mem_name>
<ctmem:task_type>dummy</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
</ctmem:job>
<ctmem:job>
<ctmem:job_name>In-SubFolder_job3</ctmem:job_name>
<ctmem:mem_name>In-SubFolder_job3</ctmem:mem_name>
<ctmem:task_type>dummy</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
</ctmem:job>
</ctmem:jobs>
</ctmem:request_def_add_jobs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
82
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
XML parameters for fault_def_add_jobs, and a sample fault response are described in Fault Response (on
page 187).
83
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a request, see request_def_add_folder XML example (sub folder to sub folder) (on
page 80).
<ctmem:user_token>D71B430E6A1B00071D4BE91A64E41AA4</ctmem:user_token>
<ctmem:parent_folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1</ctmem:folder_name>
</ctmem:parent_folder>
<ctmem:sub_folder>
84
Control-M Workload Automation Control-M/EM API Guide
<ctmem:folder_name>subFolder_2</ctmem:folder_name>
<ctmem:folder_attributes>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:sub_folder_rule_based_cals>
<ctmem:sub_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal2</ctmem:rule_based_cal_name>
</ctmem:sub_rule_based_cal>
</ctmem:sub_folder_rule_based_cals>
</ctmem:folder_attributes>
<ctmem:jobs>
<ctmem:job>
<ctmem:job_name>In-SubFolder_2_job1</ctmem:job_name>
<ctmem:mem_name>In-SubFolder_2_job1</ctmem:mem_name>
<ctmem:task_type>command</ctmem:task_type>
<ctmem:application>apiWinApp</ctmem:application>
<ctmem:sub_application>apiGroup</ctmem:sub_application>
<ctmem:command>ls -l</ctmem:command>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:created_by>emuser</ctmem:created_by>
<ctmem:job_rule_based_cals>
<ctmem:job_rule_based_cal>
<ctmem:rule_based_cal_name>rule_based_cal2</ctmem:rule_based_cal_name>
</ctmem:job_rule_based_cal>
</ctmem:job_rule_based_cals>
</ctmem:job>
</ctmem:jobs>
</ctmem:sub_folder>
</ctmem:request_def_add_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
85
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_m Indicates the name of the Control-M installation that processes the
request. String.
folder_library (Control-M for z/OS only) Indicates the name of the library in which
the folder is located. String.
For an example of a response, see: response_def_add_folder XML parameters example (on page 86).
XML parameters for fault_def_add_folder, and a sample fault response are described in Fault Response
(on page 187).
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1/subFolder_2</ctmem:folde
r_name>
</ctmem:response_def_add_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
86
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
user_token Defines the serial identification number supplied to the user during
registration. String.
delete_jobs_criterion Defines the delete jobs criteria wrapper. String. Consists of filter
parameters that enable specifying items to do the following:
include: (mandatory) Filter that consists of a sequence of
search_criterion elements.
exclude: (optional) Filter that consists of a sequence of
search_criterion elements.
See include or exclude XML parameters (on page 88) for more
information.
For an example of a request, see request_def_add_folder XML example (on page 90).
87
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
88
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
value Defines the value used in search criteria. Any valid value of a job
parameter. Wildcards and search patterns can be used in
combination with LIKE operator. String. Mandatory.
NOTE: At least one param element should appear under a search_criterion element. The amount of
param elements is unbounded. The relationship between param elements in the same search_criterion is
AND. String
89
Control-M Workload Automation Control-M/EM API Guide
<ctmem:user_token>D71B430E6A1B00071D4BE91A64E41AA4</ctmem:user_token>
<ctmem:folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1/subFolder_2</ctmem:folde
r_name>
</ctmem:folder>
<ctmem:delete_jobs_criterion>
<ctmem:include>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>JOB_NAME</ctmem:name>
<ctmem:operator>LIKE</ctmem:operator>
<ctmem:value>*</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
</ctmem:include>
<ctmem:exclude>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>MEMNAME</ctmem:name>
<ctmem:operator>EQ</ctmem:operator>
<ctmem:value>apiMemName2</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
</ctmem:exclude>
</ctmem:delete_jobs_criterion>
90
Control-M Workload Automation Control-M/EM API Guide
</ctmem:request_def_delete_jobs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
For an example of a response, see response_def_delete_jobs XML example (on page 91). For error codes:
see Delete job definitions request errors (Major code 413) (on page 211).
NOTE: XML parameters for fault_def_delete_jobs, and a sample fault response are described in Fault
Response (on page 187).
<ctmem:folder_name>apiTestSMARTFolder/subFolder_1/subFolder_2</ctmem:folde
r_name>
</ctmem:folder>
<ctmem:deleted_jobs_number>1</ctmem:deleted_jobs_number>
</ctmem:response_def_delete_jobs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
91
Control-M Workload Automation Control-M/EM API Guide
Upload folder
Uploads an outermost folder. Only one folder can be uploaded per request. It is possible to force upload a
folder using the optional force parameter.
The following topics describe the request to upload folder parameters, polling request parameters, the
response and the polling response from Control-M/EM, together with examples:
request_def_upload_folder XML parameters (on page 92)
request_def_upload_folder XML example (on page 92)
response_def_upload_folder XML Parameters (on page 93)
response_def_upload_folder example (on page 93)
response_def_upload_folder example (on page 93)
request_poll XML parameters (on page 94)
request_poll_def_upload_folder XML parameters example (on page 94)
response_poll_def_upload_folder XML parameters (on page 95)
response_poll_def_upload_folder XML example (on page 95)
Parameter Description
user_token Defines the serial identification number supplied to the user during registration.
String.
folder Defines the folder wrapper. The folder is identified by the following parameter
elements:
control-m: Name of the Control-M installation that processes the request.
String.
folder_name: Name of the outermost folder. String.
folder_library: Control-M for z/OS only: Name of the library in which
the table is located. String
For an example of a request, see request_def_upload_folder XML example (on page 92).
92
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_def_upload_folder
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>17C3BA2475FB34069257862D90FB2128</ctmem:user_token>
<ctmem:force_it>no</ctmem:force_it>
<ctmem:folder>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder</ctmem:folder_name>
</ctmem:folder>
</ctmem:request_def_upload_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
For an example of a response, see response_def_upload_folder example (on page 93). For error codes:
see Upload folder request errors (Major code 411) (on page 210).
NOTE: XML parameters for fault_def_upload_folder and fault_poll_def_upload_folder, as well as a sample
fault response are described in Fault Response (on page 187).
response_def_upload_folder example
The following example describes a successful response:
<?xml version="1.0" encoding="iso-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:response_def_upload_folder
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:status>OK</ctmem:status>
<ctmem:response_token>6</ctmem:response_token>
93
Control-M Workload Automation Control-M/EM API Guide
</ctmem:response_def_upload_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
user_token Defines the serial identification number supplied to the user during registration.
String.
For an example of a poll request, see request_poll_def_upload_folder XML parameters example (on page
94).
<ctmem:user_token>17C3BA2475FB34069257862D90FB2128</ctmem:user_token>
<ctmem:response_token>6</ctmem:response_token>
</ctmem:request_poll_def_upload_folder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
94
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a polling response, see response_poll_def_upload_folder XML example (on page 95).
95
Control-M Workload Automation Control-M/EM API Guide
Order
The following operations can be performed with jobs and SMART Folders using Order:
Order a job: Enables you to enter a job into Active Jobs only when its scheduling criteria are met
Force a job: Enables you to enter a job into Active Jobs even if scheduling criteria is not met
Order a SMART Folder: Enables you to order all jobs in the folder when its scheduling criteria is met.
Force a SMART Folder: Enables you to enter a SMART Folder into Active Jobs even if its scheduling
criteria is not met.
The following topics describe the request to order_force XML parameters, polling request parameters, the
response and polling response from Control-M/EM, together with examples:
request_order_force XML parameters (on page 97)
request_poll_order_force XML parameter (on page 100)
response_order_force XML parameters (on page 100)
response_poll_order_force XML parameters (on page 101)
Order XML parameters examples (on page 101)
The mandatory parameters for ordering a job differ from the mandatory parameters that are specified
when ordering or forcing a SMART Folder. Optional parameters can be supplied for both jobs and SMART
Folders.
96
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
user_token Defines the serial identification number supplied to the user during registration.
String.
control_m Defines the data center name. Mandatory for both jobs and Folders.String.
folder_library (Control-M for z/OS only) Defines the name of the library in which the folder is
located. String
folder_name Defines the name of the folder. Mandatory for both jobs and folders. String.
folder_info Defines a sequence of folder_info. See the folder_info_type XML parameters (on
page 99)
force_it Indicates whether the job is ordered or forced. Mandatory for both jobs and
Folders.
no: Orders job/folder
yes: Forces job/folder
job_id Defines the occurrence number of the job within the folder. String. Optional
Used to identify a specific job, in case there are multiple occurrences of the same
job name in the folder. If the value of the job_id parameter is blank, 0, or 1, the
first occurrence of the job is used.
job_name Defines the name of the job (mandatory). Must be left empty for folders. String.
order_date Enables you to order the job with a specific date. Mandatory for both jobs and
folders.
Valid values:
Numerical date ( yyyymmdd format)
ODAT
97
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
unique_flow Determines if a flow in a folder is ordered uniquely. This is only if you are
ordering a single folder created in version 8.0.00 and later. A unique suffix is
added to every condition name.
See Condition management.
Valid values:
Yes
No
wait_for_order_date Indicates whether the job submission should wait for a specified order date
(order_date), or be submitted as soon as the execution criteria for the job is
satisfied.
Valid values:
yes: Wait for order_date
no Do not wait for order_date (default)
NOTE: Relevant for Control-M versions 6.2.01 or later.
with_hold Enables you to hold all jobs immediately after they are ordered.
For an example of a request, see Order XML parameters examples (on page 101).
98
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
folder_id Serial number identifying the SMART Folder. Optional for jobs. Must be
empty for folders. For more information on the folder_id parameter, see
Job tracking (on page 157). String.
Parameter Description
99
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For examples of responses, see Order XML parameters examples (on page 101). For Error codes, see
Order or Force request errors (Major code 405) (on page 207).
NOTE: XML parameters for fault_order_force and fault_poll_order_force, as well as a sample fault
response are described in Fault Response (on page 187).
Parameter Description
user_token Defines the serial identification number supplied to the user during registration.
String.
For an example of a polling request, see Order XML parameters examples (on page 101).
100
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
status Describes the condition of the element that contains it (such as Error). String.
error_list attribute highest_severity Indicates the severity level of the most critical error
included in the error list. If only one error is included,
the severity for that error is displayed. String.
For an example of a polling response, see Order XML parameters examples (on page 101).
101
Control-M Workload Automation Control-M/EM API Guide
<ctmem:user_token>17C3BA2475FB34069257862D90FB2128</ctmem:user_token>
<ctmem:force_it>yes</ctmem:force_it>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:folder_name>apiTestSMARTFolder</ctmem:folder_name>
<ctmem:odate>ODAT</ctmem:odate>
</ctmem:request_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
102
Control-M Workload Automation Control-M/EM API Guide
<ctmem:status>OK</ctmem:status>
<ctmem:response_token>10u</ctmem:response_token>
</ctmem:response_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<ctmem:user_token>17C3BA2475FB34069257862D90FB2128</ctmem:user_token>
<ctmem:response_token>10u</ctmem:response_token>
</ctmem:request_poll_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
103
Control-M Workload Automation Control-M/EM API Guide
<ctmem:ret_text>Job ordered</ctmem:ret_text>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:status>OK</ctmem:status>
<ctmem:job_data>
<ctmem:order_id>00000k</ctmem:order_id>
<ctmem:job_name>subFolder_1</ctmem:job_name>
<ctmem:ret_text>Job ordered</ctmem:ret_text>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:status>OK</ctmem:status>
<ctmem:job_data>
<ctmem:order_id>00000l</ctmem:order_id>
<ctmem:mem_name>In-SubFolder_1</ctmem:mem_name>
<ctmem:job_name>In-SubFolder_1</ctmem:job_name>
<ctmem:ret_text>Job ordered</ctmem:ret_text>
</ctmem:job_data>
</ctmem:job>
</ctmem:jobs>
</ctmem:response_poll_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
104
Control-M Workload Automation Control-M/EM API Guide
<ctmem:control_m>UnixDc</ctmem:control_m><ctmem:job_id>2</ctmem:job_id>
<ctmem:job_name>OrdSimJobU</ctmem:job_name>
<ctmem:folder_name>OrdSimJobU</ctmem:folder_name>
<ctmem:odate>20020522</ctmem:odate>
</ctmem:request_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
105
Control-M Workload Automation Control-M/EM API Guide
<ctmem:user_token>$USER_TOKEN$</ctmem:user_token>
<ctmem:force_it>yes</ctmem:force_it>
<ctmem:control_m>UnixDc</ctmem:control_m>
<ctmem:job_id>2</ctmem:job_id>
<ctmem:job_name>FoInRecent</ctmem:job_name>
<ctmem:folder_name>FoInSGJobU</ctmem:folder_name>
<ctmem:odate>20010522</ctmem:odate>
<ctmem:variable_assignments>
<ctmem:variable_assignment>
<ctmem:name>Recent</ctmem:name>
<ctmem:value>1</ctmem:value>
</ctmem:variable_assignment>
<ctmem:variable_assignment>
<ctmem:name>A</ctmem:name>
<ctmem:value>1</ctmem:value>
</ctmem:variable_assignment>
<ctmem:variable_assignment>
<ctmem:name>A</ctmem:name>
<ctmem:value>2</ctmem:value>
</ctmem:variable_assignment>
</ctmem:variable_assignments>
<ctmem:folder_info>
<ctmem:into_folder>recent</ctmem:into_folder>
<ctmem:allow_dup>no</ctmem:allow_dup>
</ctmem:folder_info>
</ctmem:request_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Force a UNIX job into a recent SMART Folder allowing duplication example
The following table describes a successful request to force a UNIX job into a recent SMART Folder
allowing duplication
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
106
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Body>
<ctmem:request_order_force
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>$USER_TOKEN$</ctmem:user_token>
<ctmem:force_it>yes</ctmem:force_it>
<ctmem:control_m>UnixDc</ctmem:control_m>
<ctmem:job_id>6</ctmem:job_id>
<ctmem:job_name>FoInRecDup</ctmem:job_name>
<ctmem:folder_name>FoInSGJobU</ctmem:folder_name>
<ctmem:odate>20010522</ctmem:odate>
<ctmem:variable_assignments>
<ctmem:variable_assignment>
<ctmem:name>RecentDup</ctmem:name>
<ctmem:value>2</ctmem:value>
</ctmem:variable_assignment>
<ctmem:variable_assignment>
<ctmem:name>A</ctmem:name>
<ctmem:value>2</ctmem:value>
</ctmem:variable_assignment>
<ctmem:variable_assignment>
<ctmem:name>B</ctmem:name>
<ctmem:value>3</ctmem:value>
</ctmem:variable_assignment>
</ctmem:variable_assignments>
<ctmem:folder_info>
<ctmem:into_folder>recent</ctmem:into_folder>
<ctmem:allow_dup>yes</ctmem:allow_dup>
</ctmem:folder_info>
</ctmem:request_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
107
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_order_force
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>$USER_TOKEN$</ctmem:user_token>
<ctmem:force_it>yes</ctmem:force_it>
<ctmem:control_m>my700</ctmem:control_m>
<ctmem:job_name>sub2</ctmem:job_name>
<ctmem:folder_name>smart1/sub1</ctmem:folder_name>
<ctmem:odate>ODAT</ctmem:odate>
<ctmem:folder_info>
<ctmem:into_folder>recent</ctmem:into_folder>
<ctmem:allow_dup>yes</ctmem:allow_dup>
</ctmem:folder_info>
</ctmem:request_order_force>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Job creation
Creates a job or SMART Folder and inserts the job into Active Jobs. You can create the following:
Regular job
SMART Folder
Job in a SMART folder
You can indicate which SMART Folder to associate the job by specifying the folder name and folder ID
(folder_id) for the parent SMART Folder in the folder parameter of the job specification.
The following topics describe the job creation request parameters, polling request parameters, the
response and polling response from Control-M/EM, together with examples:
108
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
user_token Defines a serial identification number supplied to the user during registration.
String.
active_job Defines the specification for a single job. The parameters of the job are included as
elements between the opening and closing active_job tags. Contains no attributes.
See active_job XML parameters (on page 110) for more information.
For an example of a request, see Job creation examples (on page 130).
109
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
application Provides a logical name for sorting groups of jobs. This parameter is used to
supply a common descriptive name to a set of related job groups. The jobs
do not necessarily have to run at the same time.
application_cm_version Indicates the version of external application Control Module (such as SAP),
which is installed in the Control-M installation. This is specified together with
application_form, application_type, and application_version
elements.
application_type Indicates the type of external application (such as SAP) on which the external
application job runs.
application_version Indicates the version of the external application (such as SAP) on which the
external application job runs.
arch_max_days (Control-M for z/OS only) Defines the maximum number of days to retain the
SYSDATA archive data set for jobs that ended NOTOK.
arch_max_runs (Control-M for z/OS only) Defines the maximum number of job runs to retain
the SYSDATA archive data set for jobs that ended NOTOK.
auto_archive (Control-M for z/OS only) Determines whether SYSDATA (job output) must be
archived.
confirm_flag Specifies whether user confirmation is required before the job is submitted
for execution.
110
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_resources (From Forecast only) Indicates the resources required by the job during
execution and the type of control (shared or exclusive) the job requires over
each resource. The Control Resources parameter is used to control parallel
execution of jobs. A sequence of control_resources XML parameters (on page
125).
count_cyclic_from Indicates whether the interval between successive runs of a cyclic job is
calculated from the start or the end of the previous job run.
critical Determines whether the job is a critical-path job in Control-M, which ensures
resources allocation order.
ctb_step Adds Control-M/Analyzer steps as the first and/or last step of the jobs
execution. A sequence of ctb_step XML parameters (on page 124).
Cyclic Indicates that the job must run at a designated time, interval of time.
days_due_out_offset Defines the number of days that job execution can be extended after the
ODAT
doc_lib For a z/OS job, Doc Library defines the name of the library where the
Documentation (description) is saved. For a non-z/OS job, Doc Path defines
the name of the file path where the Documentation is saved..
doc_member For a z/OS job, defines the name of the member where the job
Documentation (description) is saved. For a non-z/OS job, the Doc File is the
name of the file where the job Documentation is saved.
folder_id Defines the Order ID of the parent SMART Folder preceded by a leading zero.
Control-M for Z/Os: The folder consists of RBA of the existing SMART folder.
After the SMART Folder has been created, note the value of the order_id
parameter, which must be supplied to the folder_id job parameters.
111
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
in_condition (From Forecast only) Specifies prerequisite conditions that must be satisfied
before the job is submitted for execution. The In Conditions parameter
makes the submission of the job dependent on the existence of one or more
prerequisite conditions. See in_condition XML parameters (on page 125)
keep_active Determines the number of extra days (beyond the original scheduling date)
that the job is allowed to remain in the Active Jobs database while awaiting
execution. If the job still has not run after the specified number of days, the
job is removed from the Active Jobs database. Integer.
file_path For non-z/OS jobs, File Path indicates the location of the file that contains the
script. For z/OS jobs, Member Library indicates the location of the Member
that contains the JCL, started task procedure, or Warning message. String.
file_name Indicates the name of the file that contains the job script, or for z/OS jobs,
the name of a member that contains one of the following in relation to the
job to be executed:
The JCL of the job
The started task procedure
Warning messages
multiagent Specifies that job submission details be broadcast to all agents within a
defined Host Group. All available agents in the Host Group run an identical
job, and each such job has a unique Order ID.
112
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
order_folder Default or dummy folder to which you indicate the job belongs
A folder is not necessary because jobs that are created with Control-M/EM
API are inserted directly into Active Jobs. However, you may want to include
a value for this parameter so that the job can be tracked during statistical
analysis that uses Folder as a criterion.
run_as Identifies the user name with the authorization to execute the job. This
parameter is used by the Control-M security mechanism.
override_path Specifies a temporarily-modified job script file without changing the original
script file in the File Path/Member library and without changing the
scheduling order of a folder.
pipes Runs the job regardless of whether other jobs using the same Pipe as that
specified in the definition of this job, are ready to run. See pipe XML
parameters (on page 126)
prevent_nct2 (Z/OS only)Performs data set cleanup before the original job run.
priority Determines the order of job processing by Control-M in the Active Jobs
database. String.
quantitative_resources (From Forecast only) Indicates the name and quantity of Quantitative
resources required by the job. See quantitative_resource XML parameters (on
page 126).
request_nje (z/OS only) Defines the node in the JES network where the job executes.
String.
rerun_interval Specifies the length of time to wait between reruns of a job or between cyclic
runs of a job.
rerun_max Determines the maximum number of reruns that can be performed for the
job. Integer.
113
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
rerun_member (z/OS only)Defines the name of the JCL member to use when the job
automatically reruns. String. Optional.
reten_days Determines the number of days to retain the job in the History Jobs file. For
z/OS jobs only.
reten_gen Maximum number of generations of the job to keep in the History Jobs file.
For z/OS jobs, only.
shouts Indicates a notification of a job's status. Seeshouts XML parameters (on page
128)
specific_times Specific time for a cyclic job to run, such as 7:00 or 11:00. Limited to 4000
for all fields.
This parameter is relevant only for jobs running in Control-M/Server version
6.4.01 and later and Control-M for z/OS version 7.0.01 and later.
sys_db (z/OS only) Indicates that a single data set is used for archiving the
SYSDATA of all jobs until it is full, when another data set is started.
Valid values:
yes: Single data set created for the SYSDATA of each job run.
no: Separate data set created for the SYSDATA of each job run.
output_from_class (z/OS only) Limits the output handling operation to only outputs from the
specified class.
output_parameter Certain output_option values require that you supply additional information
(such as Copy, NewDest):
If the output_option element is change_class, the
output_parameter value corresponds to the new class name.
If the output_option element is copy, the output_parameter value
corresponds to the destination file name.
If the output_option element is move, the output_parameter value
corresponds to the new destination for the file.
114
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
system_affinity (z/Os jobs only) Indicates the identity of the system in which the job must be
initiated and executed (in JES2). Also indicates the identity of the processor
on which the job must execute (in JES3).
task_type Defines one or more parameters which determines what the job runs.
Microsoft Windows and UNIX:
job
command
dummy
detached
external
SMART_folder
sub_folder
Control-M for z/OS:
job
task
SMART_folder
cyclic_job
emergency_job
emergency_cyclic_job
cyclic_task
emergency_task
emergency_cyclic_task
SMART Folder: Specify SMART_folder as task_type parameter (not for a
regular job).
115
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
time_until Enables the job to run the next day without time limitations.
time_until_days_offset Defines the number of days after the original scheduling date of the job
during which execution of the job can end.
This parameter is relevant only for jobs running in Control-M for z/OS version
6.2.00 and later.
time_zone Indicates the time zone according to which the job should be scheduled.
tolerance Maximum delay in minutes permitted for a late submission when selecting a
specific time (e.g. 5 minutes).Maximum delay in minutes permitted for late
submission when selecting a specific time.
This parameter is relevant only for jobs running in Control-M/Server version
6.4.01 and later and Control-M for z/OS version 7.0.01 and later.
variable_assignments All variables are identified by the %% prefix. If %% is included in the value
for a job processing parameter, Control-M assumes that it is referring to a
variable or function. Variable_assignments include the following XML
parameters:
name: Defines the name of the variable
value: Defines the value of the variable expression
116
Control-M Workload Automation Control-M/EM API Guide
117
Control-M Workload Automation Control-M/EM API Guide
118
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
do_variable Assigns a variable when the On criteria is met. The parameter includes the
following:
name: Name of the item in question (for example, when specified for
request, name is the name of the request; when specified for pipe, name
is the name of the pipe)
value: Value of the variable's expression.
do_cond Assigns an In or Out condition when the On criteria are met. See do_cond XML
parameters (on page 120)
do_forcejob Forces a specified job when the current job is performed. The parameter
includes the following:
Control_m: Defines the name of the target Control-M. Optional (string)
dsn: Defines the name of the directory/library containing Table file. [z/OS
only]
job: Specifies the job name of the job that is forced
folder: Defines the name of the folder with which the job specified in
do_forcejob is associated
order_date: Defines the original scheduling date of a job
variable_assignments: Defines a sequence of variable_assignment XML
parameters. Only relevant if Control_m has a value. Optional
do_ifrerun Specifies job steps to be executed during rerun of a job. Only for networks using
Control-M/Restart. See do_ifrerun XML parameters (on page 121)
do_mail Sends e-mail. See do_mail XML parameters (on page 122)
do_remedy Creates a remedy ticket. See do_remedy XML parameters (on page 123)
119
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
do_shout Sends a shout message when the On criteria are met. See do_shout XML
parameters (on page 123).
do_output Determines what to do with the output documentation when On criteria are met.
See do_output XML parameters (on page 124)
Parameter Description
120
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
confirm Indicates that a job rerun specified by the Do If Rerun parameter must be
manually confirmed before it is executed.
Valid values:
yes: Requires confirmation
no: Confirmation is not required
from_procedure_step Defines a procedure step (EXEC statement) that invokes a procedure from which
the specified program step program is executed.
from_program_step Defines a Job step. The execution results of the program executed by the job
step are checked against the specified codes criteria.
121
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
attach_output Specifies whether the output should be sent as an e-mail attachment. Valid
values are:
yes - Send the jobs output as an attachment
no - Do not send the jobs output as an attachment
default - Use the settings configured for the relevant Control-M server to
determine whether the jobs output should be sent as an attachment.
NOTE: This parameter is relevant only for jobs running in Control-M/Server
version 6.4.01 and later and Control-M for z/OS version 7.0.01 and later.
122
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
urgency Indicates the urgency of the Remedy ticket. Valid values are:
low
medium
high
urgent
clear
description Defines the description of the problem for which you are opening up the ticket.
summary Defines a summary of the problem for which you are opening up a ticket.
Parameter Description
destination Indicates the recipient of a Shout message. Specified in both the Shout or the
Notify parameters.
123
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
from_class Specifies the class of jobs with outputs that are handled using the Do Output
specifications of the job.
Parameter Description
ctb_name Defines the name of the Control-M/Analyzer entity. Must be a valid name of a
Control-M/Analyzer rule or mission.
124
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
and_or Specifies the relationship between two successive items in a series. Optional.
Valid values:
and
or
Parameter Description
on_fail Indicates whether to keep a Control resource tied to a job if the job does not
end OK. Valid values:
keep
release - default
125
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
on_ok Indicates whether to keep a Quantitative resource tied to a job if the job ends
OK.
Valid values are:
release
discard
NOTE: on_ok is relevant only for jobs running in Control-M for z/OS version
6.2.00 and later.
on_fail Indicates whether to keep a Quantitative resource tied to a job if the job does
not end OK.
Valid values are:
keep
release
NOTE: on_fail is relevant only for jobs running in Control-M for z/OS version
6.2.00 and later
Parameter Description
name Name of the item in question (for example, when specified for request, name
is the name of the request; when specified for pipe, name is the name of the
pipe)
126
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
Parameter Description
from_procedure_ Procedure step (EXEC statement) that invokes a procedure from which the
specified program step program is executed
step
from_program Job step. The execution results of the program executed by the job step are
_step checked against the specified codes criteria
127
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
destination Recipient of a Shout message. Specified in both the Shout or the Do Shout
parameters.
shout_days_offset The number of days relative to the ODAT by which the sending of the Shout
message is offset.
Valid values are:
a number from 0 through 254
blank no offset
NOTE: shout_days_offset is relevant only for jobs running in Control-M for
z/OS version 6.2.00 and later.
128
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
interval_item Time interval to rerun a cyclic job such as +2H, +1D, or +30M. Limited to 4000
characters for all fields.
Parameter Description
specific_time Specific time for a cyclic job to run, such as 7:00 or 11:00. Limited to 4000 for
all fields.
Parameter Description
For an example of a response, see Job creation examples (on page 130). Job creation errors are
described in Create active job request errors (Major code 409) (on page 209).
NOTE: XML parameters for fault_create_aj and fault_poll_create_aj, as well as a sample fault response
are described in Fault Response (on page 187).
Parameter Description
user_token Serial identification number supplied to the user during registration. String.
response_token Used in a polling request. This token is received in the immediate response of a
response_create_aj.
For an example of a poll request, see Job creation examples (on page 130).
129
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
status Describes the condition of the element that contains it.(for example, Error).
String.
jobs A sequence of a Job parameter that indicates a single job, which includes the
following parameters:
status: Defines the condition of the element that contains it (such as Error).
String
job_data: Job_data: An element that contains other parameters that
describe the job. A sequence of job_data, which contains the following
parameters:
rba: Relative block address. String
order_id: Serial number assigned to the job by Control-M Workload
Automation installation. String.
file_name: Name of the file that contains the job script. String.
job_name: Name of the job. String.
is_folder: Indicates whether the job is a member of a SMART Folder. Valid
values: no (not a member of a SMART Folder) or yes (member of a SMART
Folder)
ret_text: Text describing the job run. String.
For an example of a poll response, see Job creation examples (on page 130).
130
Control-M Workload Automation Control-M/EM API Guide
131
Control-M Workload Automation Control-M/EM API Guide
request_poll_create_aj example
The following example describes a successful request:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_poll_create_aj
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>12345630</ctmem:user_token>
<ctmem:response_token>96</ctmem:response_token>
</ctmem:request_poll_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
132
Control-M Workload Automation Control-M/EM API Guide
<ctmem:status>OK</ctmem:status>
<ctmem:jobs>
<ctmem:job>
<ctmem:status>OK</ctmem:status>
<ctmem:job_data>
<ctmem:rba>000000</ctmem:rba>
<ctmem:order_id>0023e</ctmem:order_id>
<ctmem:file_name>
</ctmem:mem_name>
<ctmem:job_name>MYJOB</ctmem:job_name>
<ctmem:is_folder>no</ctmem:is_folder>
</ctmem:job_data>
</ctmem:job>
</ctmem:jobs>
</ctmem:response_poll_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
133
Control-M Workload Automation Control-M/EM API Guide
134
Control-M Workload Automation Control-M/EM API Guide
</ctmem:quantitative_resources>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
135
Control-M Workload Automation Control-M/EM API Guide
<ctmem:in_condition>
<ctmem:condition>ctm600a0</ctmem:condition>
<ctmem:date>ODAT</ctmem:date>
<ctmem:and_or>and</ctmem:and_or>
</ctmem:in_condition>
</ctmem:in_conditions>
<ctmem:out_conditions>
<ctmem:out_condition>
<ctmem:condition>ctm600a0</ctmem:condition>
<ctmem:date>ODAT</ctmem:date>
<ctmem:sign>delete</ctmem:sign>
</ctmem:out_condition>
</ctmem:out_conditions>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
136
Control-M Workload Automation Control-M/EM API Guide
<ctmem:prevent_nct2>no</ctmem:prevent_nct2>
<ctmem:time_from>0900</ctmem:time_from>
<ctmem:time_until>1100</ctmem:time_until>
<ctmem:critical>no</ctmem:critical>
<ctmem:cyclic>no</ctmem:cyclic>
<ctmem:confirm_flag>yes</ctmem:confirm_flag>
<ctmem:auto_archive>no</ctmem:auto_archive>
<ctmem:sys_db>no</ctmem:sys_db>
<ctmem:arch_max_days>0</ctmem:arch_max_days>
<ctmem:arch_max_runs>0</ctmem:arch_max_runs>
<ctmem:rerun_max>0</ctmem:rerun_max>
<ctmem:command>ls -l</ctmem:command>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
137
Control-M Workload Automation Control-M/EM API Guide
<ctmem:time_from>1100</ctmem:time_from>
<ctmem:time_until>2300</ctmem:time_until>
<ctmem:rerun_interval>00060M</ctmem:rerun_interval>
<ctmem:critical>no</ctmem:critical>
<ctmem:cyclic>yes</ctmem:cyclic>
<ctmem:confirm_flag>yes</ctmem:confirm_flag>
<ctmem:auto_archive>no</ctmem:auto_archive>
<ctmem:sys_db>no</ctmem:sys_db>
<ctmem:arch_max_days>0</ctmem:arch_max_days>
<ctmem:arch_max_runs>0</ctmem:arch_max_runs>
<ctmem:rerun_max>0</ctmem:rerun_max>
<ctmem:command>ls -l</ctmem:command>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
138
Control-M Workload Automation Control-M/EM API Guide
<ctmem:time_from>0900</ctmem:time_from>
<ctmem:time_until>1100</ctmem:time_until>
<ctmem:priority>Ab</ctmem:priority>
<ctmem:critical>no</ctmem:critical>
<ctmem:cyclic>no</ctmem:cyclic>
<ctmem:confirm_flag>yes</ctmem:confirm_flag>
<ctmem:auto_archive>no</ctmem:auto_archive>
<ctmem:sys_db>no</ctmem:sys_db>
<ctmem:arch_max_days>0</ctmem:arch_max_days>
<ctmem:arch_max_runs>0</ctmem:arch_max_runs>
<ctmem:rerun_max>0</ctmem:rerun_max>
<ctmem:count_cyclic_from>end</ctmem:count_cyclic_from>
<ctmem:command>ls -l</ctmem:command>
<ctmem:variable_assignments>
<ctmem:autoedit_assignment>
<ctmem:name>COPYTO</ctmem:name>
<ctmem:value>%%HOME.%%FILE</ctmem:value>
</ctmem:autoedit_assignment>
</ctmem:autoedit_assignments>
<ctmem:on_do_statements>
<ctmem:on_do_statement>
<ctmem:on_statements>
<ctmem:on_statement>
<ctmem:code>*</ctmem:code>
<ctmem:statement>*</ctmem:statement>
</ctmem:on_statement>
</ctmem:on_statements>
<ctmem:do_statements>
<ctmem:do_output>
<ctmem:option>copy</ctmem:option>
<ctmem:parameter>%%COPYTO</ctmem:parameter>
</ctmem:do_output>
</ctmem:do_statements>
</ctmem:on_do_statement>
</ctmem:on_do_statements>
139
Control-M Workload Automation Control-M/EM API Guide
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<ctmem:sub_application>DoSetVar</ctmem:sub_application>
<ctmem:max_wait>0</ctmem:max_wait>
<ctmem:description>Multiple On-Dos</ctmem:description>
<ctmem:priority>Ab</ctmem:priority>
<ctmem:critical>no</ctmem:critical>
<ctmem:cyclic>no</ctmem:cyclic>
<ctmem:confirm_flag>no</ctmem:confirm_flag>
<ctmem:auto_archive>no</ctmem:auto_archive>
<ctmem:sys_db>no</ctmem:sys_db>
<ctmem:arch_max_days>0</ctmem:arch_max_days>
<ctmem:arch_max_runs>0</ctmem:arch_max_runs>
<ctmem:rerun_max>0</ctmem:rerun_max>
<ctmem:override_path>JOBDOC</ctmem:override_path>
<ctmem:count_cyclic_from>end</ctmem:count_cyclic_from>
140
Control-M Workload Automation Control-M/EM API Guide
<ctmem:command>echo %%ABC</ctmem:command>
<ctmem:on_do_statements>
<ctmem:on_do_statement>
<ctmem:on_statements>
<ctmem:on_statement>
<ctmem:code>*</ctmem:code>
<ctmem:statement>*</ctmem:statement>
</ctmem:on_statement>
</ctmem:on_statements>
<ctmem:do_statements>
<ctmem:do_variable>
<ctmem:name>Auto1</ctmem:name>
<ctmem:value>1234567890</ctmem:value>
</ctmem:do_variable
</ctmem:do_statements>
</ctmem:on_do_statement>
</ctmem:on_do_statements>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
141
Control-M Workload Automation Control-M/EM API Guide
<ctmem:application>appl</ctmem:application>
<ctmem:sub_application>grp1</ctmem:sub_application>
<ctmem:odate>ODAT</ctmem:odate>
</ctmem:active_job>
</ctmem:request_create_aj>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
142
Control-M Workload Automation Control-M/EM API Guide
Add condition
Adds prerequisite conditions. The following topics describe the add condition request parameters, polling
request parameters, the response and polling response from Control-M/EM, together with examples:
request_add_condition XML parameters (on page 143)
request_add_condition example (on page 144)
response_add_condition XML parameters (on page 144)
response_add_condition XML example (on page 144)
request_poll_add_condition XML parameters (on page 145)
request_poll_add_condition XML example (on page 145)
response_poll_add_condition XML parameters (on page 146)
response_poll_add_condition XML example (on page 146)
Parameter Description
user_token Serial identification number supplied to the user during registration. String.
143
Control-M Workload Automation Control-M/EM API Guide
request_add_condition example
The following example describes a successful request to adds the MYJOBOUTCOND1 prerequisite
condition to the ctm630 Control-M installation:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_add_condition
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>12345630</ctmem:user_token>
<ctmem:control_m>ctm630</ctmem:control_m>
<ctmem:condition>
<ctmem:name>MYJOBOUTCOND1</ctmem:name>
<ctmem:odate>STAT</ctmem:odate>
</ctmem:condition>
</ctmem:request_add_condition>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
For an example of a response: response_add_condition XML example (on page 144). For error codes: See
Add or Delete Condition request errors (Major code 404) (on page 207).
NOTE: XML parameters for fault_add_condition and fault_poll_add_condition, as well as a sample fault
response are described in Fault Response (on page 187)
144
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Body>
<ctmem:response_add_condition
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:status>OK</ctmem:status>
<ctmem:response_token>97</ctmem:response_token>
</ctmem:response_add_condition>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
user_token Serial identification number supplied to the user during registration. String.
response_token Used in a polling request. This token is received in the immediate response of a
response_add_condition.
For an example of a polling request, see request_poll_add_condition XML example (on page 145).
145
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see response_poll_add_condition XML example (on page 146).
Delete condition
Deletes prerequisite conditions. The following topics describe the delete condition request parameters,
polling request parameters, the response and polling response from Control-M/EM, together with
examples:
request_delete_condition XML parameters (on page 147)
request_delete_condition XML example (on page 147)
response_delete_condition XML parameters (on page 148)
response_delete_condition XML example (on page 148)
request_poll_delete_condition XML parameters (on page 148)
request_poll_delete_condition XML parameter example (on page 149)
response_poll_delete_condition XML parameters (on page 149)
response_poll_delete_condition XML example (on page 149)
146
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a request, see request_delete_condition XML example (on page 147).
147
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see response_delete_condition XML example (on page 148). For error
codes: See Add or Delete Condition request errors (Major code 404) (on page 207).
NOTE: XML parameters for fault_delete_condition and fault_poll_delete_condition, as well as a sample
fault response are described in Fault Response (on page 187).
Parameter Description
user_token Serial identification number supplied to the user during registration. String.
response_token Used in a polling request. This token is received in the immediate response of a
response_delete_condition.
For an example of a polling request, see request_poll_delete_condition XML parameter example (on page
149).
148
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a polling response, see response_poll_delete_condition XML example (on page 149).
149
Control-M Workload Automation Control-M/EM API Guide
List conditions
Lists prerequisite conditions.
The following topics describe the list condition request parameters, and the response from Control-M/EM,
together with examples:
request_list_conditions XML parameters (on page 150)
response_list_conditions XML parameters (on page 152)
request_list_conditions XML parameter example (on page 150)
response_list_conditions XML parameter example (on page 152)
Parameter Description
user_token Defines the serial identification number supplied to the user during registration.
String.
control_m Defines the name of the Control-M installation that processes the request.
conditions_criterion Defines the jobs criteria wrapper. String. Consists of the following filters:
include: (Mandatory): Include filter definitions criteria wrapper
exclude: (Optional): Exclude filter definitions criteria wrapper.
These parameters include the search_criterion wrapper that consists of a
sequence of param elements. At least one search_criterion element must
appear in the include element. The amount of search_criterion elements is
unlimited. The relationship between search_criterion elements in one filter is
OR. For a description of param, see Search_criterion XML parameter (on page
166) table.
For an example of a request, see request_list_conditions XML parameter example (on page 150).
150
Control-M Workload Automation Control-M/EM API Guide
<ctmem:request_list_conditions
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>$USER_TOKEN$</ctmem:user_token>
<ctmem:control_m>$CONTROL_M$</ctmem:control_m>
<ctmem:conditions_criterion>
<ctmem:include>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>CONDITION</ctmem:name>
<ctmem:operator>LIKE</ctmem:operator>
<ctmem:value>cond*</ctmem:value>
</ctmem:param>
<ctmem:param>
<ctmem:name>ODATE</ctmem:name>
<ctmem:operator>EQ</ctmem:operator>
<ctmem:value>0207</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
</ctmem:include>
</ctmem:conditions_criterion>
</ctmem:request_list_conditions>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
151
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see response_list_conditions XML parameter example (on page 152).
<ctmem:condition_name>cond01
</ctmem:condition_name>
<ctmem:control_m>BMC-JTVY85J
</ctmem:control_m>
<ctmem:odate>0207
</ctmem:odate>
</ctmem:list_conditions>
<ctmem:list_conditions>
<ctmem:condition_name>cond02
152
Control-M Workload Automation Control-M/EM API Guide
</ctmem:condition_name>
<ctmem:control_m>BMC-JTVY85J
</ctmem:control_m>
<ctmem:odate>0207
</ctmem:odate>
</ctmem:list_conditions>
</ctmem:response_list_conditions>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
153
Control-M Workload Automation Control-M/EM API Guide
Hold request_aj_hold The following describes the sub parameters for each
parameter:
Free request_aj_free
user_token: Serial identification number supplied to
the user during registration. String.
Confirm request_aj_confirm
control_m: Control-M installation to which the job
Rerun request_aj_rerun belongs. String. Mandatory.
order_id: Order ID of the job. String. Mandatory.
Kill request_aj_kill
Set to Ok request_aj_set_to_ok
For an example of a request, see request_aj_free xml parameter example (on page 154).
154
Control-M Workload Automation Control-M/EM API Guide
</SOAP-ENV:Envelope>
Kill response_aj_kill
Set to Ok response_aj_set_to_ok
For an example of a response, see response_aj_free XML example (on page 155). For Errors, see Job
actions request errors (Major code 450) (on page 212).
NOTE: XML parameters for fault_aj_force_ok and fault_poll_aj_force_ok, as well as a sample fault
response are described in Fault Response (on page 187).
155
Control-M Workload Automation Control-M/EM API Guide
Hold request_poll_aj_hold The following describes the sub parameters for each
parameter:
Free request_poll_aj_free
user_token: Serial identification number supplied to
the user during registration. String.
Confirm request_poll_aj_confi
rm response_token: Limits the number of returned
entries.
Rerun request_poll_aj_rerun
Kill request_poll_aj_kill
Set to Ok request_poll_aj_set_t
o_ok
For an example of a polling request, see Request_polling_aj_free XML example (on page 156).
156
Control-M Workload Automation Control-M/EM API Guide
For an example of a polling response, see response_polling_aj_free XML example (on page 157).
Job tracking
Tracks the progress of existing jobs in the Control-M installation. The following topics describe the job
tracking request parameters, and the response from Control-M/EM, together with examples:
157
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a request, see request_job_track XML parameters (tracking single job) example (on
page 159) and request_job_track XML parameters (tracking multiple jobs) example (on page 158).
158
Control-M Workload Automation Control-M/EM API Guide
</ctmem:job>
<ctmem:job>
<ctmem:control_m>ctm613</ctmem:control_m>
<ctmem:order_id>006b2</ctmem:order_id>
</ctmem:job>
<ctmem:job>
<ctmem:control_m>ctm620</ctmem:control_m>
<ctmem:order_id>013xc</ctmem:order_id>
</ctmem:job>
</ctmem:jobs>
</ctmem:request_job_track>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
159
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
status Describes the condition of the element that contains it. String.
NOTE: status is a descriptive element in the response and job elements.
error_list Indicates a sequence of error. See Fault Response (on page 187)
For an example of a response, see response_job_track XML parameters (tracking single job) example (on
page 163) and response_job_track XML parameters (tracking multiple jobs) example (on page 162). For
error codes, see Job tracking request errors (Major code 406) (on page 208).
160
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
control_m String.
order_id Serial number assigned to the job by the Control-M installation. String.
Parameter Description
161
Control-M Workload Automation Control-M/EM API Guide
<ctmem:state_digits>000030000000</ctmem:state_digits>
<ctmem:odate>050711</ctmem:odate>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:status>OK</ctmem:status>
<ctmem:job_data>
<ctmem:control_m>ctm613</ctmem:control_m>
<ctmem:order_id>006b2</ctmem:order_id>
<ctmem:job_status>Wait Resource</ctmem:job_status>
<ctmem:state_digits>220000004000</ctmem:state_digits>
<ctmem:odate>050704</ctmem:odate>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:status>OK</ctmem:status>
162
Control-M Workload Automation Control-M/EM API Guide
<ctmem:job_data>
<ctmem:control_m>ctm620</ctmem:control_m>
<ctmem:order_id>012qh</ctmem:order_id>
<ctmem:job_status>Ended OK</ctmem:job_status>
<ctmem:state_digits>000030000000</ctmem:state_digits>
<ctmem:odate>050711</ctmem:odate>
</ctmem:job_data>
</ctmem:job>
</ctmem:jobs>
</ctmem:response_job_track>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<ctmem:state_digits>000030000000</ctmem:state_digits>
<ctmem:odate>050711</ctmem:odate>
</ctmem:job_data>
</ctmem:job>
163
Control-M Workload Automation Control-M/EM API Guide
</ctmem:jobs>
</ctmem:response_job_track>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
164
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of request, see request_act_retrieve_jobs XML example (on page 170).
165
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
param Search criteria parameter wrapper. String. Parameters used to build the search
criteria. At least one param element should appear under a search_criterion
element. The amount of param elements is unbounded. The relationship
between param elements in the same search_criterion is AND. Includes the
following parameters:
name: Mandatory. Name of the retrieve active job parameter used as a
search criteria. String. For a list of valid values for the name parameter, see
Valid name parameter values (on page 167)
operator: Operator used in search criteria. String. Valid values:
EQ
NE
LT
GT
LIKE
value: Value used in search criteria. Any valid value of a job parameter.
Wildcards and search patterns can be used in combination with LIKE
operator. String. Mandatory.
166
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
application Defines the application name to which the jobs group belongs
MEMNAME Indicates the name of the file that contains the job script, or for z/OS jobs, the
name of a member that contains one of the following in relation to the job to be
executed:
The JCL of the job
The started task procedure
Warning messages
167
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
task_type Defines one or more parameters which determines what the job runs. Valid
values:
Microsoft Windows and UNIX:
Job
Command
Dummy
Detached
External
SMART Folder
Sub-folder
Control-M for z/OS:
Job
Started Task
SMART Folder
Cyclic Job
Emergency Job
Emergency Cyclic Job
Cyclic Task
Emergency Task
Emergency Cyclic Task
critical Determines whether the job is a critical-path job in Control-M, which ensures
resources allocation order.
cyclic Indicates that the job must run at a designated time, interval of time.If selected,
indicates that the current job is cyclic (it should be rerun at specified
intervals).
168
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
ended_ok Indicates that the job ended successfully. Valid values are:
True
False
held Indicates that the job was held. Valid values are:
True
False
delete_flag Indicates that the job was deleted. Valid values are:
True
False
requested Indicates that the job was requested. Valid values are:
True
False
run_as Identifies the user name with the authorization to execute the job. This
parameter is used by the Control-M security mechanism.
host_group Defines the name of a Control-M/Agent computer, remote host computer, or host
group where the job is submitted.
description (From Forecast only) Provides a description of the job in free text. A well written
description can help you determine why the job was defined and how it fits into
your business workflow.
169
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
170
Control-M Workload Automation Control-M/EM API Guide
</ctmem:param>
<ctmem:param>
<ctmem:name>ODATE</ctmem:name>
<ctmem:operator>EQ</ctmem:operator>
<ctmem:value>060625</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
</ctmem:include>
<ctmem:exclude>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>DATA_CENTER</ctmem:name>
<ctmem:operator>NE</ctmem:operator>
<ctmem:value>ctm630</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>APPLICATION</ctmem:name>
<ctmem:operator>EQ</ctmem:operator>
<ctmem:value>AJMN</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
<ctmem:search_criterion>
<ctmem:param>
<ctmem:name>APPLICATION</ctmem:name>
<ctmem:operator>EQ</ctmem:operator>
<ctmem:value>FullJobs</ctmem:value>
</ctmem:param>
</ctmem:search_criterion>
</ctmem:exclude>
</ctmem:retrieve_jobs_criterion>
</ctmem:request_act_retrieve_jobs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
171
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see Response_act_retrieve_jobs XML example (on page 176).
For error codes, see Retrieve active jobs request errors (Major code 440) (on page 212).
NOTE: XML parameters for fault_act_retrieve_jobs, as well as a sample fault response are described in
Fault Response (on page 187).
172
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
application Provides a logical name for sorting groups of jobs. This parameter is used to
supply a common descriptive name to a set of related job groups. The jobs do
not necessarily have to run at the same time.
application_type Indicates the type of external application (such as SAP) on which the external
application job runs.
average_runtime Average time (in minutes) for the job to run. The field displays the runtime
statistic generated by the latest run of the CTMJSA utility (which generates a
statistic based on the last successful runs of the job).
critical Determines whether the job is a critical-path job in Control-M, which ensures
resources allocation order.
cyclic Indicates that the job must run at a designated time, interval of time.
emergency (Control-M for z/OS only)Indicates that the current job or started task is an
emergency job or started task
file_name Defines the name of the folder. In the Properties pane this parameter indicates
the folder where the job belongs.
file_path For non-z/OS jobs, File Path indicates the location of the file that contains the
script. For z/OS jobs, Member Library indicates the location of the Member that
contains the JCL, started task procedure, or Warning message.
173
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
order_folder Default or dummy folder to which you indicate the job belongs. A folder is not
necessary because jobs that are created with Control-M/EM Web Services API
are inserted directly into Active Jobs database. However, you may want to
include a value for this parameter so that the job can be tracked during
statistical analysis that uses folder as a criterion.
next_time Indicates the next expected submission time for the job. For reruns or cyclic jobs
that use the Interval option. For Control-M for z/OS jobs, only the time can be
specified. For all other jobs, the time and the date can be specified.
run_as Identifies the user name with the authorization to execute the job. This
parameter is used by the Control-M security mechanism.
174
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
sub_application Defines the name of the sub application to which the job belongs. Used as a
descriptive name for related groups of jobs.
task_type Defines the type of the job (task) to be performed by Control-M. Valid values:
Microsoft Windows and UNIX:
Job
Command
Dummy
Detached
External
SMART Folder
Sub-folder
Control-M for z/OS:
Job
Started Task
SMART Folder
Cyclic Job
Emergency Job
Emergency Cyclic Job
Cyclic Task
Emergency Task
Emergency Cyclic Task
time_zone Indicates the global time zone used to calculate the interval for time-related
conditions.
175
Control-M Workload Automation Control-M/EM API Guide
<ctmem:application_type>OS</ctmem:application_type>
<ctmem:sub_application>MYGROUP1</ctmem:sub_application>
<ctmem:job_name>MYJOB</ctmem:job_name>
<ctmem:mem_name> </ctmem:mem_name>
<ctmem:mem_lib> </ctmem:mem_lib>
<ctmem:order_folder> </ctmem:order_folder>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:description></ctmem:description>
<ctmem:task_type>Command</ctmem:task_type>
<ctmem:time_zone> </ctmem:time_zone>
<ctmem:in_BIM_service>0</ctmem:in_BIM_service>
<ctmem:job_status>Wait Resource </ctmem:job_status>
<ctmem:job_state> </ctmem:job_state>
<ctmem:state_digits>020000004000</ctmem:state_digits>
<ctmem:odate>060625</ctmem:odate>
176
Control-M Workload Automation Control-M/EM API Guide
<ctmem:otime>20060625115417</ctmem:otime>
<ctmem:next_time> </ctmem:next_time>
<ctmem:rerun_counter>00000</ctmem:rerun_counter>
<ctmem:average_runtime>000000</ctmem:average_runtime>
<ctmem:start_time> </ctmem:start_time>
<ctmem:end_time> </ctmem:end_time>
<ctmem:critical>0</ctmem:critical>
<ctmem:cyclic>False</ctmem:cyclic>
<ctmem:emergency>False</ctmem:emergency>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:job_data>
<ctmem:control_m>ctm630</ctmem:control_m>
<ctmem:order_id>0023d</ctmem:order_id>
<ctmem:rba>00023d</ctmem:rba>
<ctmem:folder_rba>000000</ctmem:folder_rba>
<ctmem:application>apiWinApp2</ctmem:application>
<ctmem:application_type>
</ctmem:application_type>
<ctmem:sub_application>apiGroup2</ctmem:sub_application>
<ctmem:job_name>apitest2</ctmem:job_name>
<ctmem:mem_name>apiMemName2</ctmem:mem_name>
<ctmem:mem_lib>d:<OWNER>controlm</ctmem:mem_lib>
<ctmem:order_folder>apitest</ctmem:order_folder>
<ctmem:owner> </ctmem:owner>
<ctmem:description> </ctmem:description>
<ctmem:task_type>Job </ctmem:task_type>
<ctmem:time_zone> </ctmem:time_zone>
<ctmem:in_BIM_service>0 </ctmem:in_BIM_service>
<ctmem:job_status>Wait Resource </ctmem:job_status>
<ctmem:job_state> </ctmem:job_state>
177
Control-M Workload Automation Control-M/EM API Guide
<ctmem:state_digits>020000004000</ctmem:state_digits>
<ctmem:odate>060625</ctmem:odate>
<ctmem:otime>20060625113440</ctmem:otime>
<ctmem:next_time> </ctmem:next_time>
<ctmem:rerun_counter>00000</ctmem:rerun_counter>
<ctmem:average_runtime>000000</ctmem:average_runtime>
<ctmem:start_time> </ctmem:start_time>
<ctmem:end_time> </ctmem:end_time>
<ctmem:critical>0</ctmem:critical>
<ctmem:cyclic>False</ctmem:cyclic>
<ctmem:emergency>False</ctmem:emergency>
</ctmem:job_data>
</ctmem:job>
<ctmem:job>
<ctmem:job_data>
<ctmem:control_m>ctm630</ctmem:control_m>
<ctmem:order_id>0023c</ctmem:order_id>
<ctmem:rba>00023c</ctmem:rba>
<ctmem:folder_rba>000000</ctmem:folder_rba>
<ctmem:application>apiWinApp1</ctmem:application>
<ctmem:application_type> </ctmem:application_type>
<ctmem:sub_application>apiGroup1
</ctmem:sub_application>
<ctmem:job_name>apitest1</ctmem:job_name>
<ctmem:mem_name>apiMemName1</ctmem:mem_name>
<ctmem:mem_lib> </ctmem:mem_lib>
<ctmem:order_folder>apitest</ctmem:order_folder>
<ctmem:run_as>controlm</ctmem:run_as>
<ctmem:description> </ctmem:description>
<ctmem:task_type>Dummy </ctmem:task_type>
<ctmem:time_zone> </ctmem:time_zone>
<ctmem:in_BIM_service>0</ctmem:in_BIM_service>
<ctmem:job_status>Ended OK</ctmem:job_status>
<ctmem:job_state>Run (2)</ctmem:job_state>
178
Control-M Workload Automation Control-M/EM API Guide
<ctmem:state_digits>000030000000</ctmem:state_digits>
<ctmem:odate>060625</ctmem:odate>
<ctmem:otime>20060625113439</ctmem:otime>
<ctmem:next_time> </ctmem:next_time>
<ctmem:rerun_counter>00001</ctmem:rerun_counter>
<ctmem:average_runtime>000000</ctmem:average_runtime>
<ctmem:start_time>20060625113441</ctmem:start_time>
<ctmem:end_time>20060625113441</ctmem:end_time>
<ctmem:critical>0</ctmem:critical>
<ctmem:cyclic>False</ctmem:cyclic>
<ctmem:emergency>False</ctmem:emergency>
</ctmem:job_data>
</ctmem:job>
</ctmem:jobs>
</ctmem:response_act_retrieve_jobs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
179
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
alert_id The ID number of the alert. String. For more information on monitoring
and handling alerts, see Monitoring.
For an example of a request, see request_change_alert_status XML parameters example (on page 180).
180
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
For an example of a response, see Response_change_alert_status example (on page 182) and
Response_change_alert_status example (on page 182).
error codes: See Alerts request errors (Major code 408) (on page 209).
NOTE: XML parameters for the fault_change_alert_status, as well as a sample fault response are
described in Fault Response (on page 187).
response_change_alert_status example
The following example describes a failure response to change alert status:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Error response from EM Server</faultstring>
<detail>
<ctmem:fault_change_alert_status
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:error_list ctmem:highest_severity="Error">
<ctmem:error ctmem:major="408" ctmem:minor="1"
ctmem:severity="Error">
<ctmem:error_message>
Alert id is not valid.
</ctmem:error_message>
</ctmem:error>
</ctmem:error_list>
</ctmem:fault_change_alert_status>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
181
Control-M Workload Automation Control-M/EM API Guide
</SOAP-ENV:Envelope>
Response_change_alert_status example
The following example describes a successful response to change alert status:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:response_change_alert_status
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:status>OK</ctmem:status>
</ctmem:response_change_alert_status>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
user_token Serial identification number supplied to the user during registration. String.
For an example of a request, see request_bim_services_info XML example (on page 182).
182
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:request_bim_services_info
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:user_token>12345630</ctmem:user_token>
</ctmem:request_bim_services_info>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Parameter Description
services Information regarding the BIM service. See bim_services XML parameters (on
page 184)
For an example of a response, see response_bim_services_info XML parameters example (on page 184).
NOTE: XML parameters for the get_bim_services_info parameter, as well as a sample fault response are
described in Fault Response (on page 187).
183
Control-M Workload Automation Control-M/EM API Guide
Parameter Description
time_zone Indicates the time zone according to which the job should be scheduled. When
the value of this parameter is not zero, all dates reported use this time zone.
min_slack_time In case of a failure, this field indicates how long before the service is late.
184
Control-M Workload Automation Control-M/EM API Guide
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ctmem:response_bim_services_info
xmlns:ctmem="http://www.bmc.com/ctmem/schema800">
<ctmem:status>OK</ctmem:status>
<ctmem:services>
<ctmem:service>
<ctmem:odate>12:26:07 01/12/2006</ctmem:odate>
<ctmem:service_name>Bim Service</ctmem:service_name>
<ctmem:status>Service completed</ctmem:status>
<ctmem:due_time>12:29:07 01/12/2006</ctmem:due_time>
<ctmem:min_end_time>12:26:07
01/12/2006</ctmem:min_end_time>
<ctmem:description/>
<ctmem:num_jobs>3</ctmem:num_jobs>
<ctmem:complete_percentage>100</ctmem:complete_percentage>
<ctmem:jobs_completed>3</ctmem:jobs_completed>
<ctmem:jobs_without_stats>2</ctmem:jobs_without_stats>
<ctmem:time_zone> GMT +2</ctmem:time_zone>
<ctmem:data_center>palace620</ctmem:data_center>
<ctmem:priority>5</ctmem:priority>
<ctmem:min_slack_time>0</ctmem:min_slack_time>
<ctmem:status_color>Service in process or
completed</ctmem:status_color>
</ctmem:service>
<ctmem:service>
<ctmem:odate>12:22:00 01/12/2006</ctmem:odate>
<ctmem:service_name>Bim Service</ctmem:service_name>
<ctmem:status>Service is late</ctmem:status>
<ctmem:due_time>12:25:00 01/12/2006</ctmem:due_time>
<ctmem:min_end_time>13:52:08
01/12/2006</ctmem:min_end_time>
<ctmem:description>Job "Service4" should have started by
12:25:00 GMT+02:00 and will not start on time. The
reason
185
Control-M Workload Automation Control-M/EM API Guide
<ctmem:complete_percentage>33</ctmem:complete_percentage>
<ctmem:jobs_completed>1</ctmem:jobs_completed>
<ctmem:jobs_without_stats>2</ctmem:jobs_without_stats>
<ctmem:time_zone> GMT +2</ctmem:time_zone>
<ctmem:data_center>palace620</ctmem:data_center>
<ctmem:priority>5</ctmem:priority>
<ctmem:min_slack_time>0</ctmem:min_slack_time>
<ctmem:status_color>Service delay or will not
complete</ctmem:status_color>
</ctmem:service>
</ctmem:services>
</ctmem:response_bim_services_info>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode> </faultcode>
<faultstring>. </faultstring>
<detail>
. . . FAULT_RESPONSE_OF_THE_REQUEST . . .
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The fault parameters for all requests are described in Fault Response (on page 187).
186
Control-M Workload Automation Control-M/EM API Guide
Fault Response
The following table describes the parameters for fault XML parameters of all requests:
Parameter Description
For an example of a fault response, see Fault Example (on page 187).
Fault Example
<?xml version="1.0" encoding="iso-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Error response from EM
Server.</faultstring>
<detail>
<ctmem:fault_def_create_jobs
xmlns:ctmem="http://www.bmc.com/ctmem/schema700">
<ctmem:error_list
ctmem:highest_severity='Error' >
<ctmem:error ctmem:major='412'
ctmem:minor='1' ctmem:severity='Error' >
<ctmem:error_message>
Create jobs definitions failed,
inavlid params.
187
Control-M Workload Automation Control-M/EM API Guide
</ctmem:error_message>
</ctmem:error>
<ctmem:error ctmem:major='412'
ctmem:minor='14' ctmem:severity='Error' >
<ctmem:error_message>
Create jobs definitions validation
error: 'Field: AuthorError: The
field must have a
value'.
</ctmem:error_message>
</ctmem:error>
</ctmem:error_list>
</ctmem:fault_def_create_jobs>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
188
8
8
Diagnostics and troubleshooting
This topic helps you to analyze the Control-M/EM API products performance and prevent conflicts before
they arise. The following topics describe logging, configuration troubleshooting and application runtime
and communication problems:
Control-M/EM API logging (on page 189)
Environment configuration troubleshooting (on page 191)
Application runtime and communication troubleshooting (on page 193)
189
Control-M Workload Automation Control-M/EM API Guide
If you are modifying logging behavior, you need to indicate the priority of messages (on page 190)
recorded in the log in your configuration file.
Level Description
190
Control-M Workload Automation Control-M/EM API Guide
Code Description
append=true indicates that new information is added to the end of the log file
maxBackupIndex=2 indicates the number of backups made (that is, the number of
old log files saved)
191
Control-M Workload Automation Control-M/EM API Guide
fullPath/emapi-800/classes/log4j-1.2.8.jar
fullPath/emapi-800/classes/emapi.jar
fullPath/emapi-800/classes/jbcl.jar
fullPath/emapi-800/classes/jacorb.jar
fullPath/emapi-800/classes/concurrent-1.3.2.jar
fullPath/emapi-800/classes/logkit-1.2.jar
fullPath/emapi-800/classes/commons-codec-1.3.jar
fullPath/emapi-800/classes/avalon-framework-4.1.5.jar
fullPath/emapi-800/classes/antlr-2.7.2.jar
fullPath/emapi-800/classes/xercesImpl.jar
fullPath/emapi-800/classes/xml-apis.jar
fullPath/emapi-800/etc
fullPath/emapi-800/etc/jacorb.properties
192
Control-M Workload Automation Control-M/EM API Guide
Save the file with the name orb.properties in one of the following directories:
If you are using JDK, use JDK_HOME/jre/lib
If you are using JRE, use JRE_HOME/lib
Call the init method by using the properties illustrated in the following code example (assuming that
args is your application command-line arguments).
Properties props = new Properties();
props.setProperty("org.omg.CORBA.ORBClass",
"org.jacorb.orb.ORB");
props.setProperty("org.omg.CORBA.ORBSingletonClass",
"org.jacorb.orb.ORBSingleton");
EMXMLInvoker.init(args, props);
Alternatively, call the init method without any parameters.
193
Control-M Workload Automation Control-M/EM API Guide
The Control-M/EM API cannot communicate with the CORBA Naming Service because either the
CORBA services are down or the Naming Service host name and port settings in the
jacorb.properties file are incorrect. You can find the corbaloc reference by searching for the
following string: ORBInitRef.NameService. Ensure that the following requirements are met to
solve the problem:
o The CORBA Naming Service is running (started) on the CORBA Server host computer.
o The Naming Service host name and port settings in the jacorb.properties file point to the
computer that hosts the CORBA Server that you are using.
Communication cannot be established with the Control-M/EM GUI Server because either the host
names of the GUI Server are incorrect in the ctmemapi.properties file or host names of the GUI
Server were specified with incorrect values in the code. Ensure that the following requirements are
met to solve the problem:
o The Control-M/EM GUI Server is running.
o The host names and ports of the Control-M/EM GUI server components are registered
correctly in the CORBA Naming Service.
o If you are using more than one CORBA Server, you are currently using the CORBA Server that
serves the Control-M/EM GUI Server to which you are sending Control-M/EM API requests
apostrophe '
194
Control-M Workload Automation Control-M/EM API Guide
195
Control-M Workload Automation Control-M/EM API Guide
196
9
9
Error codes and exceptions
The following topics describe the errors and exceptions, which may occur when the Control-M/EM API is
being used. Errors and exceptions can be divided into the following groups:
Errors and exceptions that are caused by Control-M/EM API
Errors and exceptions that are caused by faulty formatting in the XML request file
Errors and exceptions that are caused by the presence of incorrect data in the XML request file
Errors and exceptions that are caused by Control-M/EM or the Control-M installation
NOTE: Control-M/EM API errors are also listed in the EMAPIMessages.txt file located in the home
directory of the Control-M/EM installation.
Each error is composed of the following information:
Major code
Integer that represents a family of related errors or exceptions.
Minor code
ID code unique to each error.
Severity (on page 197)
Indicates how critical the error is. Severity also determines the way that the Control-M/EM API
handles the error.
Description
Text description of the error, returned as a string when an exception is thrown.
Severity
Every error that the Control-M/EM API displays has a severity level. This level indicates the priority of the
error and indicates how much information is written to the log file.
When using the Control-M/EM API, the most common severity level is ERROR. Using the default logging
configuration, the DEBUG error is never used. For information on how to modify the logging
configuration, see Control-M/EM API logging (on page 189).
197
Control-M Workload Automation Control-M/EM API Guide
The severity levels that are supported by the Control-M/EM API are listed in the following table:
Level Description
198
Control-M Workload Automation Control-M/EM API Guide
000 NULL Exception NULL exception errors (Major code 000) (on page 200)
100 Low-level API Exceptions Low-level API exceptions (Major code 100) (on page 200)
200 Parser Exceptions Parser exceptions (Major code 200) (on page 201)
300 Control-M Server Errors: Group1 Control-M/Server errors: Group 1 (Major code 300) (on page
201)
301 Control-M Server Errors: Group 2 Control-M/Server errors: Group 2 (Major code 301) (on page
204)
302 Control-M Server Errors: Group 3 Control-M/Server errors: Group 3 (Major code 302) (on page
206)
401 Generic Request Exceptions Generic request exceptions (Major code 401) (on page 206)
403 Poll Request Poll request errors (Major code 403) (on page 206)
404 Add/Delete Condition Request Add or Delete Condition request errors (Major code 404) (on
page 207)
405 Order/Force Request Order or Force request errors (Major code 405) (on page
207)
406 Job Tracking Request Job tracking request errors (Major code 406) (on page 208)
407 Authorization Request Authorization request errors (Major code 407) (on page
208)
408 Alerts Request Alerts request errors (Major code 408) (on page 209)
409 Create Active Job Request Create active job request errors (Major code 409) (on page
209)
411 Upload folders Upload folder request errors (Major code 411) (on page
210)
412 Create jobs or SMART Folder Create job/SMART Folder definitions request errors (Major
definitions code 412) (on page 211)
199
Control-M Workload Automation Control-M/EM API Guide
413 Delete job definitions Delete job definitions request errors (Major code 413) (on
page 211)
440 Retrieve active jobs Retrieve active jobs request errors (Major code 440) (on
page 212)
450 Active job actions Job actions request errors (Major code 450) (on page 212)
500 Control-M/EM API Java Client Control-M/EM API Java client errors (Major code 500) (on
page 213)
600 Gateway Messages Gateway messages (Major code 600) (on page 215)
Minor
code Severity Description
200
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
Minor
code Severity Description
201
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
52 ERROR Cannot add the condition because the condition file is full
202
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
54 ERROR Cannot add the control resource because the resource file is full
57 ERROR Cannot add the quantitative resource because the resource file is full
59 ERROR Cannot delete the quantitative resource because it does not exist
70 ERROR The requested job does not exist in the given folder
95 ERROR The folder entity specified was not found in Active Jobs database
203
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
101 ERROR The filed Sub Application is mandatory for a group entity
102 ERROR SUB APPLICATION and JOBNAME should be the same for group entity
103 ERROR SUB APPLICATION and SCHEDTAB should be the same for group entity
105 ERROR The Sub Application specified does not exist in the database
110 ERROR Failed to setup application type for HOSTGRP, FILE_NAME and Override Path
should not be specified
204
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
534 ERROR Cannot open Active Jobs database is corrupted, I/O error, or file is not really
Active Jobs
535 ERROR Cannot order a job while Active Jobs database is being formatted
537 ERROR The job order contains more information than what Control-M/EM can handle
548 ERROR The calendar specified in the job is either corrupted or invalid
205
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
166 ERROR The job contains a condition with a PREV/NEXT date that cannot be interpreted
by Control-M/EM
169 INFO Control-M/EM has finished handling the request. No jobs were scheduled
Minor
code Severity Description
540 ERROR Security exit not loaded and security checking is bypassed
Minor
code Severity Description
206
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
Minor
code Severity Description
207
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
Minor
code Severity Description
208
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
Minor
code Severity Description
209
Control-M Workload Automation Control-M/EM API Guide
The following table describes the Create active job request errors:
Minor
code Severity Description
Minor
code Severity Description
210
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
10 ERROR Create definitions, API is not supported for CTM version '%s'
13 ERROR Sub application name of a job or a SMART Folder differs from a SMART Folder
or folder
211
Control-M Workload Automation Control-M/EM API Guide
The following table describes the Delete job definitions request errors:
Minor
code Severity Description
6 ERROR Delete jobs definitions validation error: [<filter name>] is not valid filter field
Minor
code Severity Description
6 ERROR Retrieve active jobs validation error: '%s' is not valid filter field
212
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
361 ERROR The selected job/folder cannot be deleted due to its current state
213
Control-M Workload Automation Control-M/EM API Guide
The following table describes the Control-M/EM API Java client errors:
Minor
code Severity Description
3 ERROR Failed to establish connection with server - no server registered under this
hostname
5 ERROR Failed to establish connection with server - not a valid component type, check
your hostname
7 ERROR Failed to establish connection with server - check your connection with the
CORBA Naming Service
112 ERROR Response format is not valid, cannot find rule based calendar
214
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
4 ERROR Net too large to be fully viewed. Some nodes are missing
215
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
24 ERROR Field Rerun Mem Cannot be used if field Task Type is Cyclic
31 ERROR Do you really want to erase the entire value Net value
32 ERROR Do you really want to clear the entire value Net value
216
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
55 ERROR If field value (Days/Week days Calendar) begins with ALL then the rest of the
parameter must be blank
56 ERROR Field Days Calender is required if field value contains the value: value
57 ERROR Field Week Calender is required if field value contains the value: value
58 ERROR Field Days has an invalid value starting at position: value; There should be a
comma there
66 ERROR Unknown platform. Verification of data defaults to MVS. Do you want to continue?
217
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
68 ERROR Calendar value was downloaded successfully from data center value
69 ERROR Calendar value was deleted successfully from data center value
73 ERROR Forced Calendar Upload overrides calendar content in data center Proceed?
74 ERROR You are not authorized to access the Calendar List window
75 ERROR Filed value must be specified if field value is File, New Dest or Change Class
77 ERROR Field value may only be used with the Change Class option
79 ERROR Field Sign may not be + if the ODATE field value is **** or $$$$
82 ERROR Field Command Line may be specified only if Task Type is Command
86 ERROR Fields Parm and From Class must be specified if field Option is Change Class
87 ERROR Field Parm must be specified if field Option is New Dest or File
88 ERROR Field Confirmation Cal cannot be used with fields PDS Name or Minimum
89 ERROR Field Months cannot be used with fields PDS Name, Minimum or Dates
218
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
90 ERROR Field Dates cannot be used with parameters PDS Name, Minimum, Months, Days,
or Days Calendar
91 ERROR Field Dates cannot be used with fields Week Days, Weeks Days Calender
Confirmation Cal
92 ERROR If field PDS Name is specified then Minimum must be specified and vice versa
96 ERROR A job with the same name already exists in this folder
97 ERROR If field Retro is specified then PDS Name and Minimum cannot be used
98 ERROR The fields Days and Week Days Calendar cannot both be specified
100 ERROR Fields Rerun Mem and Max Rerun cannot be used if field Task Type is Cyclic
106 ERROR If field value is *???????, then field value must be blank
110 ERROR Definition folder value was downloaded successfully from data center value
111 ERROR Definition folder value was deleted successfully from data center value
219
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
114 ERROR Forced Folder Upload overrides folder content in data center Proceed?
115 ERROR You are not authorized to access the Folders window
117 ERROR Field value must be blank if field value is OK or NOTOK or RERUN
118 ERROR Communication with WS-Gateway stopped, all requests were canceled
123 ERROR value not possible, data center value not available
124 ERROR Communication with data center value down, all requests canceled
125 ERROR Data center value is suspended (Active jobs is being formatted)
127 ERROR Data center value is suspended (Active jobs is being formatted), all requests
canceled
128 ERROR Invalid event %c received from data center value. To ensure database integrity,
WS-GTW stop/restart is recommended
129 ERROR The host name be specified only for the TCP protocol
130 ERROR The host name may contain only Alphanumeric characters and periods
220
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
134 ERROR The Net Group field must contain two alpha numeric characters
138 ERROR Please verify that all users have quit Control-M/EM and that the WS-Gateway is
down.
146 ERROR Job Report fields saved. Please close and open the job report window
221
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
157 ERROR Alarm handling command ignored. User value is handling this alarm now
160 ERROR Download of calendar value canceled in gateway - Another download is currently in
progress - Try later
164 ERROR Upload of definitions folder value canceled in gateway - folder in use
165 ERROR Download of definition folder value canceled in gateway - folder in use
166 ERROR Download of definition folder value canceled in gateway - Another download is
currently in progress - Try later
167 ERROR Definitions folder deleted on data center but delete failed on workstation (rc 1)
168 ERROR Definitions folder deleted on data center but delete failed on workstation (rc 2)
169 ERROR Calendar deleted on data center but delete failed on workstation (rc 2)
170 ERROR Delete of definitions folder value canceled in gateway - folder in use
172 ERROR User request canceled in gateway, no answer from data center (time-out)
173 ERROR Download of value canceled, no answer from data center (time-out)
176 ERROR Upload canceled (file transfer error (rcp) in gateway), consult system administrator
222
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
177 ERROR Information request canceled in gateway, system error (fopen failed), consult
system administrator
178 ERROR Information request canceled (time-out) in gateway, no answer from data center
179 ERROR Upload of value canceled (time-out), no answer from data center
187 ERROR value was not found in data center. Delete in workstation?
188 ERROR You are not authorized to access the Global Conditions window
192 ERROR Insert failed. Record with same key already exists
194 ERROR Error message value Received from data center value
223
Control-M Workload Automation Control-M/EM API Guide
Minor
code Severity Description
197 ERROR Field value may not contain the characters value
200 ERROR Field value must be blank if field When is OK or NOTOK or RERUN
203 ERROR Unsupported version value of data center value. Check Control-M installation
224