Theoretically it is possible to stop a line (machine) before it starts making rejects. Based on several statistical rules we can detect various machine drifts and raise an alarm although all the parts that a machine is making are still good.
For this we would normally use a readily available SCADA package with the SPC module, like WonderWare with SPC Pro.
SPC alarm lists bunch of rules we can use to generate an alarm and stop the machine.