UIEvolutin Inc.
UJML Language Reference
State Machine Scoping and Sharing

State machines are scoped identifiers and may be shared.

State machines are identifiers. See Identifiers, State Machines. This means they are available to UJML code according to the scoping rules. See Scope. It also means they may be shared between modules. See Sharing.

State machine scope is context dependent

State machines are scoped to the context where they are declared. See Scope. If a state machine is declared in a module, it has module-level scope. If a state machine is declared in a state machine, it is scoped to that state machine and to any other child state machines that the state machine contains. 

Variables and functions used in scripting code inside of a state machine must be in the same scope as the state machine declaration. See Data Scoping and Sharing.

State machines in state machines

State machines may be contained by 'parent' state machines and may themselves contain 'child' state machines. Functions, variables, and templates inside of state machines may be declared 'public', meaning that they may be accessed from UJML code in the state machine's parent using 'dot notation'. See Data Scoping and Sharing, Function Scoping and Sharing, Template Scoping and Sharing.

Sharing state machines between linked modules

Module-level scoped state machines may be shared by declaring them as exported or imported using the access modifier. See Sharing. This works by exporting them from a parent module and importing them into a child module which the parent has linked to. See Linking Files.

Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
What do you think about this topic? Send feedback!