CtmJob Class

The following table describes the CtmJob API class that defines and retrieves Control-M job attributes for jobs that you create through Control-M Self-Conversion.

Method

Description

getJobInputXmlData():CtmXmlElement

Returns CtmXmlElement Class, which contains the XML element that was used during creation of the Job.

To create a Control-M job from XML elements, the Control-M Self-Conversion engine builds a map between the job instance and the specific XML element in the input data. Job XML elements usually contain additional job data within XML element attributes or XML sub-elements (such as Job Name or Job Command). The job XML element can be used as input data for other rules (such as Create Job Name or Job Command).

For an example, see Creating a Job.

setOSType()

Sets the job type to Control-M OS job. To add attributes for this type of job, use OsParametersAPI.

For an example, see Setting OS job type.

setDatabasesType()

Sets the job type to Control-M Databases job. To add attributes for this type of job, use DatabasesParametersAPI.

setFileTransferType()

Sets the job type to Control-M File Transfer job. To define attributes for this type of job, use FileTransferParametersAPI.

setInformaticaType()

Sets the job type to Control-M Informatica job. To define attributes for this type of job, use InformaticaParametersAPI.

setSapR3Type()

Sets the job type to Control-M SAPR3 job. To define attributes for this type of job, use SapR3ParametersAPI.

For an example, see Setting SAPR3 Job Type.

setSapBWType()

Sets the job type to Control-M SAP Business Warehouse job. To define attributes for this job use SapBWParametersAPI.

general():General API

Returns General API, which enables you to define general settings for the job, such as Job Name.

scheduling():SchedulingAPI

Returns SchedulingAPI, which enables you to define job scheduling settings, such as From Time.

prerequisites():PrerequisitesAPI

Returns PrerequisitesAPI, which enables you to define job prerequisites, such as an In Event.

actions():ActionsAPI

Returns ActionsAPI, which enables you to define job actions, such as an Out Event.

getParentFolder():CtmFolder Class

Returns the parent folder of the job.

General API

The following table describes the General API sub-class that defines general settings for jobs.

Method

Description

setName(String jobname)

Sets the Control-M Job Name.

For an example, see Setting a Name for a Job.

getName():String

Returns the Control-M Job Name.

setDescription(String description)

Sets the Control-M Job Description.

getDescription():String

Returns the Control-M Job Description.

setApplication(String application)

Sets the Control-M Job Application. For an example, see Setting a Job Application.

getApplication():String

Returns the Control-M Job Application.

setSubApplication(String subApplication)

Sets the Control-M Job Sub Application.

getSubApplication():String

Returns the Control-M Job Sub Application.

osParameters():OsParametersAPI

Returns OsParametersAPI, which enables you to define attributes for Control-M OS jobs.

databasesParameters():DatabasesParametersAPI

Returns DatabasesParametersAPI, which enables you to define attributes for Control-M Databases jobs.

fileTransferParameters():FileTransferParametersAPI

Returns FileTransferParametersAPI, which enables you to define attributes for Control-M File Transfer jobs.

informaticaParameters():InformaticaParametersAPI

Returns InformaticaParametersAPI, which enables you to define attributes for Control-M Informatica jobs.

sapR3Parameters():SapR3ParametersAPI

Returns SapR3ParametersAPI, which enables you to define attributes for Control-M SAPR3 jobs.

sapBWParameters():SapBWParametersAPI

Returns SapBWParametersAPI, which enables you to define attributes for Control-M SAP Business Warehouse jobs.

getHost():String

Returns the Control-M host of the job.

setHost(String hostName)

Sets the Control-M host of the job.

addLocalVariable(String name, String value)

Adds a local variable to the job.

addSMARTFolderVariable(String name, String value)

Adds a SMART folder variable to the job.

addNamedPoolVariable(String name, String value)

Adds a named pool variable to the job.

removeLocalVariable(String name)

Removes a local variable from the job.

removeSMARTFolderVariable(String name)

Remove a SMART folder variable from the job.

removeNamedPoolVariable(String name, String value)

Removes a named pool variable from the job.

getLocalVariableValue(String name)

Returns the value of a local variable in the job.

getSMARTFolderVariableValue(String name)

Returns the value of a SMART folder variable in the job.

getNamedPoolVariableValue(String poolName, String VariableName)

Returns the value of a named pool variable in the job.

hasLocalVariable(String name)

Checks whether job settings contain a specific local variable.

hasSMARTFolderVariable(String name)

Checks whether job settings contain a specific SMART folder variable.

hasNamedPoolVariable(String poolName, String variableName)

Checks whether job settings contain a specific named pool variable.

enableRunAsDummy()

Sets the job to run as a dummy job.

disableRunAsDummy()

Discontinues running the job as a dummy job.

OsParametersAPI

The following table describes the OsParametersAPI sub-class that defines attributes for Control-M OS jobs.

Method

Description

setEmbeddedScript(String script)

Sets sOS job embedded Script.

setScriptFileName(String scriptFileName)

Sets a script filename for the job.

setScriptFilePath(String scriptFilePath)

Sets the script file path for the job.

setCommand(String command)

Sets a command for the job.

For an example, see Setting OS Job Command Line.

getRunAs()

Returns the name of the Run As user specified for the job.

setRunAs(String runAs)

Sets a Run As user for the job.

 getPostCommand()

Returns the Post command specified for the job.

setPostCommand(String postCommand)

Sets a Post command to run when the job finishes executing.

getPreCommand()

Returns the Pre command specified for the job.

setPreCommand(String preCommand)

Sets a Pre command to run before the job starts executing.

DatabasesParametersAPI

The following table describes the DatabasesParametersAPI sub-class that defines attributes for Control-M Databases jobs.

Method

Description

setExecutionType(DatabasesExecutionType executionType)

Sets a database's execution type, based on the DatabasesExecutionType enum.

DatabasesExecutionType can have the following values:

  • MSSQLAgentJob

  • StoredProcedure

  • SqlScript

  • EmbeddedQuery

  • SSISPackage

Currently, only MSSQL Agent Job is supported

getExecutionType()

Gets an Databases execution type as set previously.

The returned value is based on the DatabasesExecutionType enum.

DatabasesExecutionType can have the following values:

  • MSSQLAgentJob

  • StoredProcedure

  • SqlScript

  • EmbeddedQuery

  • SSISPackage

setConnectionProfile(String connectionProfile)

Sets an connection profile name for the job.

getConnectionProfile()

Gets the Databases job connection profile name.

setMSSQLAgentJobName(String jobName)

Sets an MSSQL Agent Job name.

getMSSQLAgentJobName()

Gets the MSSQL Agent Job name.

FileTransferParametersAPI

The following table describes the FileTransferParametersAPI sub-class that defines attributes for File Transfer jobs.

Method

Description

addNewTransfer():CtmTransferAPI

Returns CtmTransferAPI, which enables you to define attributes for the file transfer.

getCtmTransfer(Int numberOfTransfer)

Returns a transfer from the job according to its number.

setConnectionProfile(String connectionProfileName)

Sets the name of a File Transfer connection profile.

Enable the File Transfer job to rerun file transfers from point of failure.

Enables the File Transfer job to rerun file transfers from point of failure.

CtmTransferAPI

The following table describes the CtmTransferAPI sub-class that defines CTM file transfer jobs.

Method

Description

setLeftPath(String path)

Sets the left-side path of the transfer.

setRightPath(String path)

Sets the right-side path of the transfer.

setTransferOption(TransferOption transferOption)

Sets a transfer option, one of the following options:

  • Transfer_from_left_to_right

  • Transfer_from_right_to_left

  • Filewatch_And_Transfer_from_left_to_right

  • Filewatch_And_Transfer_from_right_to_left

  • Filewatch_Only

setTransferType(TransferType type)

Sets the transfer type, one of the following types:

  • Binary

  • ASCII

  • EBCDIC

InformaticaParametersAPI

The following table describes the InformaticaParametersAPI sub-class that defines File Informatica jobs.

Method

Description

setConnectionProfile(String connectionProfile)

Sets Informatica connection profile name.

setInstanceName(String instanceName)

Sets instance name value.

setRepositoryFolder(String repositoryFolder)

Sets Repository folder value.

setRunSingleTask(String task)

Enables option for running a single task that you specify.

setRunWholeWorkflow()

Enables option for running a whole workflow.

setStartFromTask(String task)

Enables option for starting from a specified task.

setWorkflow(String workflow)

Sets workflow value.

setOsProfile(String osProfile)

Sets OS Profile value.

setWorkflowParametersFile(String parameterFile)

Sets Workflow parameters file value.

setDepth(String depth)

Sets Depth value.

FileWatcherParametersAPI

The following table describes the FileWatcherParametersAPI sub-class that defines FileWatcher jobs.

Method

Description

setPath(String path)

Sets Path value.

setMode(FileWatcherMode mode)

Sets Mode, one of the following modes:

  • CREATE

  • DELETE

setMinimumSize(String size, FileWatcherSizeIn units)

Sets Minimum size value. One of the following units:

  • BYTES

  • KB

  • MB

  • GB

setSearchInterval(String seconds)

Sets Search interval value.

setFileSizeInterval(String seconds)

Sets File size interval value.

setIterations(String iterations)

Sets Iterations value.

setTimeLimit(String minutes)

Sets Time limit value.

setEnableWildcardSupport()

Enables wildcard support.

setDisableWildcardSupport()

Disables wildcard support.

setTimeFrameStart(String value)

Sets Time frame start value.

setTimeFrameStop(String value)

Sets Time frame stop value.

setMinimalAge(String value)

Sets Minimal age value.

setMaximalAge(String value)

Sets Maximal age value.

SapR3ParametersAPI

The following table describes the SapR3ParametersAPI sub-class that defines SAPR3 jobs.

Method

Description

addAbapStep():SapR3AbapStepAPI

Returns SapR3AbapStepAPI, which enables you to define attributes for an SAP R3 ABAP step.

setAction(SapR3Action)

Sets an SAP R3 job action, based on the SapR3Action enum. SapR3Action can have the following values:

  • CreateANewJob

  • CopyAnExistingJob

  • RunAPreDefinedSapJob

  • MonitorAScheduledSapJob

  • RunBatchInputSessions

setSAPJobName(String)

Sets the SAP job name.

For example, see Setting SAPR3 Job Name.

setConnectionProfile(String)

Sets the SAP R3 connection profile name.

setCopyJobCount(String)

Sets the job count of a copied SAP job (that is, a job created using the CopyAnExistingJob option).

setCopyNewJobName(String)

Sets the job name for a new copied SAP job (that is, a job created using the CopyAnExistingJob option).

setEventID(String)

Sets an event ID for the SAP job.

setExececutionTarget(SapR3ExecTarget execTargetType, String execTargetName)

Sets the Execution Target server, based on the SapR3ExecTarget enum.

SapR3ExecTarget can have the following values:

  • Server

  • Group

setJobClass(SapR3JobClass)

Sets the Job Class of the SAP job, based on the SapR3JobClass enum.

SapR3JobClass can have of the following values:

  • LowPriority

  • MediumPriority

  • HighPriority

setProfileID(String)

Sets the Profile ID of the SAP job.

SapR3AbapStepAPI

The following table describes the SapR3AbapStepAPI sub-class that defines a SAP R3 ABAP step.

Method

Description

setAbapProgramName(String abapProgramName)

Sets the SAP R3 ABAP Step program name.

getAbapProgramName()

Returns the SAP R3 ABAP Step program name.

setVariantName(String variantName)

Sets the SAP R3 ABAP Step variant name.

getVariantName()

Returns the SAP R3 ABAP Step variant name.

setTemporaryVariant()

Sets the SAP R3 ABAP Step variant to be temporary.

setNumberOfCopies(String numberOfCopies)

Sets the SAP R3 ABAP Step number of copies.

getNumberOfCopies()

Returns the SAP R3 ABAP Step number of copies.

setPrintExpiration(String printExpiration)

Sets the SAP R3 ABAP Step print expiration.

getPrintExpiration()

Returns the SAP R3 ABAP Step print expiration.

setSapCoverPage(SapCoverPage sapCoverPage)

Sets the SAP Cover Page based on the SapCoverPage enum.

SapCoverPage has the following types:

  • DefaultSetting

  • Print

  • DoNotPrint

getSapCoverPage()

Returns the SAP R3 ABAP Step SAP cover page.

setOsCoverSheet(OsCoverSheet osCoverSheet)

Sets the OS Cover sheet based on the SapOsCoverSheet enum.

OsCoverSheet has the following types:

  • DefaultSetting

  • Print

  • DoNotPrint

getOsCoverSheet()

Returns the SAP R3 ABAP Step OS cover sheet.

setTimeOfPrint(TimeOfPrint timeOfPrint)

Sets the Time of Print based on the TimeOfPrint enum.

TimeOfPrint has the following types:

  • PrintOutImmediately

  • PrintLater

  • SendToSapSpooler

getTimeOfPrint()

Returns the SAP R3 ABAP Step time of print.

setOutputFormatRows(String outPutFormatRows)

Sets the SAP R3 ABAP Step output format rows number.

getOutputFormatRows()

Returns the SAP R3 ABAP Step output format rows number.

setOutputFormatColumns(String outPutFormatColumns)

Sets the SAP R3 ABAP Step output format columns number.

getOutputFormatColumns()

Returns the SAP R3 ABAP Step output format columns number.

setPrintArchiveMode(PrintArchiveMode printArchiveMode)

Sets the Print Archive Mode based on the PrintArchiveMode enum.

PrintArchiveMode has the following types:

  • Print

  • Archive

  • PrintAndArchive

getPrintArchiveMode()

Returns the SAP R3 ABAP Step print archive mode.

setOutputDevice(String outputDevice)

Sets the SAP R3 ABAP Step output device.

getOutputDevice()

Returns the SAP R3 ABAP Step output device.

setRecipient(String recipient)

Sets the SAP R3 ABAP Step recipient.

getRecipient()

Returns the SAP R3 ABAP Step recipient.

setDepartment(String department)

Sets the SAP R3 ABAP Step department.

getDepartment()

Returns the SAP R3 ABAP Step department.

setSpoolRequestName(String spoolRequestName)

Sets the SAP R3 ABAP Step spool request name.

getSpoolRequestName()

Returns the SAP R3 ABAP Step spool request name.

setSpoolRequestTitles(String spoolRequestTitles)

setSpoolRequestTitles(String spoolRequestTitles)

getSpoolRequestTitles()

getSpoolRequestTitles()

setSpoolRequestAuthorization(String spoolRequestAuthorization)

Sets the SAP R3 ABAP Step spool request authorization.

getSpoolRequestAuthorization()

Returns the SAP R3 ABAP Step spool request authorization.

setOutputFormatLayout(String outputFormatLayout)

Sets the SAP R3 ABAP Step output format layout.

getOutputFormatLayout()

Returns the SAP R3 ABAP Step output format layout.

setLanguage(String language)

Sets the SAP R3 ABAP Step language.

getLanguage()

Returns the SAP R3 ABAP Step language.

setUser(String user)

Sets the SAP R3 ABAP Step user.

getUser()

Returns the SAP R3 ABAP Step user.

isNewSpoolRequest()

Returns true if a new spool request is enabled and false if disabled.

enableNewSpoolRequest()

Enables SAP R3 ABAP Step new spool request.

disableNewSpoolRequest()

Disables SAP R3 ABAP Step new spool request.

isDeleteAfterPrint()

Returns true if a delete after print is enabled and false if disabled.

enableDeleteAfterPrint()

Enables SAP R3 ABAP Step delete after print.

disableDeleteAfterPrint()

Disables SAP R3 ABAP Step delete after print.

isSelectionCoverPage()

Returns true if a selection cover page is enabled and false if disabled.

enableSelectionCoverPage()

Enables SAP R3 ABAP Step selection cover page.

disableSelectionCoverPage()

Disables SAP R3 ABAP Step selection cover page.

setArchiveId(String archiveId)

Sets the SAP R3 ABAP Step archive ID.

getArchiveId()

Returns the SAP R3 ABAP Step archive ID.

setArchiveDocumentType(String archiveDocumentType)

Sets the SAP R3 ABAP Step archive document type.

getArchiveDocumentType()

Returns the SAP R3 ABAP Step archive document type.

setArchiveInformationField(String archiveInformationField)

Sets the SAP R3 ABAP Step archive information field.

getArchiveInformationField()

Returns the SAP R3 ABAP Step archive information field.

setArchiveText(String archiveText)

Sets the SAP R3 ABAP Step archive text.

getArchiveText()

Returns the SAP R3 ABAP Step archive text.

SapBWParametersAPI

The following table describes the SapBWParametersAPI sub-class that defines SAP Business Warehouse jobs.

Method

Description

setProcessType(SapBWProcessType)

Sets an SAP BW job type, based on the SapBWProcessType enum.

SapBWProcessType can have the following values:

  • ProcessChain

  • InfoPackage

Currently, only Process Chain is supported.

getProcessType ()

Gets an SAP BW job type as set previously. The returned value is based on the SapBWProcessType enum.

SapBWProcessType can have the following values:

  • ProcessChain

  • InfoPackage

setConnectionProfile (String)

Sets the SAP BW connection profile name.

getConnectionProfile ()

Gets the SAP BW job connection profile name.

setID (String)

Sets the SAP BW Process Chain ID.

getID ()

Gets the SAP BW Process Chain ID.

setDescription (String)

Sets the SAP BW Process Chain description.

getDescription ()

Gets the SAP BW Process Chain description.

setReRunOption (SapBWRerunOption)

Sets an SAP BW job rerun option, based on the SapBWRerunOption enum.

SapBWRerunOption can have the following values:

  • RestartFromPointOfFailure (default)

  • RerunFromStart

getReRunOption ()

Gets an SAP BW job rerun option as set previously. The returned value is based on the SapBWRerunOption enum.

SapBWRerunOption can have the following values:

  • RestartFromPointOfFailure

  • RerunFromStart

SchedulingAPI

The following table describes the SchedulingAPI sub-class that defines job scheduling settings.

Method

Description

disableCyclic()

Disables cyclic running of the job.

disableOrderOnMonth(int monthIndexZeroBased)

Removes a specific month from job scheduling.

  • ctmJob.scheduling().disableOrderOnMonth(0) means remove the month of January from job scheduling.

  • ctmJob.scheduling().disableOrderOnMonth(1) means remove the month of February from job scheduling.

enableCyclic()

Enables cyclic running of the job.

enableOrderOnMonth(int)

Adds a specific month to job scheduling.

  • ctmJob.scheduling().enableOrderOnMonth(0) means add the month of January to job scheduling.

  • ctmJob.scheduling().enableOrderOnMonth(1) means add the month of February to job scheduling.

setDays(String days)

Sets days of the month in job scheduling.

To specify multiple days, separate numbers of days with commas.

ctmJob.scheduling().setDays("10,20,25")

setMaxReruns(int maxReruns)

Sets the maximum number of reruns that can be performed for the job.

setOrderOnMonthsAll()

Sets job running to all months of the year.

setOrderOnMonthsNone()

Sets job running by month to None (that is, no scheduling on any month).

setSchedulingTypeEveryDay()

Sets job to be scheduled every day.

setSchedulingTypeNone()

Sets job to not be scheduled on any day.

The job will need to be run manually.

setTimeSettings(String fromTime, String toTime)

Sets time limits for submitting the job.

setTimeSettings("0600","1400") means submit the job only between 06:00 (6 AM) and 14:00 (2 PM).

setWeekDays(String weekdays)

Sets days of week for job scheduling.

Specify days using numbers 0-6, where 0 is the first day of the week (by default, Monday). Separate multiple days with commas.

ctmJob.scheduling().setWeekDays("1,2,4") means that the job will be run on Tuesday, Wednesday, and Friday.

PrerequisitesAPI

The following table describes the PrerequisitesAPI sub-class that defines In Events.

Method

Description

addInCondition(String conditionName, InConditionAndOr relationship, boolean removeCondition)

Adds an In Event for the job.

Use the following input parameters:

  • conditionName

  • relationship, based on the InConditionAndOr enum, with possible values And or Or

  • removeCondition - whether to remove the In Event after job completion, either True or False

ActionsAPI

The following table describes the ActionsAPI sub-class that defines Out Events.

Method

Description

addOutCondition(String conditionName)

Adds a specific Out Event for the job.

addOutCondition(String conditionName, String OrderDate, OutConditionSign sign)

Adds an Out Event for the job, based on values that you specify for the following parameters:

  • conditionName

  • OrderDate

  • sign, based on the OutCondition enum, with possible values Add or Remove