Hi Team,
My code is not picking the parameter from the interface determination.
Looks like there is something wrong with my code. Please help
Here is part of my code:
public class JAVA_AddTimeStamp2 implements StreamTransformation{
String inParam = "";
AbstractTrace trace;
private Map objMapParameter = null;
public void transform(TransformationInput arg0, TransformationOutput arg1)
throws StreamTransformationException {
inParam = arg0.getInputParameters().getString("ACCOUNT_NAME");
trace.addWarning("inParam value:" +inParam);
}
public void execute(InputStream isInput, OutputStream osOutput)
throws StreamTransformationException {
String strTrgtFileName = null;
Date dteCurrDate = null;
SimpleDateFormat sdfDateFormat = null;
DynamicConfiguration objDynConf = null;
final String SFTP_PATH = "http://sap.com/xi/XI/System";
final String SFTP_PROPERTY = "FileName";
final String FILEEXTN = ".pgp";
// access dynamic configuration
objDynConf = (DynamicConfiguration)
objMapParameter.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
dteCurrDate = new Date();
sdfDateFormat = new SimpleDateFormat("MMddyyyy.hhmmssSSSSSS");
strTrgtFileName = inParam + ".PS00020." + sdfDateFormat.format(dteCurrDate) + FILEEXTN;
//set the dynamic configuration key for File Adapter for FileName
final DynamicConfigurationKey KEY_FILENAME =
DynamicConfigurationKey.create(SFTP_PATH, SFTP_PROPERTY);
// set output file name
objDynConf.put(KEY_FILENAME, strTrgtFileName);
// calling the method copyPayload
this.copyPayLoad(isInput, osOutput);
//closing the input and output streams
try{
isInput.close();
osOutput.close();
}
catch(IOException objIOException){
throw new StreamTransformationException(objIOException.getMessage());
}
}