REST API- IF condition
Application Type
Traditional Web

i have created two applications Employee and Agent. I have inserted data into agent application through REST API consume method. Now i want to stored it also on employee local database once its stored on agent database. So how to write if condition in employee app. please give some suggestions.

In Incident App I created this action (set to public) that will save the Incident in Incident App table:

In Agent App I call the action created above:


Hi Ajit,

you want to insert on a Employee application table from the Agent application, right?

You should create an action on Employee aplication (set as public) that receives as input parameter the data you want to save. Then in Agent application, go to Manage Dependencies and add the action created from the Employee actions, call it on your code and pass the data you want to save to.

Manage Dependencies:

Regards

Hi,

without dependency i want to consume the agent app data into the emp app through REST.

Currently data is stored in agent app. Now  when data get stored in agent database then how emp should able to save it in thier local database? 

 Please find the attached oml.

IncidentTrackerEmployee.oml

IncidentTrackerAgent.oml

In the same way you can create an action, you can also expose a REST API in Employee app. That API can receive the data you want and save in the database. Call it from the Agent application.

Hi, Thanks for your reply.

Here criteria is agent will not expose again. Now in employee app when consume method succesfully done then data should be saved in local database of employee. i hope you will get it now.


In Incident App I created this action (set to public) that will save the Incident in Incident App table:

In Agent App I call the action created above:


Hi jose,

Now i want to perform update operation with the PUT method. If Agent update something then same ID shoud be updated as well emp database. Do you have any logic for this one.

And i am really thankful for your help.

If you need to update as well, you can replace the CreateIncident entity action for the CreateOrUpdateIncident. Passing the IncidentId in the input variable he will update the record and not add a new one.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.