on 10-01-2008 7:33 AM
Hi All,
I want to give some condition based on the substring of a file Name.
Example, in the file name is "header1234.txt" the characters from 7 to 10 represent a company code and the corresponding receiver should be determined based on this string.
I can use the complete file name when I select Context object in the editor and choose the object as File Name, but am unable to get a substring of that. I have a Xpath expression underneath the Context object, but it is disabled.
Any pointers are welcome.
Thanks
Jaishankar
P.S: I tired to put substring(Interface.FileName,7,4) in the Xpath manually, but the expression goes away just like that when i close the editor and open it again.
Edited by: Jaishankar on Oct 1, 2008 1:12 PM
Assuming this feature is not supported. If some one has already done this please let me know. Your inputs would be of great help.
Thanks
Jaishankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Enhanced receiver determination would do the trick.. You'll have to write a UDF to get the company code from file name. Also you'll need to set Adapter Spec Message Attributes for File Name.
The UDF will assign value to the service node in the target used for enhanced recv det.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the Set Adapter Specific Message Attributes checkbox on the sender file adapter and check filename.
You can then access the filename in your mapping, substring it and put the resultant value into a destination field. You can then use this in your XPATH expression in the receiver determination.
Regards,
Pete
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pete,
Thanks.
1. Xpatch/context object works on source/input payload and not on target payload.
2. I can use enhanced receiver determination and do this in Mapping, but I dont want to do that.
3. Let us consider a sample scenario, where my BPM receives 2 input file files. File 1 is header123.txt and file 2 is item123.txt
The correlation I need to use here is 123.
Thanks
Jaishankar
Bumping up...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.