cancel
Showing results for 
Search instead for 
Did you mean: 

Content Validation before Mapping

Former Member
0 Kudos

Hi all,

I have the following requirement. I ll read a file as input. I need to check if filename equals one particular field in the source. if equals then i ve to go ahead doing mapping and the rest. Else i dont want to process anymore. please help me in a step by step procedure for doing the same.

Thank you

Sumayya T S

Accepted Solutions (0)

Answers (1)

Answers (1)

prateek
Active Contributor
0 Kudos

Access the filename using Adapter Specific Message Attributes

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Now u can compare this name with the payload value in graphical mapping itself

Regards,

Prateek

Former Member
0 Kudos

But i dont want to do mapping if validation fails. So i wanna check that before calling mapping step.

Former Member
0 Kudos

To comapre the File name you will write the UDF in that raise the exception if it is not equals. I hope the mapping won't processed if exception is raised.

Warm Regards,

Vijay

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

I hope your scenario can be done like this.

Have a Integeration Process in ur scenario and receive the xml file in the IP.

Inside the switch u check for the condition i.e filename = source field if true then have the transformation step in one branch to do mappping and if false do nothing or raise an alert and just have a send step.

receive -


> switch(transformation/no process) -


> send

Regards

Santhosh

Message was edited by:

Santhosh Kumar V

Former Member
0 Kudos

thank you for the reply vijay. But is it possible to do the same at receiver determination or some step before mapping

Former Member
0 Kudos

I think you can do this by using the Context objects.

First get the Filename into your dummy element in target strcutre using UDF and create the context object between your dummy element and another element which holds the filename with equal conditon and use this context object in the receiver determination.

But I am not sure about it because i never tried this.

<b>UDF as follows:</b>
 DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File",
"FileName");

DynamicConfigurationKey key1 = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File",
"Directory");

String source = conf.get(key);
String tar_dirname = "/mqm/mqmprod/temp/out/ " + source.substring(14,18); */

String tar_fname =source.substring(19,20);
String tar_dirname = source.substring(14,18);

conf.put(key, tar_fname);
conf.put(key1, tar_dirname); 

return tar_fname;

Warm Regards,

Vijay

prateek
Active Contributor
0 Kudos

U can use the conditional receiver determination based on the value of the field. But then i dont think u can access the filename there.

In my opinion, mapping would be the only place to access both payload and the filename.

Workaround: U may try writing a module for the same

Regards,

Prateek

Former Member
0 Kudos

Yes....you can do this with UDF provided by the above or else you can validate your filename by writing the Adapter Module.

Former Member
0 Kudos

thanks for your reply. Is there any blog or something that guides on how to write such an adapter module

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

Did u tried out this scenario using the switch step in BPM.

Regards

Santhosh