Criminal cases can be resolved in a variety of ways. If a case does not go to trial, it will be resolved by some sort of plea agreement, or diversion, or suspended imposition of sentence (SIS), or a complete dismissal. If a diversion or suspended imposition of sentence is granted, a contract is entered into between the defendant and the prosecutor, whereby each party agrees to do certain things.
The terms and conditions of the agreement are made clear to each party. If the conditions of the diversion or suspended imposition of sentence agreement are alleged to have been violated, the prosecutor can file a motion to revoke the diversion or SIS and bring the defendant back into court to answer the allegations.