Fiori Task List Refresh
Post implementation of custom Fiori Apps, we faced issue related to Delay/Manual refresh required to refresh the Fiori Task list. This blog provides information regarding the Fiori Task list and its refresh behavior based on the task type (Synchronous/Asynchronous). Information about the Task Type and how it is completed has also been provided. This article also provides information how to go about the task design for Fiori Applications.
Here I cover the following topics
- Fiori Task List
- Task Type – Synchronous or Asynchronous
- Task Completion and Refresh
- Fiori Task Design
Fiori Task List
Work items assigned to a user are displayed in a master detail view.
On completion of task, the work item is removed from the list.
Fiori Task List Refresh Flow
A Fiori task list is refreshed as per the following steps
Task Overview
A task is removed from the list once it has been completed. A task completion depends on the way it has been created. A task can be created as Synchronous or Asynchronous. The task gets this Sync/Async property from the Business Object Method
Asynchronous | Synchronous | |
---|---|---|
When |
We define a method as an asynchronous method if we want a task that uses this method to be terminated only via events.
The following are possible reasons for defining a method as asynchronous:
|
You define a method as a synchronous method if we want to use the processing results as method parameters or results.
The following are possible reasons for defining a method as synchronous:
|
Definition |
|
|
Example | The task in which the method Process sales order is executed is also terminated by the event Customer unable to pay. | The method Display for displaying an object. |
An Asynchronous task has to be completed by using a terminating event.
Task List Refresh
A synchronous task would disappear from the Fiori task list as soon as it is completed. In case of an asynchronous task, the completion of the task depends on the event processing mechanism.Again, these events may be using the Event Queue mechanism or would be delivered as soon they were raised. However some delays are expected in processing of the event and subsequent task completion.
As a result of this, a task list based on an asynchronous task may not get refreshed as soon as the action is performed on the task.
Task Definition – Points to consider
Custom Task
First preference should always be given to define task as Synchronous task
For completing a synchronous work item, FM SAP_WAPI_WORKITEM_COMPLETE can be used.
Asynchronous Task (Standard or Custom)
Irrespective of whether the task is standard or Custom, communicate upfront about the task list refresh behavioral issues
The user should be communicated about expecting task to remain in the list sometimes. To refresh the list in these cases, manual refresh will be required.
I hope this blog is helpful in some way.
Thanks for reading and any comments/questions please comment below.
Hi
Please let me know , if there is any solution to resolve this refresh issue, in case of Asynchronous Tasks.
Currently we are using below version
Version : UIX01CA1 1.00 with SP Level 006 (SAP MM Custom workflows with Asynchronous Tasks)
Will Refresh issues resolve when we upgrade to Next higher version of MyInbox 2.0 SP03 version or The refresh issues will be there for any version as long as our Task is Asynchronous .
Do we need to change the Task type as synchronous task and use SAP_WAPI_WORKITEM_COMPLETE to finish the Task in Workflow to eliminate this issue.
Please let me know.
The author is not an SAP associate, but as far as I know the Task List refresh does even NOT work with MyInbox 2.0 SP04 and asynchronous Workflows. We tried several variations using the onTaskUpdate() API of My Inbox according SAP Note 2305401 – Integration of SAPUI5 Fiori Applications into My Inbox 2.0 for configuration details. But the API will just update the Task itself and not the Task List, which is at least in our case useless as we use openMode=replaceDetails and therefore we will get an error, as in most case the task as been processed already.
We currently try to implement a custom method in S2 Custom Controller of My Inbox that executes this.oDataManager.fireItemRemoved(). According above Fiori Task List Refresh Flow diagram, this should trigger an refresh of Task List.
Regards Oliver
Hello Former Member ,
We also have My Inbox 2.0 SP04 and facing the same issue, for asynchronous type tasks when we approve the work item is approved and the task disappears from the Master List but the Details pane still shows the page of the Approved Work Item and No work item is selected in the Master List, the InstanceId parameter in the URL still holds the old work item instance Id. If I manually Refresh the Master list using the Refresh icon the next work item is selected and the Detail Pane is also refreshed.
I can see that the methods "onUpdateFinished" and "fnFindAndSelectNextTaskAfterAction" are called in the S2.controller.js. the method "fnFindAndSelectNextTaskAfterAction" in turn calls the "this.oDataManager.fireRefreshDetails();" which does the trick to refresh and select the next work item in the Master List. However with asynchronous type of tasks the refresh does not work completely fine. Can you please suggest how you called the method in the DataManager to fire the refresh or itemRemove event. Did you create a copy of the "CA_FIORI_INBOX" or wrote the code to Override the method in your enhancement of the app.
Thanks in advance for your response.
Regards,
Sundeep
After some trial and error, I managed to refresh the master list after approving / rejecting.
Create an extension of the CA_FIORI_INBOX and extend the S3 controller. A file S3Custom.controller.js will be created.
Now you will need to overwrite one function, called sendAction.
This should do the trick.