Customize your Foundry Rules pipeline(自定义 Foundry Rules 管道)¶
:::callout{theme="warning"} Customizing your Foundry Rules pipeline is an advanced feature intended for experienced Foundry pipeline authors. This customization can result in increased implementation and maintenance burden for workflow administrators. :::
Foundry Rules does not require users to write any pipeline logic out of the box. However, some use cases warrant customizing the Foundry Rules pipeline in order to achieve an outcome that is otherwise not possible.
Use cases¶
Customizing your Foundry Rules pipeline can provide a number of potential benefits, including:
- Granular control over how and when different rule subsets are run.
- The ability to pre-process Foundry Rules inputs before running the rule logic.
- The ability to run Foundry Rules inside an incremental transform. This requires the rule logic to be compatible with incremental data.
:::callout{theme="neutral"} Post-processing of Foundry Rules outputs (such as adding columns) can be achieved with a dedicated downstream transform. We do not recommend customizing the Foundry Rules pipeline solely for post-processing of Foundry Rules outputs. :::
Instructions¶
:::callout{theme="neutral"} Custom pipelines are currently not supported for streaming workflows. :::
You can deploy your own custom Foundry Rules pipeline by enabling self-managed transforms, choosing a custom transform repository, saving the Foundry Rules workflow, and then generating and saving the Foundry Rules pipeline code to the selected repository. To do so, follow the instructions below:
- Click on the gear icon to open the advanced settings menu.

- Enable the Enable self-managed transforms option.

- Click on Use a custom transform repository in the Transforms Configuration section. You can either Deploy a new repository (recommended) or choose Select existing repository to find and select your chosen repository.

-
Save your Foundry Rules workflow.
-
Generate and copy your Foundry Rules pipeline code by clicking Generate, and then clicking copy.

- If you previously chose an existing repository, create a file named
FoundryRulesTransformthat lives inside therules.transformsdirectory and paste the copied code in. If a newly deployed repository was chosen in step 3, find “FoundryRulesTransform” and paste in the code.
中文翻译¶
自定义 Foundry Rules 管道¶
:::callout{theme="warning"} 自定义 Foundry Rules 管道是一项高级功能,专为经验丰富的 Foundry 管道作者设计。此自定义操作可能会增加工作流管理员的实施和维护负担。 :::
Foundry Rules 默认情况下无需用户编写任何管道逻辑。然而,某些用例需要通过自定义 Foundry Rules 管道来实现原本无法达成的结果。
用例¶
自定义 Foundry Rules 管道可带来多项潜在优势,包括:
- 精细控制不同规则子集的运行方式与时机。
- 在运行规则逻辑前对 Foundry Rules 输入进行预处理的能力。
- 在增量转换中运行 Foundry Rules 的能力。这要求规则逻辑与增量数据兼容。
:::callout{theme="neutral"} 对 Foundry Rules 输出进行后处理(例如添加列)可通过专用的下游转换实现。我们不建议仅为了后处理 Foundry Rules 输出而自定义管道。 :::
操作说明¶
:::callout{theme="neutral"} 自定义管道目前不支持流式工作流。 :::
您可以通过启用自管理转换、选择自定义转换仓库、保存 Foundry Rules 工作流,然后生成并保存 Foundry Rules 管道代码到所选仓库,来部署自己的自定义 Foundry Rules 管道。具体操作步骤如下:
- 点击齿轮图标打开高级设置菜单。

- 启用 启用自管理转换 选项。

- 在 转换配置 部分点击 使用自定义转换仓库。您可以选择 部署新仓库(推荐)或选择 选择现有仓库 来查找并选定所需仓库。

-
保存您的 Foundry Rules 工作流。
-
点击 生成,然后点击 复制,生成并复制您的 Foundry Rules 管道代码。

- 如果您之前选择了现有仓库,请在
rules.transforms目录下创建一个名为FoundryRulesTransform的文件,并将复制的代码粘贴进去。如果在步骤 3 中选择了新部署的仓库,请找到 "FoundryRulesTransform" 并粘贴代码。