跳转至

Temporary scenarios(临时场景(Temporary scenarios))

Temporary scenarios are created and used only within the current session. Their metadata is not persisted in the platform and will be deleted if the user ends the current session (on Workshop, for example). These scenarios are useful for quick, ad-hoc "what-if" analyses where you do not need to collaborate or share the results. They allow you to experiment with different actions without affecting the state of your Ontology or cluttering your workspace with unnecessary saved scenarios.

Workshop tutorial

In this tutorial, you will walk through building a basic Workshop application supporting temporary scenarios.

Part I: Add the Scenario Manager widget

  1. From a new, empty Workshop module, navigate to the Settings panel on the left side navigation and ensure the Scenarios setting is enabled in the Advanced Functionalities section.

    A Workshop Settings panel with the Scenarios toggle enabled in the Advanced Functionalities section.

  2. In the sidebar section, add a Scenario Manager widget. This is one of the scenario-specific widgets in Workshop and is used to create and manage temporary scenarios that will be used throughout the module.

    Workshop widget search panel showing scenario-specific widgets, including Scenario Manager, Scenario Selector, and Scenario Summary.

  3. From the widget setup panel on the right, configure the Dynamic scenarios field to use a new dynamic scenario. The Create button will appear in the center of the widget.

    Scenario Manager widget configured with a Dynamic scenario variable, showing the Create button in the center.

Part II: Add an Object Table widget

  1. From the body of the module, add an Object Table widget.

    Workshop widget search panel showing the Object Table widget option.

  2. You can use any object set to populate the table, but we recommend starting with an object type that already has at least one associated action configured.

    Object Table widget configuration with an object set and properties selected.

  3. Now, add some properties to display in the table.

  4. Below the properties, enable the option to Load Data from Scenario into this widget. This option effectively makes the Object Table widget scenario-aware.

  5. Select the scenario array variable produced by the Scenario Manager widget. This will cause the data in the Object Table widget to reflect any modifications to scenarios in the Scenario Manager widget rather than the raw Ontology.

    Object table widget configuration showing the Load Data from Scenario toggle.

Part III: Add the Scenario Summary widget

  1. To preview the changes you will be making on the scenario, add the Scenario Summary widget to your module.

  2. In the widget configuration, connect to the active scenario variable generated by the Scenario Manager widget.

    Scenario Summary widget configuration connected to the Active scenario variable from the Scenario Manager widget.

    At this point, no modifications have been applied to the scenario; the data should be the same.

Part IV: Configure an action

  1. Add a Button Group widget to configure an action to apply to your scenarios.

    Workshop widget search panel showing the Button group widget.

  2. Select an action that modifies the object types in your table.

  3. To apply this action to a scenario instead of the Ontology, enable the Apply to Scenario option and select the active scenario variable from the menu.

    The Button group widget configuration showing the Apply to Scenario option enabled with the active scenario variable selected.

  4. Using the newly configured action, try changing the property of any object in the table to a new value.

  5. Before applying the action, create a new scenario in the Scenario Manager widget by selecting Create.

    A Workshop application showing Scenario 1 created in the Scenario Manager with flight data displayed in the Object table.

In the example below, the Year for a flight in the table is being updated. You should see the Object Table widget refresh with the new data.

Edit Flight Demo dialog showing flight property fields with the Apply to Scenario button.

A record will appear in the Scenario Summary widget indicating the change in data. This action has not been applied to the Ontology and exists only within the scenario.

Edit Flight Demo dialog showing flight property fields with the Apply to Scenario button.

Part V: Add a chart widget

  1. To better visualize the results, add a section above the table with a Chart: XY widget.

    Workshop widget search panel showing the Chart: XY widget option.

The Chart: XY widget supports an arbitrary number of scenarios, and different scenarios can be configured in different layers.

Chart: XY widget configuration showing the Compare Against Scenarios option enabled with a Dynamic scenarios variable.

2. Try exploring the various layer types to see how multiple scenarios are visualized in them.

  1. You can also configure Group By and other aggregates, which will properly respect scenario values.

    Workshop application showing the Chart: XY widget with a bar chart visualization grouped by origin airport.

Part VI: Add a Metric Card widget

  1. You can also populate values in metric cards from scenarios. Add a new Metric Card widget.

    Workshop widget search panel showing the Metric Card widget option.

  2. You can configure variable values from scenarios to use in widgets that are not inherently scenario-aware. The Metric Card widget, for example, does not have an explicit scenario configuration section. Instead, in the Metric Card configuration, create a new numeric metric with a value defined by a new object set aggregation variable.

    Workshop widget setting up the value in the Metric Card widget.

    In the variable configuration pane, a Scenario section lets you add a scenario variable. If selected, the aggregation runs with the scenario's modifications applied. Similarly, object property variable configurations also support scenarios.

    Metric Card configuration showing an object set aggregation variable with a Scenario configuration section.

Next steps

Now that you have created your first scenario, we recommend experimenting with various configurations and layouts of the scenario-specific Workshop widgets used in our tutorial.

Persist temporary scenario metadata

If you determine that you do want to persist this scenario's metadata, follow the guidance in our persisted scenarios documentation.


中文翻译

临时场景(Temporary scenarios)

临时场景仅在当前会话中创建和使用。其元数据不会持久化存储在平台中,如果用户结束当前会话(例如在 Workshop 中),这些数据将被删除。此类场景适用于快速、临时的"假设分析(what-if)"场景,无需协作或共享结果。它们允许您尝试不同的操作,而不会影响本体论(Ontology)的状态,也不会用不必要的已保存场景扰乱工作空间。

Workshop 教程

在本教程中,您将逐步构建一个支持临时场景的基本 Workshop 应用程序。

第一部分:添加场景管理器(Scenario Manager)组件

  1. 从新的空白 Workshop 模块开始,导航到左侧导航栏的 设置(Settings) 面板,确保在 高级功能(Advanced Functionalities) 部分中启用了 场景(Scenarios) 设置。

    Workshop 设置面板,在高级功能部分中启用了场景切换开关。

  2. 在侧边栏部分,添加一个 场景管理器(Scenario Manager) 组件。这是 Workshop 中专用于场景的组件之一,用于创建和管理将在整个模块中使用的临时场景。

    Workshop 组件搜索面板,显示场景专用组件,包括场景管理器、场景选择器和场景摘要。

  3. 在右侧的组件设置面板中,将 动态场景(Dynamic scenarios) 字段配置为使用新的动态场景。创建(Create) 按钮将出现在组件中央。

    场景管理器组件配置了动态场景变量,中央显示创建按钮。

第二部分:添加对象表格(Object Table)组件

  1. 在模块主体中,添加一个 对象表格(Object Table) 组件。

    Workshop 组件搜索面板,显示对象表格组件选项。

  2. 您可以使用任何对象集来填充表格,但我们建议从至少已配置一个关联 操作(action) 的对象类型开始。

    对象表格组件配置,已选择对象集和属性。

  3. 现在,添加一些要在表格中显示的属性。

  4. 在属性下方,启用 从场景加载数据(Load Data from Scenario) 选项。此选项可使对象表格组件感知场景。

  5. 选择场景管理器组件生成的场景数组变量。这将使对象表格组件中的数据反映场景管理器组件中对场景的修改,而非原始本体论(Ontology)中的数据。

    对象表格组件配置,显示从场景加载数据切换开关。

第三部分:添加场景摘要(Scenario Summary)组件

  1. 要预览您将在场景中进行的更改,请将 场景摘要(Scenario Summary) 组件添加到模块中。

  2. 在组件配置中,连接到场景管理器组件生成的活动场景变量。

    场景摘要组件配置,连接到场景管理器组件的活动场景变量。

    此时,尚未对场景应用任何修改;数据应保持不变。

第四部分:配置操作(Action)

  1. 添加一个 按钮组(Button Group) 组件,以配置要应用于场景的操作。

    Workshop 组件搜索面板,显示按钮组组件。

  2. 选择一个修改表格中对象类型的操作。

  3. 要将此操作应用于场景而非本体论(Ontology),请启用 应用于场景(Apply to Scenario) 选项,并从菜单中选择活动场景变量。

    按钮组组件配置,显示已启用应用于场景选项并选择了活动场景变量。

  4. 使用新配置的操作,尝试将表格中任意对象的属性更改为新值。

  5. 在应用操作之前,在场景管理器组件中选择 创建(Create) 来创建一个新场景。

    Workshop 应用程序,显示在场景管理器中创建的场景 1,对象表格中显示航班数据。

在下面的示例中,表格中某个航班的 年份(Year) 正在被更新。您应该会看到对象表格组件刷新并显示新数据。

编辑航班演示对话框,显示航班属性字段和应用于场景按钮。

场景摘要组件中将出现一条记录,指示数据已更改。此操作应用于本体论(Ontology),仅存在于场景中。

编辑航班演示对话框,显示航班属性字段和应用于场景按钮。

第五部分:添加图表组件

  1. 为了更好地可视化结果,在表格上方添加一个 图表:XY(Chart: XY) 组件。

    Workshop 组件搜索面板,显示图表:XY 组件选项。

图表:XY 组件支持任意数量的场景,不同场景可以配置在不同的图层中。

图表:XY 组件配置,显示已启用比较场景选项并选择了动态场景变量。

2. 尝试探索不同的图层类型,了解多个场景在其中的可视化效果。

  1. 您还可以配置 分组依据(Group By) 和其他聚合方式,这些设置将正确尊重场景值。

    Workshop 应用程序,显示图表:XY 组件,以柱状图形式按出发机场分组可视化。

第六部分:添加指标卡片(Metric Card)组件

  1. 您还可以从场景中填充指标卡片的值。添加一个新的 指标卡片(Metric Card) 组件。

    Workshop 组件搜索面板,显示指标卡片组件选项。

  2. 您可以配置来自场景的变量值,用于本身不具备场景感知能力的组件。例如,指标卡片组件没有明确的场景配置部分。相反,在指标卡片配置中,创建一个新的数值指标,其值由一个新的对象集聚合变量定义。

    Workshop 组件设置指标卡片组件中的值。

    在变量配置面板中,场景(Scenario) 部分允许您添加场景变量。如果选择了该变量,聚合将应用场景的修改来运行。同样,对象属性变量配置也支持场景。

    指标卡片配置,显示对象集聚合变量和场景配置部分。

后续步骤

现在您已经创建了第一个场景,我们建议您尝试教程中使用的场景专用 Workshop 组件的各种配置和布局。

持久化临时场景元数据

如果您确定要持久化此场景的元数据,请遵循我们的 持久化场景(persisted scenarios) 文档中的指导。