How to raise a user friendly message when a user tries to open a task that is allocated (already opened by another user)

Topic

In some cases during design of the workflow there is a need to have multiple destinations on a Task Event but once one of the destinations open the task it needs to be allocated to that user and removed from the other users worklist.

 

By default the below message will be displayed when the user tries to open the task page but there is a need to replace this message with something that makes more sense to end users.

Vernon_0-1614964671498.png
This scenario is limited to the use of the below configuration on the Task event of the workflow
Vernon_7-1614966841436.png

Instructions

To achieve the desired result the following configuration can be done to the form used as the TASK form in the solution.

 

1) On the form state used for the task form (Default will be Workflow Task State) add a new rule (When the Form raises an event)

Vernon_1-1614965495892.png

2) Add a condition to the new rule (an advanced condition is true)

Vernon_2-1614965632031.png

3) Configure the "an advanced condition" rule to check if the error message contains either of the following error codes with an OR statement

26031

24411

Vernon_3-1614965810571.png

4)  Add an action to show a message and stop rule execution after showing the message. This message is the customized message.

Vernon_4-1614966035567.png

5) Add an ELSE condition, this is needed to complete the IF statement above and add the action "Continue to next execution" to the ELSE block

Vernon_5-1614966497381.png

 

Additional Information

During runtime the results will be a custom message is shown instead of the OOTB one

Vernon_6-1614966696673.png

 

 

Related Links

 

 

Labels: (2)
Comments

Hi there,

I wonder why you did not suggest to use the condition "Error occured".

From my perspective it gives you more detail and space to handle errors as well as lowering the impact of errors. 

E.g. in this case the condition could be used to give it more friendly view, but also transfer the general info into some variable and collect different errors before telling the user 1 by 1 what the encountered errors. 

Also there is one huge thing to be considered. The form event "in Error" means that the error has already happened in the past. While "occured error" condition can handle the error itself while going through the actions in the rule (e.g. calling the worklist item method to get new SN for new task, if available, or to load the form in e.g. read only state with no error message, but just info message about outdated task) 

Which does not mean I am not agreeing with you. I am just pointing on the difference between details that it could provide.



Hi Pavlous

 

Good question, I'm guessing you are referring to a similar setup form this article on the K2 community?

How to customize the error message when a user opens a task that has been actioned | Community (k2.c...

My initial thoughts was yes do it that way but in this specific scenario it did not fire hence the workaround above. There is a bug item logged to have this addressed in a future version. 

 

Regards

Vernon

Version history
Revision #:
4 of 4
Last update:
‎05-19-2021 01:29 PM
Updated by:
 
Contributors