Hi,
I have several DB tasks shown in a to-do list, where it is possible to reassign these tasks to other users. I need to ensure, just before submitting any task, to check if meanwhile a user has been filling the form, anyone has reassigned that task to another user. In that case, if the user click into the "Complete" button, the task can´t be submitted and a warning must be shown in the form.
My approach was create a rule that check the if loggedInUser() match with the user in the column of these record, returning a boolean. When I clicked into the "Complete" button, the rule must be executed and decide if I can submit the task or not.The problem is that that rule is execute just once when the user open the task and I can't find a way to force the execution of therule every time I click into the button. In some tasks there is no option for the user to insert data, only display information and complete the task so refreshing that rule everytime the user change data in the form doesn´t work for that cases
Any ideas?
Thanks!
Discussion posts and replies are publicly visible
My approach would be to get rid of the start form and the first node would be a XOR to check the assignee value if null, update the task details as assigned and then this would be visible as the task is assigned and the user will be aware. You would need a additional node here to update the assignee value which would be redirected from the UIT to this script by an exception flow. So this will allow user some time to complete the task and when unattended or not submitted it would automatically be updated to a null value for the assignee.
If the assignee value is not null you would have another node a simple interface to show that the task is locked.
You will have to write down the assignee value before showing the form to the user, so that the task cannot be parallelly picked up y someone else. Lets wait for the other ideas.
You could always set up a refresh variable (at the shortest interval of ~30 seconds) to periodically recheck the assignee value from the DB, in such a way that if it changes, the form and/or its buttons are disabled (preferably while advising the user that it's no longer under their ownership and that they can click away).
Please note that this implementation is a bit outside of Appian's usual assignment system, so one way or another you'll probably have to settle for an imperfect work-around.
I think about this approach, it looks like the most reasonable way to go. I don't understand why Appian doesn't out-of-the-box allow usto do something like this, without using weird workarounds.
Thanks for your response
ab2370 said:I don't understand why Appian doesn't out-of-the-box allow usto do something like this, without using weird workarounds.
DB tasks are not a natural concept in Appian, and so, design decisions do not incorporate this use case.
You are right, all these solutions are imperfect. Refreshing only every 30 secs imply that if the user complete the form in > 30 secs, the variable won´t be refreshed. I will try to create a case in MyAppian requesting a native solution for that scenario.
the Appian consulting team always recommends us to use DB task to avoid "memory overload"...this is really confuse for me because I saw several time in this forum several leads devs recommend using "normal Appian tasks" instead of DB tasks
I know about this conversation, and am part of it myself. I am pushing for process tasks, with DB tasks only as an exception.
Peter Lewis , maybe you can pick this up and discuss it internally.
A failsafe would be to add a manual check in a process node immediately after the form is submitted, and if the assignment had changed, route the user to an advisory task and don't write any of their changes to the DB/etc. That is in the off chance that reassignment occurs 30 seconds or less before the user was otherwise about to submit their task (possible, but probably not a very high risk).
Yeah I think it's a valid debate, and something we've discussed internally as well. My preference generally matches Stefan's - in most cases, I think it is easier to use out-of-the-box tasks rather than recreating tasks through databases. However, if you have particularly long-lived processes or long lived tasks, it may make sense to utilize database tasks.