In this scenario, a Mock API will be created on Apinizer. In the request, stop=true value will be added to customVariableMap variable using script.
Next, a Business Rule policy will be added to check the value in customVariableMap. If this value is stop=true, the request will be prevented from going to the backend
Let's add policies via Add policy.

Add Script and Business Rule as policy.

By selecting the Groovy language in the script policy, stop=true will be assigned to the customVariableMap value.

Select the stop action we specified in the Business Rule policy.

Select 'Custom Variable' from the Conditions field and type stop in the name field and save.

With the rule you added below, if the value in customVariableMap is 'true', the request will not be forwarded to the backend.

When the test is performed on the console below, a response message is returned indicating that the request has been stopped.
