Monday, May 9, 2022

OIC - Generate Random number using Javascript function in Oracle integrations

Use Case: We will generate Random number based on number of digits required using Javascript function.

Example, if we put input digit = 3 that means it will generate a random number between 1 and 1000.

Javascript function:

RandomNumber.js

function generateRandomNumber(digit){

var RandomNum=Math.floor((Math.random() * digit) + 1);

return RandomNum;

}

Steps in detail(With Screenshots):

Upload the Javascript code to OIC Libraries




Create a lookup for random digit 


Create App driven Integration


Call Rest Trigger and configure







Call Javascript action and select the created randomNumber function.




Provide the digit value with LookupValue









Map the js response to trigger reply.



Test



No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...