Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Troubleshooting > I have to perform a refresh to see the script changes
  
I have to perform a refresh to see the script changes
The scripts provide special functions that allow you to make changes to the model through a transaction.
If you have to refresh the Modeler views to see the changes made by a script, the script that is making changes to the model is not within a special function.
To resolve this problem, locate the script that is making changes to the model, and move that script to within the special function that is appropriate for the script type. The functions that make changes to a model through a transaction are as follows:
For Diagram Toolbar Scripts - use the OnFinished script function. See:
Script functions, attributes and objects — diagram toolbar button script for adding links
Script functions, attributes and objects — diagram toolbar button script for adding nodes
Script functions, attributes and objects — overview
Script template for diagram toolbar button scripts for links
Script template for diagram toolbar button scripts for nodes
For Double-Click Scripts - use the CommitDoubleClick script function. See:
Script functions, attributes and objects — double click scripts
For Menu Command Scripts - use the CommitMenu and AfterMenuCommit script function. See:
Script functions, attributes and objects — menu command scripts
For On Drop Scripts - use the OnDrop script function. See:
Script functions, attributes and objects — on drop scripts for diagram
Script functions, attributes and objects — on drop scripts for items
Script functions, attributes and objects — overview
Script template for on drop scripts for diagrams
Script template for on drop scripts for items
For Utility Scripts - use the CommitUtility script function. See:
Script functions, attributes and objects — utility script.
Making changes to the model through the preceding functions also minimizes disruption to other users because of item locking. In addition, you will be able to undo the changes made by the script.
* 
On Delete and Derivation Script scripts do not have any functions specifically for making changes to the model.