public function set_metadata($name, $value) {
        $firststep = $this->get_step(0);
        if (!$firststep->has_metadata_var($name)) {
            $this->observer->notify_metadata_added($this, $name);
        } else if ($value !== $firststep->get_metadata_var($name)) {
            $this->observer->notify_metadata_modified($this, $name);
        }
        $firststep->set_metadata_var($name, $value);
    }