I recently found a script transform that someone had written that was doing other things in it besides returning a value, like writing values to other tags. My initial reaction was that you should never perform ancillary tasks within a script transform, mainly since you want the GUI components to update as fast as possible, so adding extra stuff will slow down the transform. Additionally, it's not an obvious place to put writes to other tags or other variables like custom session props, making it more difficult to maintain. I would consider it an anti-pattern.
For these things, I would normally use an on value change script on a custom property, or similar.
I wondered though if there's any other reason that these actions shouldn't be performed?
By ancillary tasks, I'm talking about calling:
- system.tag.write*
- system.db.runPrepUpdate
- self.session.custom.propName assignments
- etc.