cancel
Showing results for 
Search instead for 
Did you mean: 

How to store Payload variable and use it for the next run - Java Mapping?

nitinlpatil12
Participant
0 Kudos

Hi Experts,

I have a following Scenario where I need a time stamp from the first response from Ariba to be sent in the Second Request.

Regards,

Nitin Patil

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

if you are in a single server environment (no clustering, only one as java instance) you could use a static variable in your java mapping (which would be not too elegant) - otherwise you have to use a database field

br

franz

nitinlpatil12
Participant
0 Kudos

Hi Ferner,

We are in dual stack environment and any help on Java mapping code for storing and retrieving the time stamp field/xml will be very useful.

Regards,
Nitin Patil

former_member184720
Active Contributor
0 Kudos

They are two different transactions. It's good to handle it in the sending system itself.

If it is a standard (sender doesn't want to modify the process), then store this information using RFC/JDBC lookup during the response mapping.

nitinlpatil12
Participant
0 Kudos

Hi Hareesh/Experts,

Sorry I could not explain the whole scenario and draft got automatically submitted.

Here is the full scenario, I have BPM - Async- Sync1 - Sync2 - Sync3 Scenario between Legacy System ad Ariba to pull the Order Confirmation and ASN using Pull method (defined by Ariba).

For which Response of Sync1 contains a Timestamp1 (T1) and I need to store it on Server at runtime before Response from Sync1 is passed to Request to Sync2 and when the next cycle of Scenario runs T1 needs to be passed to Request of Sync1.

1st Run -

Async ---> Request (Pass Timestamp T0) ---> Sync1 ---> Response (T1 - Store on Server) ---> Sync2 ---> Sync3

2nd Run -

Async ---> Request (Read from Server - T1) ---> Sync1 ---> Response (T2 - Store on Server)---> Sync2 ---> Sync3

Can we include any of JavaMapping at Runtime to store Timestamp T1 on PI server or are there any other option? Please share if you have any code for this requirement.

Best Regards,

Nitin Patil.

nabendu_sen
Active Contributor
0 Kudos

Hi Nitin,

Check this one:

Regards,

Nabendu.

Former Member
0 Kudos

Hello Nitin,

The time stamp of a message is contained in header part. So in order to record the time stamp there is one mandatory requisite that time should be present in ASMA settings. AFAIK, in ASMA settings we have File Name, Contract etc. So, in my opinion java code is not possible to get timestamp.

However you can achieve the same in ABAP coding (in the form of proxy code) which will be present in every sync for response.

The variable for date is SY-DATUM and that for time zone is SY-UZEIT. In the coding part you can concatenate these two variables and pass it to the subsequent systems which you have explained above in the payload as an extra field.

I hope I was clear enough in my explanation .

Kind Regards,

Souvik

nitinlpatil12
Participant
0 Kudos

Hi Nabendu,

Thanks for the reply, as I need to use the timestamp when the BPM run next time and not in the same call, is the solution you had suggested will work in that case, please confirm.

Hi Souvik,

Thanks to you too for your inputs, in my case I need timestamp to be mapped from the child structure and not from the header. I am not sure if the solution you suggested still applies, please confirm.

Please guide.

Regards,

Nitin Patil

Former Member
0 Kudos

Hello Nitin,

Thanks for your detailed inputs.

Sorry if I had misunderstood your point previously.

In this specific case you need to use time stamp field from the data structure in a global container used in java mapping. Here, there will be a udf where the time stamp will be used as a return value. These subsequent time stamps can be then further used across various systems.

Kind Regards,

Souvik

nitinlpatil12
Participant
0 Kudos

Hi Souvik/eExperts,

Thanks for your reply, can you please help me with the Java mapping code for storing the timestamp on server and retrieving it in the next run from the server and reading it runtime from XML.

Regards,

Nitin Patil

former_member192851
Active Participant