Adding info messages to a workflow's Task Result

You need to add Message objects to the root WorkflowCase like so:

wfcontext.getRootWorkflowCase().addMessage(Message.error("Some error happened: " + e.getMessage(), null));

The TaskResult tied to the WorkflowCase will persist these messages.

1 Like