【发布时间】:2020-06-23 11:48:23
【问题描述】:
我有一个实体定义为
@code
- @code:type_1 = pattern 'Y(\d{3})'
- @code:type_2 = pattern 'order number(\d{3})'
- @code:type_3 = pattern 'CZ(\d{3})'
我正在尝试像这样捕获以下上下文值
{
"context": {
"type_3s": "<? @code.filter(\"c\", \"c['value'] == 'type_3'\").joinToArray('%e.groups[1]%') ?>"
}
}
这样输入
Please delete codes CZ123, CZ456, and CZ789,我的最终上下文如下所示:
$type_3s =[123,456,789]
当前出现错误
SpEL evaluation error: Expression [ entities['code'].filter("c", "c['value'] == 'type_3'").joinToArray('%e.groups[1]%') ] at position 63: EL1004E: Method call: Method joinToArray(String) cannot be found on ArrayList type
在上面的示例中,code.values 的计算结果为:
@code.values =["type_3", "type_3", "type_3"]
非常感谢您在实现所需上下文方面的任何帮助,非常感谢!
【问题讨论】:
-
您能否补充一下
@code.values的外观,即它的价值? -
@data_henrik
@code.values对于上述字符串将是@code.values = ["type_3", "type_3", "type_3"]
标签: ibm-cloud ibm-watson watson-assistant