yes, I believe you need to enclose it with Command so it will be executed within transaction and it's status will be persisted. Otherwise you simply change it on a process instance snapshot that is already disconnected and thus does not persist it's state.
HTH