on 07-20-2006 5:31 AM
Hi All,
i know when XI gets an empty input text file, it does not generate a send message for it in sender communication channel.
in my scenario, if i get a file with data, i have to generate an XML message for it using file content conversion - this i have done...........
but if i get an empty text file, then i have to generate a dummy XML send message for it for my BPM.......
So i made a J2EE adapter module to generate dummy xml for empty file.....<b>when i give a file with data in it, then my adapter module is called..... but when i give an empty file, then my adapter module is not called</b>.........
<b><i>Can anybody suggest why the module processor is not invoking my customer-adapter module when an empty file is given.............but the module processor is invoking my customer-adapter module when a file with data is given</i>.</b>
Thanks,
Rajeev Gupta
Hi Rajeev,
Can you send the code of process method you implemented?
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
Below is the code of process method which i used:
<i>public ModuleData process(ModuleContext moduleContext,
ModuleData inputModuleData)
throws ModuleException
{
Object obj;
Message msg_audit;
AuditMessageKey amk;
try
{
File f = new File("/components/XITEMP/sample/PWC/check.txt");
PrintStream ps;
if (f.canWrite())
{
FileOutputStream fos =new FileOutputStream(f);
ps = new PrintStream(fos);
ps.println("Testing");
ps.close();
fos.close();
}
else
{
f = new File("/components/XITEMP/sample/PWC/check4.txt");
if (f.exists() ==false)
{
f.createNewFile();
}
}
obj = inputModuleData.getPrincipalData();
if (obj!=null)
{
msg_audit = (Message)obj;
amk = new AuditMessageKey(msg_audit.getMessageId(),AuditDirection.OUTBOUND);
Audit.addAuditLogEntry(amk,AuditLogStatus.SUCCESS,"FileCheck: Module called");
}
else
{
String str = new String();
String str1 = new String();
str1="<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
str1+="<ns:MT_PWC_RECORD xmlns:ns=\"urn://PWC_SR3_01/PWC/Customer\">";
str1+="<RECORD_SET>";
str1+="<RECORD>";
str1+="<RECORD_DATA>BLANK_FILE</RECORD_DATA>";
str1+="</RECORD>";
str1+="</RECORD_SET>";
str1+="</ns:MT_PWC_RECORD>";
str=str1;
inputModuleData.setPrincipalData(str);
}
}
catch(Exception e)
{
try
{
File f = new File("/components/XITEMP/sample/PWC/check.txt");
PrintStream ps;
if (f.canWrite())
{
FileOutputStream fos =new FileOutputStream(f);
ps = new PrintStream(fos);
ps.println(e.toString());
ps.close();
fos.close();
}
}
catch(Exception ex)
{
}
}
return inputModuleData;
}</i>
in the above methood, i used file operations at start just to see whether the module is getting invoked or not...so when i give a data file, then the file operations are performed and messages are written in audit log.........but when i give an empty file, then the file operations are not performed - meaning the module is not getting invoked........
Thanks,
Rajeev Gupta
Hi Amit,
i cant modify the input text file because it is coming from a third-party company..........
i have to use that input text file for my BPM....if that file is not having data, then i have to generate a alert message to administrator..............so i was trying to generate a dummy XML for my empty file for BPM so that in BPM i can generate an alert message for my empty file...
Regards,
Rajeev Gupta
Hello Rajeev,
In that case I suggest you prepare an OS-level script which will archive the empty file to a different folder as and when it is posted and create a new file containing info ( e.g. name , timestamp ) about the moved file. On finding this data XI can generate message and your BPM can raise alerts.
CHEERS
Amit
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.