跳转至

Parameters(参数(Parameters))

Parameters are the inputs of an action type. They are the interface between the Rules and other Foundry applications, such as Workshop, Slate, and Object Views. Parameters are treated like variables that contain external values. Each parameter is defined by a type, which dictates what kind of values it can take. Beyond its type, parameters have a variety of other potential configurations. Each parameter can be individually configured as to whether they are exposed in the form or not, or whether they can be changed by the user or not.

Parameters transport values across the action type and can be referenced in rules to pass the value back on an object, link, or side effect, in submission criteria, to check if an action can be submitted, to access the current value of an object property before it is changed by the action or in overrides to change the configuration of a following parameter.

:::callout{title="Example"} A parameter can take the form of a Ticket object type in an action type which allows users to modify the status of a selected ticket. A Status parameter is defined as a string. When submitting the action, the object type parameter will take the value of a selected Ticket object and the Status parameter contains the future status. The action type then passes both parameter values to the rules and executes them to edit the object. :::

:::callout{title="Example"} As a variable in Workshop, previous_status can take the current value of the Status property of the selected Ticket object. This can be passed to a hidden parameter in the action, Previous Status, and the Status parameter can contain the updated status. Upon submitting the action, the action type then passes both the Previous Stats and the Status values to the rules and executes them to edit the object. :::


中文翻译


参数(Parameters)

参数(Parameters) 是操作类型(action type)的输入,构成了规则(Rules)与其他 Foundry 应用(如 WorkshopSlateObject Views)之间的接口。参数被视为包含外部值的变量。每个参数由其类型(type)定义,该类型决定了它可以接受何种值。除类型外,参数还具有多种其他可配置项。每个参数可单独配置是否在表单中显示,以及用户是否可以修改。

参数在操作类型中传递值,并可在规则中引用,用于将值传回对象、链接或副作用(side effect),也可用于提交条件(submission criteria)中检查操作是否可以提交,或访问对象属性在操作修改前的当前值,还可用于覆盖(overrides)中更改后续参数的配置。

:::callout{title="示例"} 参数可以表现为操作类型中的 Ticket 对象类型(object type),允许用户修改所选工单的状态。Status 参数被定义为字符串类型。提交操作时,对象类型参数将获取所选 Ticket 对象的值,而 Status 参数则包含未来的状态值。操作类型随后将这两个参数值传递给规则并执行,以编辑对象。 :::

:::callout{title="示例"} 在 Workshop 中作为变量使用时,previous_status 可以获取所选 Ticket 对象中 Status 属性的当前值。该值可传递给操作中的隐藏参数 Previous Status,而 Status 参数则包含更新后的状态。提交操作时,操作类型将 Previous StatusStatus 的值传递给规则并执行,以编辑对象。 :::