How can I auto-complete a user task in a workflow if its not manually approved in time?

0
Hi everyone, I'm working on a workflow in Mendix where a User Task is assigned to a specific user. However, I want the system to automatically complete (approve) the task if it is not approved before its due date, for example via a Scheduled Event or background logic. Here are the key points of my question: Can a Scheduled Event automatically complete a WorkflowUserTask after its due date? Can this task be completed by the system even if it was originally assigned to a specific user? Can I use the MxAdmin user to complete the task programmatically, or does it have to be a Named User with an associated Administration.Account? What is the recommended approach to programmatically complete a workflow user task (e.g., via Java action or API)? Any insights, best practices, or working examples would be greatly appreciated! Thanks in advance!
asked
3 answers
1

We recently release interrupting boundary events

answered
1

Hi Ömer,

I encountered the same problem. If I am not mistaken it is not possible to complete a usertask by the system, since it is not a user (even if you try to add it to the target users). You could use an executeMicroflowAsUser Java action, but I would say handling this within the workflow itself is a better solution here.

 

In the workflow you can use an interruptive boundary event combined with a jump to action. That way, you can continue your workflow after a set time at a specific spot. The jump to action can only be added to the interruptive boundary event if you remove the 'End' event first. Then you should be able to add the jump to action and end up with something like this.

 

image.png

 

Hope this helps!

answered
0

You do not need a user to complete a task.

 

Update your workflow to add an expired outcome for the task. Create a scheduled event microflow and use the 'Complete user task' action to complete the task from this microflow. You can do so with the outcome to go on the expired path. 

answered