
package AOMCase;

import com.metamaxim.modelscope.callbacks.*;

public class CreateCrisis extends Event {

  public void handleEvent() {
	  //Send the Create Crisis to the model
	  this.submitToModel();
	  //If there is a witness name in the event, add an associated Witness to the Crisis
	  if (!this.getString("Witness Name").equals("")) {
	  	Event addWitness = this.createEvent("Add Witness");
	  	addWitness.setNewInstance("Witness", "Witness");
	  	addWitness.setInstance("Crisis", this.getInstance("Crisis"));
		addWitness.setString("Person Name", this.getString("Witness Name"));
		addWitness.setString("Witness Report", this.getString("Witness Report"));
		addWitness.submitToModel();
	  	}
	}

}


