Stop a Business Rule from executing

thisisauniqueus
Giga Expert

Hi,

I have a setup where i am receiving REST request from 3rd party, i have used scripted REST API, and in response to incoming request i create/update a Demand ticket. So far so good. For send back updates i have created an update BR and using REST Message to send the updates back to 3rd party.

The problem is when the 3rd party sends an update request the BR is also triggered which should only be triggering when the updates are made in my instance. I have tried using

gr.setWorkFlow(false);

in the script to update the ticket from 3rd party, but that stops the additional comments and all the journal input fields to be updated, because i guess the journal fields are populated using a BR too. So my question is how can i make the BR to fire only when the update is made directly from the form NOT from the scripted REST API script?

Any help in this regards is appreciated. Kindly let me know if you need any additional information.

Regards,

JS

20 REPLIES 20

pawan k singh
Tera Guru

I think you can check for the interactive session whether it is true or not, gs.getSession().isInteractive()!=true if true, abort the business rule to trigger.

 

For ex:- Below script

if(gs.getSession().isInteractive()!=true){


current.setAbortAction(true);


 

Regards 

Pawan K Singh