anthony.rabiaza

Swift to XML in Dell Boomi using Swift2XML

Blog Post created by anthony.rabiaza Employee on Jul 9, 2018

I wanted to share a solution I recently developed to work with SWIFT messages in the Dell Boomi AtomSphere Platform. If you're not familiar, SWIFT messages are commonly used in the financial industry to exchange data between institutions. SWIFT messages follow a specific data format that does not align with any of the Profile types within AtomSphere so I developed Swift2XML, a Java library that converts SWIFT messages to/from XML so you can work within the data in Maps and other shapes. The library is generic and supports all SWIFT Message Types.

 

 

Getting Started

 

Get and Upload Libraries to AtomSphere

Please download the following libraries:

 

Then upload them to your AtomSphere account via Setup > Development Resources > Account Libraries.

 

Create Custom Library Component

Once uploaded, you can create a Custom Library component and include the three libraries added above:

 

 

Once created, don't forget to deploy the Custom Library to the Molecule/Atom where you will like to test the framework.

 

Create the XML Profile

Create a one XML Profile based on MT103.xml (in the project) or based on generated XML using Swift2XML (open the JUnit class and create a new testcase).

 

 

Use of Swift2XML in a Process

In your Boomi process, add a Data Process shape with a Custom Scripting step. Replace the default script with the following:

 

To convert from SWIFT to XML:

import java.util.Properties;
import java.io.InputStream;
import com.boomi.proserv.swift.SwiftToXML;

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);

  String swift = SwiftToXML.inputStreamToString(is);
  String xml   = SwiftToXML.parseSwift(swift);
 
  is = SwiftToXML.stringToInputStream(xml);

  dataContext.storeStream(is, props);
}

 

And to convert from XML to back to SWIFT:

import java.util.Properties;
import java.io.InputStream;
import com.boomi.proserv.swift.SwiftToXML;

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);

  String xml   = SwiftToXML.inputStreamToString(is);
  String swift = SwiftToXML.parseXML(xml);
 
  is = SwiftToXML.stringToInputStream(swift);

  dataContext.storeStream(is, props);
}

 

 

Example of a process Process

The following process read different SWIFT message types from the Disk, get the Message with type 103 and remove the 71A tag.

 

 

Decision using the message type

 

Removing a tag

 

Execution view

 

Execution view: Input SWIFT Message (type 103)

 

Please note the presence of the last element in block 4:

:71A:SHA

Execution view: XML Message generated by Swift2XML

 

Execution view: SWIFT Message generated by Swift2XML after removing the tag

 

For additional information, please visit my Github project: swift2xml. If you need to handle SWIFT, give it a try and let me know what you think. Thanks!

 

Anthony Rabiaza is a Lead Solutions Architect with Dell Boomi.

Outcomes