Workshop: Embedded module widget(Workshop:嵌入式模块组件(Embedded module widget))¶
This page discusses Workshop's Embedded Module widget. For an overview of Workshop embedding features, see the embedding overview page.
Configuration¶
The Embedded Module widget configuration allows a builder to select a module to embed, and define a mapping of variables in the current module to module interface variables of the embedded module.

Module selection¶
To configure the embedded module widget, first select a child module to be embedded via the Compass resource selector. The published version of the child module will always be used when embedding.
Interface configuration¶
Once a child module is selected, the module interface for the child module will be shown in the widget configuration panel. This allows you to map parent module variables to child module interface variables. The parent module's variable definitions will be used to back variables that are fully shared between the parent and child modules. Any change to a variable value in either the child or parent module (for example, from a widget output or set variable value event) will be reflected in all modules where the variable is mapped.
Since the child module's variable definitions are not used for mapped variables, default variable values of mapped variables defined in the child module will not be used. Similarly, this means that any variable recalculation behaviors of mapped variables defined in the child module's variable definitions (such as usage of a function to back a variable value or variable transformations) will not be used. In the case of a reset variable value event, the variable's value will be reset to the default value set in the parent module's variable definition.
中文翻译¶
Workshop:嵌入式模块组件(Embedded module widget)¶
本页面介绍Workshop的嵌入式模块(Embedded Module)组件。若需了解Workshop嵌入功能的整体说明,请参阅嵌入功能概览页。
配置¶
嵌入式模块组件的配置功能允许构建者选择要嵌入的模块,并定义当前模块变量到被嵌入模块的模块接口变量的映射规则。

模块选择¶
如需配置嵌入式模块组件,请首先通过Compass资源选择器选择要嵌入的子模块。嵌入操作始终会调用子模块的已发布版本。
接口配置¶
选中子模块后,子模块的模块接口(module interface)将显示在组件配置面板中。你可以在此将父模块变量映射到子模块的接口变量。父子模块间完全共享的变量将以父模块的变量定义为准。无论子模块还是父模块中的变量值发生变更(例如来自组件输出或设置变量值事件(set variable value event)),所有映射了该变量的模块都会同步更新对应值。