1. A computing device-implemented method comprising: receiving an indication that a variable is a resettable variable in a selected part of a state diagram model within a graphical modeling environment, wherein the resettable variable is hierarchically scoped and has a value; assigning a first value to the resettable variable before or during an invocation of the selected part of the state diagram; setting the resettable variable to a second value during the invocation of the selected part of the state diagram; and automatically resetting the resettable variable to a preset value before or during a subsequent invocation of the selected part of the state diagram model containing the resettable variable, the resetting including: resetting the value of the resettable variable after the selected part of the state diagram is awakened but before the resettable variable is accessed in the selected part of the state diagram.