Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to read the element of the payload/ payload in Java embedding activity

Kumar_9985May 18 2016 — edited Feb 26 2020

Hi Friends,

we have a scenario where we creates a config file .cfg from SOA process.Currently when ever this operation is ran it overrides the new file. So our user has asked to move the earlier file to backup with timestamp and then proceed of creating the new file. Currently we followed the approach of LIST, MOVE and WRITE file approach and its working.

But as we have unix box i thought of going a approach by creating a simple shell script in unix(which do move operation) and call it from java embedding activity.

In Java embedding activity if i use (String) getVariableData(<new variable>) then its working, but this requires a <new variable> to get assigned before using in java embedding.

I want to read the element of the payload. Blogs told i can use XMLELEMENT/ ELEMENT/TEXT function. But its not working i observed this by keeping addAuditTrailEntry() function.

Can anyone let me know

1. How to read element from payload? and assign it to a Sting?

2. How to read payload and assign it to String?

I tried below from blogs, but they are not giving output


Element inputParam= (Element)getVariableData(“inputVariable”,”payload”,”/client:process/client:input”);

addAuditTrailEntry(inputParam.getTextContent());


String input = ((XMLText)getVariableData("inputVariable", "payload", "/client:process/client:input/text()")).getText();

addAuditTrailEntry(input);


Thanks in Advance

Kumar

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 17 2016
Added on May 18 2016
4 comments
4,091 views