Tagged SERVER SCRIPTS

Oracle SaaS Stories: Invoking a Service when an Entity is Created/Updated


In this episode we are explaining one of the many mechanisms for executing actions when changes happen in the Cloud App Environment.

In this particular case, as an example, we are calling an external REST service hosted in a kubernetes cluster, that implements a counter. Every time we create or modify a Contact, the external service is called.

Hands on!

Enter in the environment with a user with al least ORA_ASM_APPLICATION_IMPLEMENTATION_CONSULTANT_JOB

Go to “Manage Sandboxes”:

Create a new sandbox and set active:

Go to Application Composer:

Click on “Common Setup-Web Services”:

Create a new Web Service:

Select REST/SOAP appropriately:

Put the information of your service endpoint:

Search for the “Contact” business object, click on “Server Scripts”, then “triggers”, then click on “create”:

Crate a trigger of type “After Create”:

Go to the Web Services tab on the right pane, locate the service you want to invoke and click on “insert”:

The code invoked when a new contact is created is put in the editor. Save it.

NOTE: You can create another trigger for other events, such as “AfterTransactionPosted”, etc.

Let’s test it!

Check the status of the external web service:

Go to the Contacts Menu:

Create a new contact, for example Abelardo Pirindiki:

Check the status of the external service and see it has been called:

And that’s all folks, hope it helps! 🙂