Thursday, January 15, 2015

#373 MFT --> Leveraging Remote sFTP as target / WLST support

Simple scenario: MFT transfer from local file to remote sFTP server.

I am using Cerberus FTP server here.
It is configured for sFTP as follows -


















I used PuttyGen to generate keys - they are here -












My Cerberus user - niall - is configured as follows -














Folder is D:\Work\envs\CerberusFTP\NcFolder

niall will use the public key, generated earlier.























I now import the private key into MFT using wlst -




















type help("mft") to see all mft related commands.





















now import the key -

importCSFKey('SSH', 'PRIVATE', 'ncMFTssh', 'D:\Work\keys\myPriv.ppk')




Now to the MFT Console - Administration tab

I set the SSH Keystore - PrivateKey password

















I now define my remote sFTP target -

















I create a file source -

























and then a transfer -


















I deploy and test -

source folder -











target directory -



Friday, January 9, 2015

#372 File Adapter Valves --> convert xlsx to csv

Simple scenario here - I need to process an excel .xlsx file in SOA Suite.

This was very straightforward, as Mark Foster from the A-Team has detailed the steps for doing this, albeit with BPM. He details exactly how to implement the file adapter valve, leveraging Apache POI for the xlsx to csv conversion.

Check out his post here

Btw. I am using JDev SOA Suite 12c Quickstart.

I just followed Mark's instructions and then copied the valve implementation jar to the following directories -













and










I re-started the integrated server.

My composite is as follows -
















The BPEL process does nothing, except accept in the payload.

I deploy and test -

Here is the sample .xlsx file from Mark -










Here is the audit trail from the BPEL instance -


















Java project for xlsx conversion here

SOA project there

Again, a big thank you to Mark!


#371 how to execute a shell script command from SOA Suite

Simple approach here -

execute the shell cmd from Java.
Expose the Java class as a web service.
Invoke from BPEL.

I got the Java code from here
Essentially the web service operation accepts in a website as string.
All I do is execute a ping and then return the result.

I massaged it a bit and then deployed as a web service to Weblogic.

I then created the composite -







Deploy and test -












Java project here
SOA project there

Thursday, January 8, 2015

#370 MFT --> Resubmitting successfully transferred files


I have a simple MFT transfer --> MyAA 2 MyBB













As you can see, MFT has successfully transferred the following file -







Here is the monitoring view from the MFT console -




Here are the current contents of the file at the target -











Now I edit the file at the source -














I now go back to the MFT Monitoring console and click resubmit transfer.




























#369 UMS Email adapter (part 2)--> send PDF file as an email attachment

Simple scenario -

Read in a pdf file and send it as a pdf attachment.









fileService_4 configuration -














































































The strategy I am using here, is not to read the contents, so I get the file and
directory names from the header. These I copy into process variables -


















This information will be used in a function to
add the file as an attachment to the email.

I will be using the ora:readFile function -
e.g. ora:readFile('file:///c:/docs/My.pdf'')

I need to swap the "\" to "/" in the directory variable.
I then create a variable with the value'file:///c:/docs/My.pdf''






I then set the attachment values on the EmailPDF activity as follows -








I deploy and test -

For testing purposes, I will drop the BAM pdf into the input directory.










The email arrives with the attachment -














I open the pdf -











#368 UMS Email adapter --> send file as an an attachment part 1

Simple Scenario -


























































Here is the Assign from the BPEL process -










Here is the SendEmail config -











































Deploy and test -

Here is my input file -




















My input directory is -



















Test - copy the myFile.txt to the input directory -

Check for the email -



















Tuesday, January 6, 2015

#367 File Adapter --> use of Trigger File

Simple scenario -

D:\BBB\inTrigger is my directory for incoming orders - 1 order per file.
I do not want to start processing the orders until all have been received.
This will be signaled by the arrival of a file called end.txt.

Here is my composite -







Here is the config of the readOrders adapter -


















I test with 2 input orders ans the end.txt file -
The result is 2 composite instances and 2 orders written -