X

The Integration blog covers the latest in product updates, best practices, customer stories, and more.

  • February 23, 2016

MFT 12.2.1 Nashorn Java Script Integration

The last blog on MFT scripting (ginzu knife) callouts generated a ton of interest. When you upgrade to MFT 12.2.1 which uses Java JDK 1.8 then you have yet another leaner and meaner option to use the RunJS callout to use JavaScript to invoke all MFT, SOA and all WSL Java API's natively. I'll let that sink in..... Yes, any jar or class file in the classpath of the WLS server hosting MFT (including many used by SOA adapters) is callable on the same thread as an MFT transfer.

Why should you care? Well, it really only impacts security, performance, resource utilization, convenience plus the flexibility of a non compiler environment and thus virtually unlimited numbers of use cases but other than that, no reason to care at all. The Nashorn JavaScript engine receives the same MFT callout context and input, output streams as the Java callout's do so it is extremely easy to validate or modify files. Here are some use cases in the provided samples:

  • File rename
  • Cleansing of bad characters
  • CSV to XML translation using the adapter Native Translation libraries
  • XML to CSV translation
  • CSV to JSON translation

These use cases are just to get your mouth watering, there is virtually nothing you cannot do with this. You may ask, can I write to a database or JMS or File system? Well, are there Java API's to do that?

The download and config are quite simple, just download the MftJS.zip file and unzip it into your MFT <DOMAIN_HOME> folder. Then open up the README file in mft/js/README and follow the instructions. There is actually a library of samples you can use all driven by an Action parameter in the MFT RunJS callout UI shown below.

The Location and Function values are defaulted but you can override them and adjust the ScriptParameters as you like. There is even a special obfuscated Password you can use for hiding parameters. There are end to end transfers provided you can import, deploy and run to get you started as shown below.

Geeze, what will they think of next ;)

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha