This Framework allows the parsing and manipulation of Swift messages in Dell Boomi Integration Platform. The Framework is generic and support all Swift Message Types.
Please download the libraries swift2xml, gson and pw-swift-core from github.
Upload the following jar file to Setup>Account>Libraries:
- gson-version.jar
- pw-swift-core-version.jar
- swift2xml-version.jar
The jars are inside lib and jar folder, the common-lang library is not required as it is already bundle with the Boomi Atom.
And then create a Custom Library (you can call it Script_Swift2XML) with the three library
The latest versions of the first two jars are available here: https://sourceforge.net/projects/wife/
Once created, please deploy the Custom Library to the Molecule/Atom where you will like to test the Framework
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)
In your Boomi process, you need to use the "Data Processing Shape" with Custom Scripting step.
Only 4 lines of code (copy/paste) are required.
import com.boomi.proserv.swift.SwiftToXML;
- From Swift to XML
Adding the following snippet before the last command (
dataContext.storeStream(is, props);
)
String swift = SwiftToXML.inputStreamToString(is);
String xml = SwiftToXML.parseSwift(swift);
is = SwiftToXML.stringToInputStream(xml);
- From XML to Swift
String xml = SwiftToXML.inputStreamToString(is);
String swift = SwiftToXML.parseXML(xml);
is = SwiftToXML.stringToInputStream(swift);
The following process read different Swift message types from the Disk, get the Message with type 103 and remove the 71A tag.
Please note the presence of the last element in block 4:
:71A:SHA