跳转至

Upgrade to use rule Actions(升级以使用规则操作(rule Actions))

:::callout{theme="warning"} These steps are for legacy versions of Foundry Rules (previously known as Taurus). If you are just starting to deploy Foundry Rules, then the following steps are unnecessary and are already included as part of the default setup. Unless you've been specifically directed to this section, you likely do not need to follow these steps. :::

Previously, Foundry Rules only supported dataset inputs to rules and had no concept of a rule Action. While authoring rules on objects is an optional feature, we strongly recommend upgrading to use rule Actions, especially if you upgrade to use objects.

To enable objects and rule Actions in Foundry Rules, follow the steps below:

All screenshots use notional data.

  1. Upgrade your Foundry Rules transforms library version: Ensure that tau-execution:tau-execution-core is on at least version 0.60.4, in the Project level build.gradle file:
  2. compile "com.palantir.tau-execution:tau-execution-core:0.60.4"
  3. If you can't find the build.gradle file, then check the Show hidden files and folders option in the Files sidebar under the gear icon.

  4. Update the logic version: Using edit mode in your Foundry Rules Workshop application, navigate to the Rule Editor widget and change the Logic Version to be "V1". While changing this selector has no destructive effects, it is not possible to change the version back to V0 after changing it to V1. However, there would be no benefit in returning to V0.

    Selecting V1 logic version within the workshop app

  5. Add objects to the Workshop application: In the same Workshop application, add any object types you wish to make available within Foundry Rules to the Permitted object types object set variable. This variable should be a unioned object set of all the object types you wish to expose, as shown below.

  6. If you are switching from a dataset to a corresponding object, then you should keep the dataset available in Foundry Rules until all of the existing rules have been migrated to use the object. However, there is no urgency to switch to using the object immediately, as the transform can continue to function with both declared.

    Adding additional input objects to workshop app

  7. Add rule Actions: After creating a suitable Foundry Action in the Ontology Manager, add the Action to the Workshop application by clicking Add Rule actions.

Learn more about configuring rule Actions.

<img src="./media/rule_action_configuration.png" alt="Configuring the available rule actions" width="500" />

:::callout{theme="neutral"} After adding a rule Action to the Workshop configuration, all existing rules will require you to configure a rule Action the next time each of them are edited. However, it is important to note that even without a rule Action configured for each rule, the old transforms pipeline will continue to work. Therefore, there is no downtime associated with migrating, and the migration can be done at a pace that suits the users. :::

  1. Update the transforms pipeline code: The simplest way to update the transforms pipeline is to update your existing instance of the rules workflow template within the Ontology Manager by adding the missing objects and Actions. Then, deploy the updated transform to use as a reference. After deploying the reference, you can configure the transforms pipeline to map this new code to your existing workflow.

:::callout{theme="neutral"} As noted above, for the new transforms code to work, all rules must have a rule Action configured. Therefore, we recommend making the transform changes on a branch and testing those transform changes before merging. :::


中文翻译


升级以使用规则操作(rule Actions)

:::callout{theme="warning"} 以下步骤适用于旧版 Foundry Rules(原名 Taurus)。如果您刚开始部署 Foundry Rules,则无需执行以下步骤,因为这些功能已包含在默认设置中。除非您被特别指引到本节,否则很可能不需要遵循这些步骤。 :::

此前,Foundry Rules 仅支持将数据集输入用于规则,且没有规则操作(rule Action)的概念。虽然基于对象编写规则是一项可选功能,但我们强烈建议升级以使用规则操作(rule Actions),尤其是在您升级以使用对象时。

要启用 Foundry Rules 中的对象和规则操作,请按照以下步骤操作:

所有截图均使用示例数据。

  1. 升级 Foundry Rules 转换库版本: 确保在项目级别的 build.gradle 文件中,tau-execution:tau-execution-core 的版本至少0.60.4
  2. compile "com.palantir.tau-execution:tau-execution-core:0.60.4"
  3. 如果找不到 build.gradle 文件,请检查文件侧边栏中齿轮图标下的显示隐藏文件和文件夹选项。

  4. 更新逻辑版本: 在 Foundry Rules Workshop 应用中使用编辑模式,导航至规则编辑器组件(Rule Editor widget),将逻辑版本(Logic Version)更改为"V1"。更改此选择器不会产生破坏性影响,但一旦更改为 V1,就无法再改回 V0。不过,返回 V0 也没有任何益处。

    在 Workshop 应用中选择 V1 逻辑版本

  5. 向 Workshop 应用添加对象: 在同一 Workshop 应用中,将您希望在 Foundry Rules 中使用的任何对象类型添加到允许的对象类型(Permitted object types)对象集变量中。此变量应为所有您希望暴露的对象类型的联合对象集,如下所示。

  6. 如果您正在从数据集切换到对应的对象,则应保持数据集在 Foundry Rules 中可用,直到所有现有规则都已迁移为使用该对象。不过,无需立即切换到使用对象,因为转换可以在同时声明两者的情况下继续运行。

    向 Workshop 应用添加额外的输入对象

  7. 添加规则操作:本体管理器(Ontology Manager)中创建合适的 Foundry 操作(Action)后,通过点击添加规则操作(Add Rule actions)将该操作添加到 Workshop 应用中。

了解更多关于配置规则操作的信息。

<img src="./media/rule_action_configuration.png" alt="配置可用的规则操作" width="500" />

:::callout{theme="neutral"} 将规则操作添加到 Workshop 配置后,所有现有规则在下次编辑时都需要您配置一个规则操作。但需要注意的是,即使没有为每条规则配置规则操作,旧的转换管道仍将继续工作。因此,迁移过程不会导致停机,您可以根据用户需求自行安排迁移进度。 :::

  1. 更新转换管道代码: 更新转换管道的最简单方法是在本体管理器中更新现有的规则工作流模板实例,添加缺失的对象和操作。然后,部署更新后的转换作为参考。部署参考后,您可以配置转换管道,将此新代码映射到您现有的工作流。

:::callout{theme="neutral"} 如上所述,要使新的转换代码正常工作,所有规则都必须配置一个规则操作。因此,我们建议在分支上进行转换更改,并在合并前测试这些转换更改。 :::