Details
-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
False
-
False
Description
As a developer at different points in time I might be interested on printing the full SW data object and not only a particular filed with String type.
E.g. in the following example:
Instead of having an action that prints a particular field in the SW data field like this "$.move", I'd like to print the root object "$":
{ "name": "finish", "type": "operation", "actions": [ { "name": "printAction", "functionRef": { "refName": "printMessage", "arguments": { "message": "$" } } } ], "end": { "terminate": "true" } }
This is very helpful for developers to see how the SW data is looking.
If I try to do this now, and use the mentioned expression, I get the following exception:
2021-11-30 10:52:05,338 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (pool-1-thread-1) Unexpected error (id 2d577452-78a9-432e-b495-444b009d9bee) while executing node printMessage in process instance 9c510c13-3f46-40ab-9a66-03124281ea57: org.jbpm.workflow.instance.WorkflowRuntimeException: [callback:9c510c13-3f46-40ab-9a66-03124281ea57 - printMessage:14] – java.lang.IllegalArgumentException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
at [Source: UNKNOWN; line: -1, column: -1]
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:243)
at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:55)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:209)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:406)
I believe that by playing a bit with the expression evaluation, and in the case of the sysout expression no only supporting "String.class" it should be possible to achieve the desired behavior.