I have an entity defined as
@code
- @code:type_1 = pattern 'Y(\d{3})'
- @code:type_2 = pattern 'order number(\d{3})'
- @code:type_3 = pattern 'CZ(\d{3})'
I am trying to capture the following context values like so
{
"context": {
"type_3s": "<? @code.filter(\"c\", \"c['value'] == 'type_3'\").joinToArray('%e.groups[1]%') ?>"
}
}
So that for input
Please delete codes CZ123, CZ456, and CZ789, my final context looks like this:
$type_3s =[123,456,789]
Currently getting the error
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
In the above example, code.values evaluates to:
@code.values =["type_3", "type_3", "type_3"]
Any help in achieving the desired context would be greatly appreciated, thank you so much!
@code.valueslooks like, i.e. its value? - data_henrik@code.valuesfor the above string would be@code.values = ["type_3", "type_3", "type_3"]- njz2104