Syndicator Batch and Java Wrapper


SAP MDM Interview Questions and SAP MDM Tutorials

SAP MDM Interview Questions and SAP MDM Tutorials

MDM Syndicator branch of tools include:

1. Syndicator GUI: Used to Create/Save/Export/Import Mappings, Configure Output Types etc. Can not run without a user

2. Syndication Server: Runs as an OS Service and executes configured Syndication Ports. Once configured, produces output in a designated location. Less flexible to integrate with external tools

SAP MDM Interview Questions and SAP MDM Tutorials

SAP MDM Interview Questions and SAP MDM Tutorials

3. Syndicator Batch: Executes syndication process in batch mode without launching fat GUI and it is highly configurable and allows flexibility to create Wrappers to work with external tools such as XML/XSL Transformers, FTP Clients and anything under your imagination

This blog walks you thru using Syndicator batch from Windows Command and creating a Java Wrapper to dynamically execute

Syndicator Batch requires a special installation and is available only on windows OS. Upon installation, it will create a windows executable "SyndicatorBatch.exe" in the designated folder and here are the options available:

image

The following shows how Syndicator Batch output when executed with appropriate parameters:
image

Caveat: Syndicator batch is required to be executed inside the installation folder. You should navigate to the installation folder in Command shell.

No big deal right? Now, I will show you how to create a simple java program that passes all Syndicator Batch parameters dynamically:

/*
* Created on Jan 5, 2007
*
*/
package com.sitacorp.mdm.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author Venkat Vadlamannati
*
* A Java Wrapper to Syndicator Batch
*
*/
public class SBDemo {
public static String SYN_BAT_DIR = "D:\\Program Files\\SAP MDM 5.5\\Syndicator Batch";
public static String SYN_BAT_EXE = "SyndicatorBatch.exe";
public static void main(String[] args) {
//Define and assign required parameters
String host = args[0];
String port = args[1];
String outputFile = args[2];
String user = args[3];
String password = args[4];
String language = args[5];
String synMap = args[6];
String clientSystem = args[7];
if(args.length<8 ){
System.out.println("Usage: java SBDemo <host> <port> <outputFile> <user> <password> <language> <syndication map> <client system> ");
System.exit(-1);
}
//Construct a Command to be executed
String COMMAND = "\""+SYN_BAT_DIR+"\\"+SYN_BAT_EXE+"\" -f \""+outputFile+"\" -o "+
" -s "+host+" -p "+port+" -u "+user+" -w "+password+
" -r \""+language+" \" -a "+clientSystem+" -n "+synMap;
//Make sure command is constructed correctly
System.out.println("COMMAND: "+COMMAND);
Runtime rt = Runtime.getRuntime();
try {
//Execute Command
Process proc = rt.exec(COMMAND,null,new File(SYN_BAT_DIR));
//Buffer console output
BufferedReader consoleOutput = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String str = null;
//Show buffred output to console
while((str = consoleOutput.readLine()) != null) {
System.out.println(str);
}
int retVal = proc.exitValue();
System.out.println("Syndicator Batch Exited with Return Code "+retVal);
} catch (IOException e) {
System.out.println("Error in Syndicator Batch Location "+SYN_BAT_DIR);
e.printStackTrace();
}
}
}

Compile this java code and running it will invoke Syndicator Batch dynamically and you can add your own functionality to enhance it.

SAP MDM Interview Questions and SAP MDM Tutorials

SAP MDM Interview Questions and SAP MDM Tutorials

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
   Send article as PDF   
This entry was posted in SAP MDM Tutorials. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *