cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - BPM

Former Member
0 Kudos

My Scenario is

Start BPM - Receive Huge File from System A - Transform Big File into 8 Smaller Files - Send All Files using FTP adapter to System B- Invoke Webservice on System B to Process all the files earlier sent - If Response Message is successful then Archive all 8 files to Different Folder on System B- End BPM

How do I issue Archival process from BPM ?. I'm so confused about how to achive archival after receving Success message from Webservice.

Any Ideas will be appreciated..

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ram,

The BPM steps that would be involved are:

1. Receive: To receive the file from system A

2. Transform: To split the file into 8 files.

3. A loop : with a send step(to send the files to system B), synch send (to send the request to webservice) and another send step (to send message to another directory in system B to be archived.)

Why is the files being placed in directory A of systemB first and then a webservice call made, when the files would anyway be archived later on?

Do you plan to archive only the successful messages, or all the 8 messages?

Could you tell us your requirement.

Regards,

Smitha.

Former Member
0 Kudos

Hi Smitha,

Webservice will return Success or Failure message. Based on that I need to move from the Folder ( This is the place we wrote earlier ) to another Folder.

Iam not asking to archive original File ( in Systrem A ). I need to archive whatever I sent in BPM after split. Without receiving 8 Files into BPM how can I send those files to another Folder?.

arunneerolil
Contributor
0 Kudos

You will have to move from First folder in SYS-B to the Archive folder in SYS-B.

I don't think we can dynamically pass file names to File Sender Adapter.

The target application should atleast rename the processed file.

rgds

Chemmanz

Former Member
0 Kudos

Hi,

Guess I was not clear enough.

<i>My steps again:

BPM Start

Receive FIleA from SystemA

Transform FileA into Files B1,B2,B3..etc

Send Files B1,B2,B3.. to SystemB

Sync Send Webservice to process Files B1,B2,B3 in systemB

Receive Response.

If Success Response Move Files B1,B2,B3 from FolderX to FolderY in SystemB ( Here I Should pickup Files B1,B2,B3 from FolderX within SystemB )</i>

My question: Once the files are placed in systemB folder, are there any changes made on them by systemB ?

<u>Case1:Changes are being made:</u> Your design of receiving the 8 files back into the bpm makes sense.

<u>Case2: No changes are being made by systemB on these files:</u> Since there are no changes as such being made to these files, you could rather use the 8 messages/8 files that has been persisted in the BPM, rather that polling for these files again.

You could select those files that got a successful response from the webservice, and send it to systemB folderB.

This is nothing but archiving.

In case you meant that you want to archive the files as a .zip file, you would have to write a script to do it.

Regards,

Smitha.

Former Member
0 Kudos

Hi Smitha,

My Situation is CaseB:

No changes being made to these files except Webservice takes data and process the data and do not change files.

But I need to move those files I have written earlier to another Folder within SystemB. Basically I need to remove these files from FolderA so that Next set of Files will arrive into SystemB and so on.

Based on Success Message from Webservice I need to move those file I have written earlier. How does persistance in BPM works in my situation as I need to move files from SystemB?

bhavesh_kantilal
Active Contributor
0 Kudos

Ram,

><i>Basically I need to remove these files from FolderA so that Next set of Files will arrive into SystemB and so on.</i>

Like pointed by Smitha, you can use the Receiver File adapter to dump the files into the Archiving folders. Remember you have the File data available in the BPM ( after the mapping split inContainer variables), and so you can use the Send Step to send the same files again to the archiving folder.( Folder B)

In the point that you want to delete the files from Folder A , write a script in the receiver file adapter level that will delete these files from Folder A. ( the archving into Folder B will be completed by the Receiver FIle adapter! ).

Regards

Bhavesh

Former Member
0 Kudos

Bhavesh,

when I write 8 files earlier in BPM I can use script to delete since Webservice follows to act upon these files. Also if there is Failure Status I have to still keep the files.

Before Ending BPM we have to move Files from FolderA to FolderB on <b>FTP</b> Server and its not a file system so writing Script is ruled out right ?

The Point is not exactly archiving but moving files from FolderA to FolderB on SytemB.

I'm sorry I shuld have told earlier that we are using FTP and not NFS filesystem.

Former Member
0 Kudos

Hi,

Two options:

<u>Option1:</u>:

<i>My Situation is CaseB:

No changes being made to these files except Webservice takes data and process the data and do not change files.</i>

Since there are no changes at all being made to the files in systemB folderA, you need not poll them again.

You can use the same files already present in the BPM.

Solution:

1. Receive file from system A

2. Transform file - 1 file to 8 files (message split)

3. Loop. The loop will be used to send the files one by one to the webservice.

Within the loop:

a. have a container to store a single file out of the 8 files/messages generated as a result of the transformation.

b. have a send step to send the file one at a time to systemB folder A.

c. have a send step to send the file one at a time to webservice.

c. have a switch step after the send step.

If the response is positive, send the file to systemB, else, do nothing.

In the receiver file adapter that you will be using to send files to folderB, use a script to delete file from folderA and move them to folderB

<u>Option2:</u>

Actually speaking, all you need to do is to put the files directly to folderB rather that first putting it into folderA and moving it to folderB of systemB.

Putting files into folder A is redundant because:

a. there are no changes being made to the files in folderA

b. they are anyway going to be deleted after the files are placed in folderB.

So, what is the use of placing the files in folderA?

In case, you agree with the above, you need to design the BPM, same as the steps in option1. The only difference is that, you would not have the step 3b.That is, you donot have the send step that sends the files to systemB folderA.

Hope this is clear.

Regards,

Smitha.

Former Member
0 Kudos

I really appreciate you folks for your time and replies.

Smitha,

Option 1:

We are using only One webservice call to extract data from all 8 files

Webservice call does not alter files.

Once BPM receives Positive result, XI has to move file from FolderA to FolderB on the SytemB

All Files were written to external FTP Server.

Option2:

I need to put Files in FolderA because Webservice call triggers other adapters to get data from the files XI wriiten earlier.

After receiving Webservice call response XI need to move from FolderA to FolderB so we dont have to overlay the files for next BPM process

Former Member
0 Kudos

Hi,

1. You can use scripts to move files from folderA(delete them from here) and place them in folderB for FTP too.

Hope this solves the (original) query!

2. <i>I need to put Files in FolderA because Webservice call triggers other adapters to get data from the files XI wriiten earlier.</i>

This is unclear. Could you please elaborate?

Regards,

Smitha.

Former Member
0 Kudos

Webservice actually a SOAP call. This call triggers 8 different vendor adapters to process these files on SystemB. Those external adapters only reads data and does not alter files. So I want to try in XI/BPM to move Files from FolderA to FolderB in SystemB so that when another File from SystemA comes this process should repeat.

Can you please eloborate How can I run Script in my case ( Files on Remote FTP Server )

bhavesh_kantilal
Active Contributor
0 Kudos

Ram,

><i> How can I run Script in my case ( Files on Remote FTP Server )</i>

<a href="/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi">Executing Unix shell script using Operating System Command in XI</a>

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Ram,

Am not sure I follow the entire question,

But from what I followed, you need to split your source into 8 files and send them to a system and then invoke webservices and get the response and on the basis of the response in your BPM, you need to send the 8 files to difffferent locations.

So, in your BPM,

1. Receive --> To receive the file

2. Transform --> to split into 8 files

3. Send Steps ( in a fork )--> to send the files to system B

4. Invoke webservice --> Send Synchronous ( inside a fork ), get the response from the webservice calls

5 . Send Steps (in a fork ) --> To send / archive the files.

Regards

Bhavesh

Former Member
0 Kudos

Bhavesh,

you got my question right. However I did not understand step 5. If I use Send step its basically a Receiver File Adapter be configured right?. How can I archive with Receiver File Adapter ?

bhavesh_kantilal
Active Contributor
0 Kudos

Ram,

You can use the receievr file adapter with Dynamic Directory and Dynamic FileName to dump / put the file into any folder that you want using the Send Steps. This is also archiving right?

You have multiple modes in the receiver file adapter including, Create, AddTimestamp, Counter etc . these can also be used if needed.

Regards

Bhavesh

Former Member
0 Kudos

Bhavesh, Sorry I didn't quite understood or I may not have explained properly earlier.

When I send 8 files to SystemB from BPM, Webservice will be called to process these files but that Webservice does not rename/archive those files. I need to move those files from one folder to another within SystemB using BPM.

If I use Send step to move these files I should have received those files from SystemB right ? How Can I receive those files from SystemB?. If I use FileAdapter how Can I receive those files as FIle adapter will pickup those files as soon as we activate which is not correct.

My steps again:

BPM Start

Receive FIleA from SystemA

Transform FileA into Files B1,B2,B3..etc

Send Files B1,B2,B3.. to SystemB

Sync Send Webservice to process Files B1,B2,B3 in systemB

Receive Response.

If Success Response Move Files B1,B2,B3 from FolderX to FolderY in SystemB <b>( Here I Should pickup Files B1,B2,B3 from FolderX within SystemB ) </b>

arunneerolil
Contributor
0 Kudos

You want to move 8 files from SystemB FTP folder to archive folder then it's better to use another integration scenario which will simply perform this copy operation.

But still the target app should atleast rename the processed file.

else

You can write to archive folder from BPM after receving Success message from Webservice provided the target application will delete the processed files from the first folder. In this case i think you will have to specify conditional receiver determination as the messages are same.

rgds

Chemmanz

Former Member
0 Kudos

System B dont want to do anything. They donot want to delete or rename or archive the processed files. I should take care of it using XI.