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 -


































#366 SFTP (Put/Get) with the Oracle FTP adapter

Simple scenario here -







All the composite does is accept in an order and then PUTs the order to the FTP server.

As FTP server I am using Cerberus FTP.

I configured a new user niall




















Note: the root folder for user niall is D:\Work\envs\CerberusFTP\NcFolder

Here are the Constraints -
niall can only use sftp






























So user niall will use the above public key to authenticate.

So where did this key come from?

I used PuttyGEN to create public/private keys on the machine, hosting SOA Suite.
























These keys are stored here on my machine - in D:\Work\keys








Now back to the composite -

Here is the configuration of the FTP adapter -











Note the JNDI Name eis/Ftp/ncSFTPAdapter.

I now go to the Weblogic console and configure this resource -






































Properties 1 - 10: no changes.

Properties 11 - 20: change Host value to FTP Server host



Here is the ip address from the FTP Server console -

























Properties 21 - 30: no changes.

Properties 31 - 40: change ListParserKey = WIN


















Properties 41 - 50: set PrivateKeyFile to point to the SOA Host
private key.

change port to 22.



















Properties 51 - 60: no changes.

Properties 61 - 70: Set
ServerType=win
Username=niall

(niall is, of course, our ftp user)




















Properties 71 -74:
Set UseSftp to true















Save and update the ftpAdapter deployment






































Deploy the composite and test -














--- GET ---

Here is my composite -










Adapter config as follows -
























I drop a file into NcFolder














It is picked up and an instance of the composite is instantiated.