Saturday, 8 March 2014

Dynamic FileTransfer Using File Nodes

Step:1
Create a message flow with below properties on FileInputNode and no properties to be specified at FileOutputNode


Step:2
In JavaComputeNode we should create below processing logic

String FileName=(inAssembly.getLocalEnvironment().getRootElement().getFirstElementByPath("File/Name")).getValueAsString();

MbElement FWD=outAssembly.getLocalEnvironment().getRootElement().createElementAsLastChild(MbElement.TYPE_NAME_VALUE,"Destination",null);

MbElement File=FWD.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,"File",null);

File.createElementAsLastChild(MbElement.TYPE_NAME_VALUE,"Directory","C:/Users/miracle/Desktop/TEST/TARGET");


File.createElementAsLastChild(MbElement.TYPE_NAME_VALUE,"Name",FileName);

Step:3
Connect the output terminal of the JCN to input terminal of FileOutputNode and save the flow and deploy the flow under any execution group of a Broker.

Step:4
The tree structure when the flow was at the below break point should look like below


Step:5
The tree structure when the flow was at the below break point should look like below

Step:6
Now you can see the file being present at the target directory.

Source Directory consists of mqsiarchive,mqsibackout,mqsitransitin folders.
Target Directory consists of mqsitransit