cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime constant (Filename) errors out in BPM

Former Member
0 Kudos

Hi,

I have a BPMCollectTime scenario to collect the Source files. The filename (Message Mapping/Transformation) from the files is captured in TRANSFORM STEP(before sending them out from BPM). The file is sent to SEND step one at a time.

Question : Filename of the source file is captured through user defined function.

Following is the code.

================

String v_result_time; //test Variable

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

if (key == null) { v_result_time= "Create Key Failed";}

else

{v_result_time= "Create Key worked";

String valueOld = conf.get(key);

v_result_time = valueOld;

}

return v_result_time;

-


The Mapping gives a runtime error in the BPM. This is a sporadic error.

I have selected the Adapter specific attribute(File name).

The BPM errors out sometimes? I am not sure if I am missing any setting. If I delete the work item and run the same scenario it works.

Question 1 : What is the cause of the above error?

Question 2 : Does BPM support Adapter specific attribute such as filename?

Kindly Advice.

Thanks,

Gowri

Accepted Solutions (0)

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

Gowri,

I read before in the forum, that Dynamic Configuration parameters can't be used inside BPM. I'm not sure, lemme give you the exact thread.

Best regards,

raj.

Former Member
0 Kudos

Raj,

If the Dynamic configurations cannot be used in BPM, then How do i capture the filename from the files. I have 2 transformation. What it does it it gets the filename from 1st transformation and relate it to the response file. the end user receievs the update if the file was sent successfully/failed.

Kindly Advice.

Thanks,

Gowri

justin_santhanam
Active Contributor
0 Kudos

Gowri,

Can you tell us the exact scenario . So that it could be easy to suggest. Are u using file name as the correlation element.Can u please clarify the scenario.

Best regards,

raj.

Former Member
0 Kudos

Hey

even i don't think dynamic config. is possible in BPM.

you need to split the scenario into three separate scenario,in the first one get the name of File by dynamic configuration and write this to a file(lets call it File_name),now kick the second scenario ,get the response(successful or failure) and append this response to the previous file(File_name).

Now you have a File which has the File name as well as the response,now the third scenario kicks in,use a CreateIf condition in message mapping(populate the receiver node only if status=successful) and send the message finally to receiver.

i know it looks too tedious,its just my view,may be we have some less complicated method too:)

let us know if you have any questions

thanx

Ahmad

Former Member
0 Kudos

Ahmed and Raj,

I am not quite clear about the 3 separate scenario you mentioned.

Let me explain my scenario :

I have multiple invoice files that needs to go to one at a time to the DTN Server. The invoice file is in flat file format(txt format). When an invoice is sent to DTN Server, DTN sends a response file which is again a flat file with .rsp extension. Response file is parsed for ABORT or INVALID string.

An Alert message is sent to users incase of response not received for following invoice file.

An email is also sent incase of response received successful or failure by parsing the response file for ABORT/INVALID message.

For both cases we should know the invoice file name to link the response file.

My current scenario was defined in BPM.

1. Invoice file is collected for a 1minute (BPMCollectTime) used.

2. An Until loop is defined for each invoice.

a) The filename is captured from dynamic configuration in Transformation step. The transformation step is defined instead of container operation because container variable cannot be used to map to second transformation. Let me know if this is correct.

b) Invoice file is sent to DTN Server.

c) A block is defined waiting for response file for 2minutes (Deadline monitoring)

d) If response file arrives before deadline, an email is sent to user with the invoice filename Successful or Failed.

e) If the deadline is reached without response file, An Alert message is sent to users that the Invoice file did not receive any response from DTN Server.

f) the until loop continues for next invoice file.

I hope this clarifies or helps you to guide me on how i can retrieve filename for the invoice file on above sitiuation. If you have any further question, please reply me back.

Thanks for your help.

Gowri

Former Member
0 Kudos

Hey

as far as i know,its not possible to use dynamic configuration in BPM.

you need to get the File name first of all.for that you can create one scenario of a simple File to File by using dynamic configuration(suppose the file name you got is File_sender).so now your receiver will be exact copy of the sender plus one extra file <filename>(<filename> stores the name of file)

now design a second scenario and send this File_sender to RFC,get the response back from RFC and send it to designated receivers.

hope its less complex than splitting in three scenarios:)

thanx

Ahmad

bhavesh_kantilal
Active Contributor
0 Kudos

Gowri,

Dynamic Configuration is accessible inside a BPM. So you can access the source filename inside your BPM ins a transform step. There should be no issue on that front. Just gave it a shot and things work fine.

My question to you here is how is the correaltion defined between the Request and repsonse Files? Is there some unique field etc?

Or do you plan to use the Context Object FileName to act as the Correaltion Id? Correaltion with Context Objects do not seem to work. I have given this a shot as well and have also seen a few posts here on SDN where it has been seen that Context Objects do not work for Correaltion.

Regards

Bhavesh

Former Member
0 Kudos

Hi Gowri,

How are you getting the invoice to XI ?

<i>DTN sends a response file which is again a flat file with .rsp extension.</i>

Cant you ask DTN to send you the filename as content.

Secondly if you are not able to use dynamic configuration inside BPM then you can do a mapping between the interface which is used to read .rsp file and the abstract interface which is used in receive step in bpm.

Regards,

Sumit

Message was edited by:

Sumit Khetawat

Former Member
0 Kudos

Hi Everyone,

Thanks for all the help.

DTN will not change the response filename to source filename. This option cannot be used. The correlation id is defined as response file name. Response filename is fixed for invoice file.

Here is the example.

For invoice file name HDTN20070430163110.TXT, response file received is nav1_2b5.rsp file. For HDTN20070430163314.TXT , response file is nav1_2b5.rsp

So my correlation id is dummy fixed value. I have known the fact that it is not possible to use context object filename.

Bhavesh - I have defined transform step for accessing filename using dynamic configuration. Following is the code used in mapping.

================

String v_result_time; //test Variable

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

if (key == null) { v_result_time= "Create Key Failed";}

else

{v_result_time= "Create Key worked";

String valueOld = conf.get(key);

v_result_time = valueOld;

}

return v_result_time;

====================================

BPM errors out sometime with following error

Component mapping has returned error.

com/sap/xi/tf/_MM_DTNData_2_DTNFilename_java.lang.NullpointerException.

Error: Exception CX_MERGE_SPLIT occurred (program: CL_MERGE_SPLIT_SERVICE========CP, include: CL_

If I delete this workitem and repeat the same scenario, it works. I have still not understood, why the scenario works sometime.

Kindly Advice.

Thanks,

Gowri

Former Member
0 Kudos

Sumit,

I was thinking the same. My problem is I am collecting the invoices in BPMCollectTime. This will be 1: 2 mapping as shown below.

Source Invoice file -> Abstract Invoice File and

Filename Message Interface (Abstract)

I guess, I have to define 2 receive step to capture Abstract Invoice and Abstract Filename message interface.

I am collecting(Append) the Abstract invoice in a container, Will that shuffle the order of the invoice received? If so, I will not be able to correlate with the Filename receive step.

Kindly Advice.

Gowri