cancel
Showing results for 
Search instead for 
Did you mean: 

PI file to file BPM scénario

Former Member
0 Kudos

i want to make a file to file scenario with simple mapping inside.

if no error mapping then store file in folder1

else store file in folder2.

is there anyone who realize this

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

Do you want the source or the result file stored in folder1 or folder2?

For source file: this is possible. Simply use the Processing Mode = Archive in sender CC and specify folder1 as the Archive Directory, and mark Archive Files on FTP Server if you are using FTP Transport Protocol. Moreover, mark the Archive Faulty Source Files and specify folder2 as Directory for Archiving Files with Errors. No BPM required.

For the result file: you would have to use BPM, as in the topic title, to achieve this. You would have to use a different mapping for folder2 than for folder1, to avoid the same error as in the first trial.

Hope this helps,

Greg

Former Member
0 Kudos

I want the source file to be stored

I tried it with CC but it's always archive files without errors. it don't make it for erroned ones ???

former_member184681
Active Contributor
0 Kudos

Did you do the following?

mark the Archive Faulty Source Files and specify folder2 as Directory for Archiving Files with Errors

Former Member
0 Kudos

yes i do it ... without succes

anupam_ghosh2
Active Contributor
0 Kudos

Hi ,

If there is an error in mapping PI will throw an exception and message flow will stop.

For an BPM workflow will stop if an Message mapping fails in any of the steps . If you are using "Archive Source Files with Errors" in sender file adapter then this option works only if there is an error during FCC or adpater module (and not in any mapping beyond that). If you want to decide the receiver depending on value of a field after mapping you need to use receiver determination rules (condition). If you could explain with example your requirement then perhaps forum members might be able to suggest some solution to your problems.

Regards

Anupam

Former Member
0 Kudos

hi Anupam,

it's exactly the situation what i am faced.

can u give some example of what u suggest (condition in receiver determination)

i'll thank u for that.

Former Member
0 Kudos

Hi ,

I finally resolved this feed, without using receiver determination conditions.

simply in BPM

the problem that i have that is in fact to send outbound interface, i send the result of mapping .

i have a problem in config that I solved Now.

I hope that i'll have time to blog this solution.

thank for everyone.

anupam_ghosh2
Active Contributor
0 Kudos

Hi,

First complete a normal file to file scenario. With all normal settings. I am not aware of condition of error. Thus let say after mapping there is a XML as shown

<mt_target>

<f1>abcs</f1>

<error>1<error>

</mt_target>

The mapping will decide the value of the error field. Lets say In case value of error field is 1 you need the file to be formed in directory say "/usr/folder1" similarly if the value of "error" field is zero you need the file to be formed in "/usr/folder2". .

Now you define another mapping MM2. The source message type and target message type of MM2 will be mt_target as shown above.

You write a UDF as shown within message mapping MM2.


public String setDirName(String error,Container container){
 DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
 
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
 
String outputDir="";
 
if(error.equals("1"))
{
    outputDir=""/usr/folder1";
}
else
{
       outputDir=""/usr/folder2";
}
conf.put(key, outputDir);
return "";
}

Now MM2 will be like this

f1------>f1

error-->UDF--->root (mt_target)

error----->error

Now put this mapping under last message mapping in the same operation mapping. Thus the OM will contain both the first mapping where you obtained mt_target for the first time and MM2. Finally in receiver file adapter you need following changes

1. Receiver CC has "Use Adapter-Specific Message Attributes" and Directory ticked

2. "fail if ASMA missing" tick this.

I hope this resolves your problem.

Regards

Anupam

Answers (2)

Answers (2)

Former Member
0 Kudos

it's work when we use BPM.

casting the error of mapping.

if error send the result of mapping

and send interface source if !error

Former Member
0 Kudos

i want to make a file to file scenario with simple mapping inside.

if no error mapping then store file in folder1

else store file in folder2.

that is very simple by using Context Object/Xpath with out bpm.

id obj:

you have to create ONe Sender Communication channel and Sender Agreement.

and

Create 2 receiver Communication channels and 2 agreements

in receiver determinitation , you have to define Context OBJect

ex:

emp no 10 and 12 -> Receiver 1

otherwise -> Receiver 2

and

create 1 Interface determination.

otherwise that is also possiable with "Receiver Determination Enhancement"

http://www.saptechnical.com/Tutorials/XI/RecvDetermination/Enhancement.htm

Edited by: bhavanisankar.solasu on Feb 6, 2012 3:03 PM