# Model resource clean after renaming entities?

**URL:** https://discourse.kitware.com/t/model-resource-clean-after-renaming-entities/436
**Category:** Using SMTK
**Created:** [March 29, 2020, 7:27pm UTC](https://discourse.kitware.com/t/model-resource-clean-after-renaming-entities/436 "2020-03-29T19:27:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [March 29, 2020, 7:27pm UTC](https://discourse.kitware.com/t/model-resource-clean-after-renaming-entities/436/1 "2020-03-29T19:27:53Z")

</div>

I observed that when I rename a model entity – by calling smtk;:model::EntityRef::setName() – the model resource’s clean flag does **not** get reset to the false state. (I can post a test to demonstrate.) Should that be changed, or if not, should we add a comment in EntityRef.h that setName() does not affect the resource clean flag?

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [March 29, 2020, 8:27pm UTC](https://discourse.kitware.com/t/model-resource-clean-after-renaming-entities/436/2 "2020-03-29T20:27:10Z")

</div>

Only operations invoke observers to inform them that things have changed. You should use the [SetProperty](https://gitlab.kitware.com/cmb/smtk/-/blob/master/smtk/operation/operators/SetProperty.sbt) operation to set a string property on the component. Then all of the updates you expect should occur.

---

<div class="post-metadata">

### Author: ![johnt](https://discourse.kitware.com/user_avatar/discourse.kitware.com/johnt/32/147_2.png) [@johnt](https://discourse.kitware.com/u/johnt)
#### Post date: [March 29, 2020, 8:41pm UTC](https://discourse.kitware.com/t/model-resource-clean-after-renaming-entities/436/3 "2020-03-29T20:41:03Z")

</div>

Got it, thanks. I presume, then, that the entity name is now/also a string property with the property name “name”.

Next time we update smtk/resource/Resource.h, maybe we should expand on the comment for the clean() method:

```auto
/// Indicate whether the resource is in sync with its location.

```

It would be good to state that applications making direct API calls must also call `setClean()` to reset the flag.
