How to stop other business rules if the first business rule is aborted

Harsha Vardhan6
Mega Expert

Hi Comunity,

I have a set of business rules and I had given setAboartAction for the first one.

This BR is aborting the user in submitting the incident.

But the problem is that remaining business rules are also running even after AboartAction happens in first BR itself.

Kindly let us know the solution for the same.

 

Thank you,

 

Harsha Vardhan,

1 ACCEPTED SOLUTION

ARG645
Tera Guru

So, below your setAboartAction line of code. use setWorkflow(false) to stop other business rules from executing. 

setWorkflow(false) is specially used for stopping business rules to fire, and this may be the exact thing you are looking for.

current.setWorkflow(false);

 

References : 

What is the use of setWorkflow(false)

View solution in original post

3 REPLIES 3

William Busby
Tera Guru

My first thought would be to create a property which the first business rule can set as a go/no go flag. For the remaining rules just check the property and exit if the first rule has set it to abort. Just make sure every potential exit condition, even exceptions, sets the flag to either a success or abort condition in all cases. Use try/catch blocks, etc.

If this is helpful or answers your question please mark it so.

Shashwat  Saxen
Giga Expert

var incGR = new GlideRecord('incident');

// query condition

 

if(incGR.isAbortedAction()==true){

incGR.setWorkfllow(flase);

}

ARG645
Tera Guru

So, below your setAboartAction line of code. use setWorkflow(false) to stop other business rules from executing. 

setWorkflow(false) is specially used for stopping business rules to fire, and this may be the exact thing you are looking for.

current.setWorkflow(false);

 

References : 

What is the use of setWorkflow(false)