Ivan,
The main problem you are facing relates to the Process engine, as you confirmed by yourself the DMN evaluation standalone already matches your expectations in your first original email, and it's the return-side of Data I/O mapping in the BPMN2 process which is giving an error.
Technical option1.
Technical option2.
Alternatively, I am not sure if there is ongoing work on the Process engine on Kogito to rely on "kogito incubation API" to ease the data mapping from/to other Kogito hosted engines.
In either case, requires some enhancement on the Kogito Process engine, so nothing which can be "solved" from (your) end-user side.
In either case, you are not "forced" to implement Jozef suggestion, your original ItemDefinition was just fine in DMN.
What you could do on the Java pojo is annotate its field with Jackson's @JsonValue annotation.
As a workaround of technical options 1/2, you could implement workaround similarly to what shown in the first part of this blog post:
If I were in your shoes, as a User, I would do the following.
- Raise a JIRA or GitHub issue for the Process Engine on Kogito with reference to this discussion, and highlighting the 2 technical options above.
- Revert the DMN model to your original version, which imho was just fine.
- Use @JSonValue annotation in the Java class, which would help with any Jackson serialization later down the line.
- Implement the workaround of the blog post
- on the Data I/O return side, store first the ConsentList (decision name) from the DMN, into a temporary process variable (not of type ContentList classname)
- on the On Exit Action script, take the value from the temporary variable, and store as appropriate process variable of type ConsentList (Java class name)
Hope this helps,
MM