Some times there is a tray on the bottom of dishwashers. In this tray there is a polystyrene float connected to a micro-switch. If the machine floods tray fills up, trips micro switch trips switches off water.
Check micro switch is working ok sometimes the float moves out of position and jams...