Hi Experts,
We have a custom par file which displays no of outstanding tasks and no of new tasks and a button to launch UWL.
These no. of outstanding tasks and no. of new tasks values are not displaying correctly for some users. Rest of the users it is displaying correctly.
for all the users in the UWL it is displaying correctyl. But in the custom par file it is displaying correct for some and woring values are showing for some users.
Here is the code written for fetching the no.of outstanding and no of new tasks. According to me code looks fine. Can you also please check the code, if anything is wrong in fetching the number of outstanding tasks and number of new tasks
IUWLService uwlService = (IUWLService) PortalRuntime.getRuntimeResources().getService ("UniversalWorklistService");
UWLContext uwlContext = new UWLContext();
IUser user = request.getUser();
uwlContext.setUser(user);
uwlContext.setLocale(request.getLocale());
uwlContext.setAllowBackEndConnections(true);
com.sap.netweaver.bc.uwl.IUWLSession session = uwlService.beginSession(uwlContext, 20);
uwlContext.setSession(session);
IUWLItemManager itemManager = uwlService.getItemManager(uwlContext);
com.sap.netweaver.bc.uwl.config.UWLView view = uwlService.getViewManager(uwlContext).getView("DefaultView", uwlContext);
QueryProperties queryProperties = new QueryProperties();
queryProperties.setMaxNumberOfItemsToFetch(1000);
QueryResult result = itemManager.refreshCacheAndGetItems(uwlContext, view, queryProperties, null);
ItemCollection itemColl = result.getItems();
list list = itemColl.list();
iterator iterator = list.iterator();
int unredTask = 0; // new tasks
int openTask = 0; // Outstanding tasks
while(iterator.hasNext())
{
Item item = (Item)iterator.next();
if(item.getStatus() != null)
{
string ItemType = item.getItemType();
string type = "";
int firstIndex = ItemType.indexOf('.');
int secondIndex = ItemType.indexOf('.', firstIndex + 1)
if(firstIndex != -1 && secondIndex != -1)
type = ItemType.substring(firstIndex + 1, secondIndex);
if(type.equalsIgnoreCase("task"))
{
if(!item.getStatus().equals(StatusEnum.COMPLETED))
openTask++;
if(item.getStatus().equals(StatusEnum.new)) unredTask++;
}
}
Raghu