cancel
Showing results for 
Search instead for 
Did you mean: 

move file from processed to error folder in case of mapping failure

former_member1330829
Participant
0 Kudos

Hi,

I have a scenario, where if any mandatory field in the source is missing, the mapping fails and the source file should be moved from the "processed" folder to the "error" folder.

I am looking for handling this in a UDF in mapping , if possible.

Can anyone plese suggest me this udf.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

naveen_chichili
Active Contributor
0 Kudos

Hi Tanzoom,

Do multi mapping in PI add one more receiver as a file(to move to error folder), have to write error validation logic in mapping, whenever validation logic not satisfies(for error files) send data to File receiver(error folder) , in receiver specify error file directory in receiver channel.


Thanks,

Naveen

former_member1330829
Participant
0 Kudos

HI Naveen,

Can you please elaborate on the multi mappin in PI and the error validation logic.

former_member184720
Active Contributor
0 Kudos

What is your PI version? if you are on >7.1, you can make use of xml validation.

If any mandatory field is missing then the file automatically gets moved to error folder.

former_member1330829
Participant
0 Kudos

there are other restrictions on the interface for whih Schema validation is not being used.

former_member184720
Active Contributor
0 Kudos

then see if you can make use of the xpath condition to check if all the mandatory fields exists in the source payload.

If they exists route it to actual interface else route it to a dummy interface which will create the file under error directory.