hello
you can customize your business process in the following way:
- implement your custom WorkflowAction and attach it to a service task right after the user's task;
- the service task throws an exception if the action was executed without having proper justification (no comments, missing entity attribute, etc).
The snippet for a custom WorkflowAction
import com.reltio.workflow.api.WorkflowService;
import com.reltio.workflow.api.actions.Execution;
import com.reltio.workflow.api.actions.WorkflowAction;
import com.reltio.workflow.api.processes.Comment;
import com.reltio.workflow.api.processes.ProcessesService;
import com.reltio.workflow.api.rest.ReltioException;
import java.util.List;
public class ApplyAction implements WorkflowAction {
@WorkflowService
ProcessesService processesService;
@Override
public void execute(Execution execution) throws ReltioException {
List<Comment> comments = processesService.getComments(execution.getId());
// do not allow execute action if there are no comments posted for the process
if (comments.isEmpty()) {
throw new ReltioException("{\"responseCode\":400,\"errorMessage\":\"Apply action cannot be executed on a task without comments\"}");
}
}
}
And map this class to a service task

Then if there was Approve action executed on the DCR Review users' task and execution comes to this service task the following error will be displayed in Inbox:

------------------------------
Yury Timofeev
Product Owner of the Workflow
Reltio
------------------------------
Original Message:
Sent: 12-02-2024 00:49
From: Anonymous Member
Subject: How can we show a custom message in the UI on approval of any workflow task
This message was posted by a user wishing to remain anonymous
Hi Snehil,
We have custom workflow (not DCR) where a user task has 2 options Approve and Reject. Now if the assignee Approves the task then we need to validate if certain field are populated or not (attribute at the entity level). If the attribute is not populated then the workflow should not proceed to the next step and an error message (custom message) needs to be shown in the UI providing the reason as to why the workflow has not proceeded to the next step.
Now we are not finding any way forward to show this custom message from the validation task. Please suggest what is the recommended approach to show a message in the UI from the workflow service task.
Thanks.
Original Message:
Sent: 11-21-2024 04:57
From: Snehil Kamal
Subject: How can we show a custom message in the UI on approval of any workflow task
Hi,
AFAIR this is not possible currently, but if you can share your use case I can probably guide you on how to achieve something similar.
------------------------------
Thanks,
Snehil Kamal
Senior Solution Architect
Reltio
Bangalore