Disable chain if value not found in response

 

if (searchIndex == -1)
 {
    var details = "Response:\n" + response + "\n\nValue searched for:\n" + stringToFind;
    $context.result.postMessage($context.result.LEVEL_ERROR, "Expected value not found in response to Message " + msg.name, details);
         var chain =  $context.currentClip.getChild("BulkChain 1");
                        chain.setRepeat(
   chain.REPEAT_TIMING_SERIAL, 
    chain.REPEAT_TYPE_COUNT_CONSTANT, 
    0, //THIS means do it ZERO times
    chain.REPEAT_DISTRIBUTION_CONSTANT, 
    0);
   chain =  $context.currentClip.getChild("BulkChain 2");
    chain.setRepeat(
    chain.REPEAT_TIMING_SERIAL, 
    chain.REPEAT_TYPE_COUNT_CONSTANT, 
    0, //THIS means do it ZERO times
    chain.REPEAT_DISTRIBUTION_CONSTANT, 
    0);
}