Skip to Content
avatar image
Former Member

UWLExecption: Logged in users context or session doesn't exist

Hi everybody,

my purpose is to access the UWL-API from WDJ in order to get a list of workitems. I don't know why but i get always the following exception:

UWLExecption: Logged in users context or session doesn't exist

The user-id is correct and also the locale etc. but if this parameter are correct what could be the problem?

Used documents:

/people/kenichi.unnai/blog/2009/10/19/how-to-use-uwl-api-for-netweaver-bpm-tasks

/people/hiroyuki.otaki/blog/2010/10/08/netweaver-bpm-720-enhanced-task-notification

My System is 7.2 CE SP 3


  public void findTask() throws WDUMException, UWLException, WDURLException {
	  	
		  String userRID = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("UserRID");		  
			  		  
		  try{			  
			  // create UWL context
			  UWLContext uwlContext = new UWLContext();
			  IUser user = getUserID(userRID); //own method 	  
			  uwlContext.setUser(user);
			  uwlContext.setLocale(user.getLocale() != null ? user.getLocale() : Locale.getDefault());			  			  		
			  
			  // get UWL service
			  IUWLService uwlService =  findService(); //(IUWLService) WDPortalUtils.getServiceReference(IUWLService.ALIAS_KEY);
			  
			  // begin session
			  IUWLSession uwlSession = uwlService.beginSession(uwlContext, SESSION_IDLE_TIMEOUT);
			  
			  // build expression
			  Expression expStatusNew = new Expression(Item.STATUS, StatusEnum.NEW.toString(), ComparatorEnum.EQUAL_TO);			  
			  Expression expStatusProg = new Expression(Item.STATUS, StatusEnum.INPROGRESS.toString(), ComparatorEnum.EQUAL_TO);
			 
			  ArrayList expList = new ArrayList();			  
			  expList.add(expStatusNew);			  
			  expList.add(expStatusProg);
			  
			  CompoundExpression exp = new CompoundExpression(expList, null, null, true);			  			  			  
			  // iterate over all UWL items
			  IUWLItemManager itemManager = uwlService.getItemManager(uwlContext);			
			  
			  UWLView uwlView = uwlService.getViewManager(uwlContext).getViewForItemType(ItemType.UWL_ITEM, uwlContext);			  			  
			  
			  			  		  
                           //---hier i get the error message: UWLExecption: Logged in users context or session doesn't exist 			  
                          QueryResult result  = itemManager.refreshCacheAndGetItems( uwlContext, uwlView, null, exp );				  			 
			  		  
		  }catch (Exception ex){
			  ex.printStackTrace();
		  }	

regards,

Sid

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 05, 2011 at 03:59 PM

    The user had also come from the context, so i had to set the authentication checkbox for the WD-Application.

    Add comment
    10|10000 characters needed characters exceeded