on 03-28-2011 9:14 AM
Hi All,
Can we configure the file sender/receiver adapter to just check whether a file with a particulat file name exists in a directory?
I want to do this check at a particular stage in BPM. If the file name is detected, I would like to proceed in a BPM.
Kindly assist.
Thanks,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
No standard functionality exists in PI for only checking whether a file exists in a directory. you would need to use a UDF and the File I/O operations of java for this.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
You can use this code in the udf if the file directory is in the local file system
public String fileExists(Container container) throws StreamTransformationException{
String FilePath = "C:\\FileName.txt";
String reslt = "false";
File f = new File(FilePath); // You can even get this FilePath through function parameter as var1
if(f.exists)
{
reslt = "true";
}
else
{
reslt = "false";
}
return reslt;
}
The function will return a string "true" if the file exists and "false" if not.
Regards,
Aravind
Hi John,
Check this:
http://stackoverflow.com/questions/4302159/how-to-check-if-file-exist-when-downloading-from-ftp
Regards,
Aravind
you can write one UDF to perfrom File look up, check in your directory whethe specific file exists or not.
search in sdn for piece of UDF code.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.