Creating and Editing the job-definition.xml

Use

The job-definition.xml is an additional descriptor which identifies the message-driven bean as a JobBean.

Use the procedures below to create a job-definition.xml file for the HelloJob and update its content.

Procedure

Creating a job-definition.xml

  1. In the Project Explorer , right-click the META-INF folder of the HelloJobProject , and then choose Start of the navigation pathNew  Next navigation step OtherEnd of the navigation path.

  2. On the New screen that opens, proceed as follows:

    1. Choose Start of the navigation pathXML Next navigation step XMLEnd of the navigation path, and then choose Next .

    2. Choose Create XML from scratch , and then choose Next .

    3. In the File name field, enter job-definition.xml , and then choose Finish .

Updating the Content of the job-definition.xml

  1. In the Project Explorer , from the META-INF folder of the HelloJobProject open the job-definition.xml file.

  2. On the Source tab page, edit the file as the sample below shows.

    In the job-definition.xml file of the HelloJob, you have to specify the name of the job definition. It has to be the same as the job name specified in the message selector in the JobBean class. For more information, see Developing the JobBean Class of the HelloJob].

    In addition, you have to declare the name, data type, and direction of the job parameters used in the HelloJobBean class.

    With the UserName parameter, which is of type string, you provide specific input for the job when you schedule the job. That is why, it has to be declared as a parameter with direction IN. With the NameLength parameter, which is of type integer, the job provides particular output (in this case, it logs a message in the database). That is why, it has to be declared as a parameter with direction OUT. The values for parameter direction are not case-sensitive.

    Optionally, you can specify a description of the job definition which is displayed in Job Management in the SAP NetWeaver Administrator.

    For more information about the Document Type Definition (DTD) of job-definition.xml, see Job-definition.dtd

  3. Save the file.