Information Management IBM InfoSphere Master Data Management, Version 10.1

Creating XJCL for batch jobs

The InfoSphere® MDM Server WebSphere® Extended Deployment Batch application is driven by an XJCL batch job that defines the unit of work that has to be processed by the application. It specifies input, output and log batch data stream parameters.

The following is a template for the XJCL batch job. It can be used as the basis for creating a new XJCL batch job.

<?xml version="1.0" encoding="UTF-8"?>
<job name="MDMBatch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<jndi-name>ejb/BatchJobStepController</jndi-name>
	<step-scheduling-criteria>
	   <scheduling-mode>sequential</scheduling-mode>
	</step-scheduling-criteria>
	<checkpoint-algorithm name="recordbased">
	     <classname>com.ibm.wsspi.batch.checkpointalgorithms.recordbased</classname>
	     <props>
		   <prop name="recordcount" value="<CHECKPOINT_RECORD_COUNT>" />
		   <prop name="TransactionTimeOut" value="120" />
	     </props>
	</checkpoint-algorithm>
	<job-step name="MDMBatchStep">
	   <jndi-name>ejb/BatchJobStepProcessor</jndi-name>
	   <checkpoint-algorithm-ref name="recordbased" />
	   <batch-data-streams>
	     <bds>
		<logical-name>input</logical-name>
		<impl-class>com.ibm.mdm.ws.batch.LineReaderBatchDataStream</impl-class>
		<props>
		   <prop name="fileName" value="<INPUT_FILE_NAME>"/>
			<prop name="encoding" value="<INPUT_FILE_ENCODING>"/>
		</props>
	     </bds>
	     <bds>
		<logical-name>output</logical-name>
		<impl-class>com.ibm.mdm.ws.batch.LineWriterBatchDataStream</impl-class>
		<props>
		   <prop name="fileName" value="<OUTPUT_FILE_NAME>"/>
		   <prop name="encoding" value="<OUTPUT_FILE_ENCODING>"/>
		</props>
	     </bds>
	     <bds>
		<logical-name>log</logical-name>
		<impl-class>com.ibm.mdm.ws.batch.LogWriterBatchDataStream</impl-class>
		<props>
		   <prop name="LoggerFactory" value="com.dwl.base.logging.DWLLog4jLoggerFactory"/>
		   <prop name="log4j.appender.file.File" value="<LOG_FILE_NAME>"/>
		   <prop name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
		   <prop name="log4j.appender.stdout.Threshold" value="<LOG_LEVEL>"/>
		   <prop name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
		   <prop name="log4j.appender.stdout.layout.ConversionPattern" value="%-5p %3x - %m%n"/>
		   <prop name="log4j.appender.file" value="org.apache.log4j.RollingFileAppender"/>
		   <prop name="log4j.appender.file.Encoding" value="<LOG_FILE_ENCODING>"/>
		   <prop name="log4j.appender.file.Threshold" value="<LOG_LEVEL>"/>
		   <prop name="log4j.appender.file.layout.ConversionPattern" value="%d %-5p %3x - %m%n"/>
		   <prop name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
		   <prop name="log4j.rootLogger" value="<LOG_LEVEL>, file, stdout"/>
		</props>
	     </bds>
	   </batch-data-streams>
	   <props>
	      <prop name="provider_url" value="iiop://<HOST_NAME>:<PORT>"/>
	      <prop name="context_factory" value="com.ibm.websphere.naming.WsnInitialContextFactory"/>
	      <prop name="userId" value="<USER_ID>"/>
	      <prop name="password" value="<PASSWORD>"/>
	      <prop name="Context.OperationType" value="All"/>
	      <prop name="Context.requesterName" value="<REQUESTER_NAME>"/>
	      <prop name="Context.requesterLanguage" value="<REQUESTER_LANGUAGE>"/>
	      <prop name="Context.Parser" value="TCRMService"/>
	      <prop name="Context.Constructor" value="TCRMService"/>
	   </props>
	</job-step>
</job>

You need to replace all values enclosed in angle brackets, <>, with values that reflect your environment.

Another file reader can be used for enabling parsing of input files with transactions that contain line feeds in them. To use the reader, change the corresponding portion of the file above. The property TxTokens must specify the top level element for the XML request, TCRMService, DWLAdminService, or DWLCompositeServiceRequest, as the case may be.

<bds>
	<logical-name>input</logical-name>
	<impl-class>com.ibm.mdm.ws.batch.MultiLineReaderBatchDataStream</impl-class>
	<props>
		<prop name="fileName" value="<INPUT_FILE_NAME>"/>
		<prop name="encoding" value="<INPUT_FILE_ENCODING>"/>
		<prop name="TxTokens" value="TCRMService"/>		
	</props>
</bds>
Table 1. Parameters for XJCL batch job
Value Description Example
<CHECKPOINT_RECORD_COUNT> Specifies the number of records that are processed before the checkpoint algorithm performs global transaction commit. In case of failure, the transaction will be rolled back until the last committed checkpoint. 1
<INPUT_FILE_NAME> Location and name of the input file, containing records for processing. C:/InputFolder/InputFile
<INPUT_FILE_ENCODING> Character encoding of the input file. UTF-8
<OUTPUT_FILE_NAME> Location and name of the output file that will contain results of processing. C:/OutputFolder/OutputFile
<OUTPUT_FILE_ENCODING> Character encoding of the output file. UTF-8
<LOG_FILE_NAME> Location and name of the log file that will contain the log for the MDMBatch application. C:/LogFolder/LogFile
<LOG_LEVEL> MDMBatch application logging detail level. WARN
<LOG_FILE_ENCODING> Character encoding of the log file. UTF-8
<HOST_NAME> Host name of the server running InfoSphere MDM Server. host.domain.com
<PORT> Port number on which InfoSphere MDM Server is listening for requests. 2809
<USER_ID> User ID for the secure connection to WebSphere Application Server if security is enabled. If security is not enabled on WebSphere Application Server, leave this value empty. wasuser
<PASSWORD> User password for the secure connection to WebSphere Application Server if security is enabled. If security is not enabled on WebSphere Application Server, leave this value empty. wasuserpassword
<REQUESTER_NAME> The user ID of the requester. The requester name is validated by the security service, and recorded when audit information, such as last update information, is captured. cusadmin
<REQUESTER_LANGUAGE> The MDM code identifier for the local of the requester; this locale is used for NLS. 100

A template for creating batch jobs can be found in <MDM_INSTALL_HOME>/MDMBatch/MDMBatch_template_xjcl.xml, where <MDM_INSTALL_HOME> is the location where InfoSphere MDM Server is installed.

For more details on XJCL batch jobs see the WebSphere Extended Deployment product documentation.

For more details on InfoSphere MDM Server, see the related InfoSphere MDM Server product documentation.



Feedback

Timestamp Last updated: 18 Jul 2013

Topic URL: