Adding info messages to a workflow's Task Result

Which IIQ version are you inquiring about?

Version 8.4

Share all details related to your problem, including any error messages you may have received.

I am a little troubled by the lack of information that most workflows offer in the TaskResult. Not tasks, but workflows. Normally the only info they present is the Current Workflow Step. I attempted to access the TaskResult in a step script, using TaskResult taskResult=wfcontext.getTaskResult(); and then adding Message objects to it, but not seeing those messages. Has anyone successfully done this? Can you share your insights (and code)?

Hi and Hello,
If I good undestand you, @mercury you want to have more info from workflow. I use this trick, maybe it help you. I choose workflow in gui, than “Process Variables”
trace and Output. You will have more info.

Regards,
Adam

Hi @mercury,

Is it related to extra auditing information you want to maintain, or it is just about some specific use-case you want to modify the taskresult?

In ideal case you should not accessing this task result and modifying it directly from workflow itself.

Thanks

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

@AdamVentum so I tried setting several workflow variables with output=“true” but not seeing them in the task result output page. While the tool tip might be correct, there is nothing in the task result allowing display of those values.

Righteous !! I did do the diligence and surround with a try catch block. Also I initially tried putting the code into a Script block but it negated my rule call, so I moved my script block into the Transition and just had the script block return true.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.