ModelProgramConstruct
This construct builds a behavior from a model program. The identifier is an optional configuration name that defines the actions to which the model program is bound. If the from clause is omitted, the configuration list for the machine defines the actions to which the model program is bound.
Syntax Definition
ModelProgramConstruct ::= construct model program
[fromIdent]
[where [**Features=String ]
[,Scope=**String ] ] .
Remarks
The String value of Features is a comma-separated list of the feature label names as set using the Feature Attribute in the model program. If the Features switch is present, Spec Explorer gathers only model program elements belonging to the specified features within the applicable scope. If the Features switch is not present, Spec Explorer gathers all model program elements within the applicable scope.
The String value of Scope is a comma-separated list of namespace names. If Scope is specified, Spec Explorer gathers all model program elements within the specified namespaces. Those elements are identified using custom Model Program Attributes. If no scope is specified, only the root namespace ("") is used.
For more details on model programs and the attributes that can be specified there to direct what this construct does, see Model Programs and Model Program Attributes.
The offered signature of the model program construct consists of all the actions that can be initiated by the model program, which are (by construction) a subset of those of the specified configuration.
Example
The following Cord code shows the use of the model program construct. This code is extracted from the stand-alone chat
sample (see Finding the Code Samples).
using Chat.Model;
config Actions
{
action all ChatSetupAdapter;
action all ChatAdapter;
}
machine ModelProgram() : Actions
{
construct model program
where Scope = "Chat.Model"
}
The ModelProgram
machine is based on the Actions
configuration and uses the model program construct to build its machine behavior from the actions declared in the Actions
configuration.
See Also
Reference
Concepts
Model Programs
Cord Syntax Definition