Refresh subject after finishing task that runs in the background

  • 19 December 2019
  • 4 replies

Userlevel 7
Badge +14

Either with use of the process flow or standard functionality I would like to be see my subject refreshed after a background task (task with Await result = No) has been finished. Currently I have no other option than to refresh the screen myself or put in an automatic refresh; both not ideal.

The task is updating statuses and I would like to be able to see the progress in real-time without user interaction. Maybe introduce even a tsf_send_refresh function? :wink:  

4 replies

Userlevel 4
Badge +1

I’m really not sure about the usability of such a feature. Asynchronicity was introduced for tasks with a long execution time so the UI would not have to be blocked while running them. The design mirrors that of browsers doing huge downloads. The basic idea here is that the UI cannot make any assumptions about the state it’s in when the task completes:

  1. The screen from which the task was started may have been closed.
  2. The object model may have been refreshed in the mean time.
  3. The user may be in edit mode when the task completes, with unsaved changes, in the middle of a phone call with a customer.
  4. A modal dialog may be open.
  5. The computer may be locked, temporarily without internet or a connection to the database (non stored-procedure tasks).
  6. (this list goes on for a while)

In general, doing anything more than displaying a notification is intrusive, will bother at least one end user, and should therefore be strongly discouraged. One of the most extreme cases I’m aware of is Windows doing automatic reboots after an automatic upgrade, and some people losing precious work because of this.

My suggestion in this case would be to analyze the problem at hand and figure out what the underlying issue is. If e.g. it’s a requirement to always see the most recent version of a read-only table with a lot of activity, I think we can come up with much more general, and workable solution. In fact, in the Software Factory itself the same reasoning applies when validating a definition, generating code, or synchronizing to IAM, and we’re actively working on finding the most acceptable way to standardize this for general use.

Userlevel 7
Badge +14

I understand the points you mention. The challenge I'm facing is that I see old data/old statuses after executing a background task. Auto refresh is something I tried but it is not the exact solution my client is looking for, hence submitting this idea.

Fortunately we see notifications in the Windows Notification panel and the user is notified when the Task has finished so it's less of an issue. We just want to prevent notifying the user that the task has finished but they don't see the updated status (without user interaction). Do you have a suggestion for what I could use?

Userlevel 4
Badge +3

Hi Mark,

In the future we could think about a alternative which only refreshes a subject when the subject is marked "dirty” after we know for sure the data is updated.

Indicium could also help us later on by pushing a notification to clients about the data of an actual subject in use is updated in the database backend.

At the moment we have nothing to offer automatically. You should instruct your users indeed.



Userlevel 7
Badge +14

Thank you for your answer Erik :grin: