cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Substituition throwing an error for empty payload

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

I am using variable substituition in the receiver file adapter...

Everything is working fine and the variable substituion is working and creating a file whenever the payload in the mapping has the filenode field for variable substituition.

Now based on some condition the payload will be empty in the mapping then no file to be created...

For this i used IGNORE in the receiver adapter BUT still an empty file is being created, this is because the payload will have the filenode field ...

Now my question is how can we stop in creating an empty file...

Even i tried using Dynamic Variable in the mapping but that to throws an error...

Please suggest me on how to solve this...

Regards,

sridhar

Accepted Solutions (0)

Answers (4)

Answers (4)

sridharreddy_kondam
Active Contributor
0 Kudos

Hi,

I tried using Variable substitution in both ways(Dyanmic using UDF and other way using the payload) and still the same prob..

So we decided to send a different file(empty) if the condition does not satisfy else the actual file with data

Thanks and Regards,

Sridhar

JoelTrinidade
Active Contributor
0 Kudos

Hi Sridhar,

I to had a similar requirement , the solution lies in the fact " no node --- no problem ".

Regards

joel

former_member181985
Active Contributor
0 Kudos

use a condition for the existance of field in the receiver determination to route the message to target.

Shabarish_Nair
Active Contributor
0 Kudos

>

> Now based on some condition the payload will be empty in the mapping then no file to be created...

> For this i used IGNORE in the receiver adapter BUT still an empty file is being created, this is because the payload will have the filenode field ...

Make sure that the node is not created itself in the mapping so that you will not have the issue.

IS that what you are looking for?

Else give more details so that we can help

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Shabarish,

Even i tried by making the filenode not appear in the mapping,No file is created but error is thrown in RWB CC monitoring...

Following is the error which i am getting

Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: filename1

This is because the filenode (fielname) doesnt appear in the payload...

and if i try the other way then also the same prob...

Regards,

Sridhar

Shabarish_Nair
Active Contributor
0 Kudos

please avoid variable sub. instead use dynamic conf in your case.

/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

madanmohan_agrawal
Contributor
0 Kudos

Hi,

I am not sure but you can just give a try the below configuration in receiver CC.

Empty-Message Handling = ignore

Regards,

Madan Agrawal