Creating and Editing Job Definitions 
A job definition is a Repository object that defines a process to be executed by the process server. Every job that is submitted is the request of the execution of a single job definition. SAP CPS ships with a number of job definition types, which define the programming language and target platform of the commands to be executed.
A job can raise one or more events when the job gets a specific job status or return code. The events to be raised can be specified in the job definition.
Job definitions can be made dependent upon specific events. These jobs cannot be executed before the events upon which they are dependent are raised. They will remain in Event Wait status until all dependent events are raised.
Parameters enable job definitions to define generic command texts that behave differently, according to the values of the job definition parameters. For these parameters, validation rules can be added by defining simple constraints on the parameters.
Restart behavior is used to break or continue the submit frame when something unexpected happens. When you break the submit frame, the job definition or job chain does not get submitted again according to the submit frame. By default, a Completed job definition or job chain will continue to get submitted according to the submit frame.
Special care needs to be taken when you edit a job definition which is currently being (re)scheduled; the new job definition will take effect on all jobs that have not reached the Dispatched job status at modification time. Please see the Editing Job Definitions Safely section.
Job definitions have the following actions:
Action |
Description |
Submit |
Submit the job definition |
Cancel non-final state jobs |
Cancel jobs that have not reached a final state, see the Job States section for more informaion on job states. |
Delete final state jobs |
Delete jobs that have reached a final state, see the Job States section for more informaion on job states. |
Monitor related jobs |
Jump to the job monitor with a temporary job filter displaying jobs for the job definition |
Reset Statistics |
Reset the runtime statisticsfor the job definition |
Export |
Export the job definition, only customjob definition definitions can be exported |
Edit |
Edit the job definition, only custom job definitions can be edited |
Delete |
Delete the job definition, only custom job definitions can be deleted |
Duplicate |
Duplicate the job definition, only custom and some built-in jobs can be duplicated |
Expand all |
Mainly used for jobs chains, allows you to expand the entire tree of the job chain |
New |
Create a new job definition |
New (from Template) |
Create a new job definition froma template |
Filter > New Filter |
Create a new job definition filter |
Filter > Edit Filter |
Edit an existing job definition filter |
Filter > Delete Filter |
Delete a job definition filter |
Help |
Display the help topic(s) covering job definitions |
Some fields need to be filled, like the Job Definition Name field, which is the only field that does not have a default and that needs to be filled for every job definition type. Other job definition types additionally require other fields be filled. For example, RedwoodScript job definitions need to have the Source field filled with at least the following: {}. Furthermore, the source is not editable with job definitions of certain types, like the SAPR3 job definition type. The keep clause, which by default is set to keep all jobs of the job definition, is also compulsory and needs to be changed if you want the system to automatically delete old jobs.
Note
The source cannot be edited for all job definition types, other job definition types require a specific license key. See the Editing the Job Definition Source section for more information.
You can search for job definitions using filters and the Search Job Definitions box on the Job Definitions tab. This box is known as the intelliSearch box and located under your username on the top right-hand side of the user interface. Filters allow you to specify a list of objects with static criteria. IntelliSearch allows you to specify complex queries in a simple way using prefixes. Prefixes are used to specify which property you are searching in and have short and long syntaxes. For example, if you want to display all job definitions with the term import in the comment, you would use the search criteria as follows:
c:import
You can search more than one property, as follows:
c:import n:System
Note
No spaces should be entered before or after the colon (:).
See the Advanced Object Search for more information.
The following table illustrates the available prefixes for job definitions:
Prefixes |
Description |
n, name |
searches the name property |
c, com, comment |
searches the comment property |
d, desc, description |
searches the description property |
a, app, application |
searches the application property |
You can only delete job definitions when no other objects relate to them. For example, if the job definition is called in a job chain job, the job definition cannot be deleted until all job chain jobs using it have been deleted. You can see all job chain jobs that relate to the job definition in Related Objects in the lower detail pane and on the show page. Furthermore, jobs of a job definition will prevent you from deleting the job definition. Theseare found by selecting Show Related Jobs from the context menu. It is also possible to cancel and delete related jobs from the context menu.
The table in related objects contains three columns:
Type - the type of object, like job for job chain job, Source for the source of the job with a link to it
Related Object - the name of the object with a link to it
Used As - objects can sometimes be used in different roles
Job definitions that are called in job chains will have the call-reference in Related Objects. The type will be Job, and the Related Object will be the name of the job. For example, if it is the first job in a step, it will be Job 1.
The following privileges are available for job definitions:
Privilege |
Description |
JobDefinition.Create |
Create job definitions |
JobDefinition.Delete |
Delete job definitions |
JobDefinition.DeleteJob |
Delete jobs |
JobDefinition.Edit |
Edit job definitions |
JobDefinition.SubmitJob |
Submit jobs |
JobDefinition.View |
Access job definitions |
You can grant privileges on two levels, Access and Admin; a privilege granted on Admin level allows the grantee to grant the privilege to other users. These privileges can be granted system-wide, per partition or isolation group. Note that to be able to schedule a job, the user also needs privileges on the queue and other objects referenced by the job definition.
If you have the security module, which requires the Module.Security license key, you have an additional Security tab on the job definition. It allows you to specify which users can access, edit and delete the job definition.
You can also edit the XML source directly or copy it into your editor of choice. This is especially handy when you want to perform repetitive tasks such as a Search and Replace. You enable the the XML source tab in the user options by enabling the Allow edit as XML option; see Setting User Parameters. Special care needs to be taken when you edit in XML, as you will have to use entities for special signs, such as the less-than (<) sign, which needs to be replaced with &lt;. Please see XML resources on-line for a list of common XML entities.
To create a job definition:
Choose .
Choose New from the context menu.
Fill in the below values.
Choose Save and Close.
Note
Some tabs require a new element to be created, this is done by choosing New.
Topic |
Relevant topic |
Source Tab |
|
Job Definition Tab |
|
Parameters Tab |
|
Parameter validation |
|
Wait Events Tab |
|
Raise Events Tab |
|
Job Locks Tab |
|
Runtime Limits Tab |
|
Restart Behavior Tab |
|
Actions Tab |
|
Security Tab |
The Job Definition Types (see the documentation shipped with SAP CPS for more information on this feature)