[resolved] How to create a new Metadata Component for SWIFT?

One Star

[resolved] How to create a new Metadata Component for SWIFT?

Hi,
I need to parse the SWIFT messages to our readable format, and similarly generate the SWIFT messages from the existing data we have.
I guess, as of now Talend does not support the SWIFT message parsing.
So, If we have to create a new component for parsing the SWIFT message what would be the best approach?
I think under "Repository" we can have an additional component called "File SWIFT" which would do the above job.
Could you please help me in creating a new component "File SWIFT".
Any guidance regarding this is highly appreciated.

SWIFT - Society for Worldwide Interbank Financial Telecommunication
Thank you
Achyuth

Accepted Solutions
One Star

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi Shong,
Sure with pleasure.
This is what i tried. This might look a bit confusing, but it is really not. Please reply to the post if you face any difficulty.
STEPS
1) Get the API for swift message parsing (WIFE)
Download the required APIs for parsing SWIFT message http://www.prowidesoftware.com/en/download.html
2) Configure External Routine in Talend using WIFE API
2.1) Create the Routine
2.2) Attach the WIFE API Library files to the Routine (Refer image-1)
2.3) Write the custom routine code by calling the API methods as per the requirement (Sample code below)
Sample custom routine code
-----------------------------------------------------------------------------------------------------------
public static Map<String, Object> fieldParser(String fin){
Map<String, Object> fieldMappings = new HashMap<String, Object>();
try {
SwiftMessage m = (new ConversionService()).getMessageFromFIN(fin);
Field32A f = new Field32A(m.getBlock4().getTagValue("32A"));
fieldMappings.put("Field32A", f.getComponent1());
fieldMappings.put("BlockCount", m.getBlockCount());

} catch (Exception e) {
e.printStackTrace();
}
return fieldMappings;
}
-----------------------------------------------------------------------------------------------------------
3) Create job (Refer Image-2)
3.1) Parse the SWIFT message file
3.2) Call the java routine code for parsing the messages
3.3) Perform the required mappings
3.4) Save the parsed attribute values to Database/File

Sample SWIFT Message
-----------------------------------------------------------------------------------------------------------
{1:F01BANKDEFMAXXX2039063581}{2Smiley Surprised1031609050901BANKDEFXAXXX89549829458949811609N}{3:{108:00750532785315}}{4:
:20:007505327853
:23B:CRED
:32A:050902JPY3520000,
:33B:JPY3520000,
:50K:EUROXXXEI
:52A:FEBXXXM1
:53A:MHCXXXJT
:54A:FOOBICXX
:59:/13212312
RECEIVER NAME S.A
:70:FUTURES
:71ASmiley FrustratedHA
:71F:EUR12,00
:71F:EUR2,34
-}";
-----------------------------------------------------------------------------------------------------------

All Replies
Community Manager

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi
I know you have parsed the SWIFT file by creating custom routine. Would you like to share the routine or component on Talend exchange?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi Shong,
Sure with pleasure.
This is what i tried. This might look a bit confusing, but it is really not. Please reply to the post if you face any difficulty.
STEPS
1) Get the API for swift message parsing (WIFE)
Download the required APIs for parsing SWIFT message http://www.prowidesoftware.com/en/download.html
2) Configure External Routine in Talend using WIFE API
2.1) Create the Routine
2.2) Attach the WIFE API Library files to the Routine (Refer image-1)
2.3) Write the custom routine code by calling the API methods as per the requirement (Sample code below)
Sample custom routine code
-----------------------------------------------------------------------------------------------------------
public static Map<String, Object> fieldParser(String fin){
Map<String, Object> fieldMappings = new HashMap<String, Object>();
try {
SwiftMessage m = (new ConversionService()).getMessageFromFIN(fin);
Field32A f = new Field32A(m.getBlock4().getTagValue("32A"));
fieldMappings.put("Field32A", f.getComponent1());
fieldMappings.put("BlockCount", m.getBlockCount());

} catch (Exception e) {
e.printStackTrace();
}
return fieldMappings;
}
-----------------------------------------------------------------------------------------------------------
3) Create job (Refer Image-2)
3.1) Parse the SWIFT message file
3.2) Call the java routine code for parsing the messages
3.3) Perform the required mappings
3.4) Save the parsed attribute values to Database/File

Sample SWIFT Message
-----------------------------------------------------------------------------------------------------------
{1:F01BANKDEFMAXXX2039063581}{2Smiley Surprised1031609050901BANKDEFXAXXX89549829458949811609N}{3:{108:00750532785315}}{4:
:20:007505327853
:23B:CRED
:32A:050902JPY3520000,
:33B:JPY3520000,
:50K:EUROXXXEI
:52A:FEBXXXM1
:53A:MHCXXXJT
:54A:FOOBICXX
:59:/13212312
RECEIVER NAME S.A
:70:FUTURES
:71ASmiley FrustratedHA
:71F:EUR12,00
:71F:EUR2,34
-}";
-----------------------------------------------------------------------------------------------------------
Community Manager

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi
Very cool! Thanks for your sharing!
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi Achyuth,
this is really cool, i have been trying to do the same thing when i came across your post, but i still cant get it to work; please can you send me some more detail (cant see the pictures on the site) or even an export file would be most appreciated.
regards AvO
One Star

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi AchyuthB,
Could you please share images in your post. I also seem not to get it work.
regards
xsiyez
One Star

Re: [resolved] How to create a new Metadata Component for SWIFT?

Hi there
does anyone implemented this solution? I can't find those images ...
thanks