cancel
Showing results for 
Search instead for 
Did you mean: 

Write out file from java UDF?

Former Member
0 Kudos

I have a synchronous RFC->XI->HTTP (no BPM) process and need to write out a log of the call details each time it runs. At first, I tried having multiple receivers (one for HTTP and one for log file) in IB:Config, but received an error that I "cannot have multiple receivers when synchronous call".

Should I be able to write out a file using java code in a UDF? Should I do something with a BPM (and if so, any hints)?

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

It deppends on which kind of log you want and how much time you're willing to spend on this.

If you want to learn BPM and has available time to learn and implement, go for it. It will provide you more flexibility (since you can use any adapter protocol) and is way better for maintenance purposes.

Your BPM will basically have 4 steps:

1. A Receiver step in "Open S/A Bridge" mode;

2. A Sender step in Asynchronous mode (to send the log message to your target system);

3. A Sender step in Synchronous mode (to send the request to HTTP and receive the response);

4. A Sender step in "Close S/A Bridge" mode.

The mapping can be made in three ways:

1. mapping between RFC and BPM (so your BPM will have abstract interfaces based on HTTP interface); or

2. mapping between BPM and HTTP (so your BPM will have abstract interfaces based on RFC interface); or

3. create 2 transformation steps in the BPM, one to map from RFC.request to HTTP.request and the other to map from HTTP.response to RFC.response (I'd not recomend this).

Regards,

Henrique.

Answers (2)

Answers (2)

Former Member
0 Kudos

Just put System.out statements in your code and they should get redirected to the defaultTrace file on your server.

The whole code to the best of my knowledge works inside EJB environment ..so a word of caution...dont attempt to do any explicit file I/O in your code...it is discouraged by EJB specification.

Former Member
0 Kudos

Thanks everyone. I will go to work on a BPM and post my conclusion.

Former Member
0 Kudos

Henrique (or others):

I have the syncronous call and response back to RFC working, but my async log file is not getting sent (and I am not getting any errors for the step).

I am trying to map the HTTP response data to a log format and then send the log file via FTP, both after the "close bridge" step. I notice that your recommended steps pertain to sending the async without mapping and prior to closing the bridge? Should it work as I have it?

BPM:

syncReceive -> syncSend -> syncReponse -> translation to log format -> asyncSend

Thanks!

henrique_pinto
Active Contributor
0 Kudos

Keith,

I didn't mention the mapping to the log format because you could have done it in Configuration Time. But your scenario should work as well. You don't need to perform close bridge step at the end.

You can see the message being sent asynchronously in SXMB_MONI? What does the message monitoring for adapter engine says about the FTP request?

Regards,

Henrique.

Former Member
0 Kudos

Hi,

Well, to do it "correctly", you can use ccBPM, which includes a file sender to the log file.

Then, you can also develope a user-function for a message mapping, most likely for the response message so that the log can contain some response info. This way, you can avoid ccBPM. The user-function should be pretty simple java...just appending to a file.

Regards,

Bill