Oracle SOA Suite (MOSC)

MOSC Banner

Javascript Issue in OSB

I have written JS block in OSB: process.status = (process.input.Emp.Status ? "A":"I") — if the input consists of this value assign A else assign I.

The problem here is if I have a hierarchy of Emp→Status it works fine, but if the hierarchy is not there it gives me error: OSB JavaScript action failed: TypeError: Cannot read property "Status" from undefined (<OSB JavaScript expression>#1)

I also gave optional chaining operator (?.) — but this gives syntax error. Can someone please assist. How can I assign default value if the tag does not appear.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center