ODI KM 选项 - 来自 FLEX FIELD 的值

ODI KM Option - value from FLEX FIELD

您认为可以从弹性域中将值取入 ODI IKM 选项(例如)吗? 例子: 您在目标 table 上定义一个弹性字段,然后在 IKM 中传递该值。 然后,读取变量,可以将其传递给 IKM 的选项吗?

谢谢,

查找后发现不可以。条件表达式可以采用预定义的值。您可以在接下来的所有组合中找到:

Condition Expression – It allows you to set the required condition for the selected option. Double-click the field for editing the condition expression for the selected option. Click the browse icon Browse icon, to launch the Edit Expression Editor, which enables you to create or edit the existing groovy script that determines whether a knowledge module should be enabled, disabled, displayed or hidden.

Examples are:

return options.getValue("Cache").equals("true")?"show=true,enable=true":"show=false,enable=false";

This looks at the value of another KM Option called "Cache". If its value is "false," then the KM Option is hidden, because it's not relevant.

return (isStreaming)?"show=false,enable=false":"show=true,enable=true";

This looks at the Mapping isStreaming property. If it's true, then this option is hidden.

source

这很容易做到。

  1. 您可以在您的 IKM 代码中使用 odiRef.getTable(java.lang.String pProperty)pProperty 的可能值之一是您的 FlexField 代码。
  2. 如果您想通过选项传递 if,只需将 <?…?>-替换作为选项的值。 (可能你应该使用 %-?- 替换,这是有效的。)

请参阅 Oracle 站点上的“替换 API 参考”。 getTablegetIndexgetAKgetContext等很多函数都可以获得相应类型对象的flexField值。

另外还有odiRef.getFlexFieldValue()方法。它获取任何类型的任何对象的值,但需要将内部 ID 作为参数传递。所以不方便。