Getting UWL task count for all users in a role.

Hi.
I recently posted a question regarding a very similar issue, but I haven't got any response yet. I think my question might have been somewhat poorly phrased, so I will try to do better at explaining what we need.
We have a number of processes, most of which need to be dynamically assigned to a user when created. The way we want to assign those tasks is by executing a WebService which would receive a role name and get all the users for that role. Then, using the UWL API, it would check how many tasks each of the users have in their UWL, and return the UserID for whoever has the least tasks. I haven't been able to get this to work. I keep getting Logged in users context or session doesn't exist Exception.
Please, any help on this will be greatly appreciated.
Currently working with SAP NWDS 7.1 SP05 PAT0005

Hi,
Thank you for your response, however, that's not what I need.
For you and anyone esle who might find this extra info useful...
I know how to get a user's role(s), and how to get the users in a role.
I also know how to assign a task to a specific user dynamically.
Using the UWL API, I know how to get the tasks (or items) in a user's UWL from a WD application, I need to do that from a WebService and using pretty much the same code, with the necessary adjustments, I can't get it to work.
Furthermore, I'm able to get the UWL tasks for ONE user, that user being the one I log into the application with. For example, if I write code to get the tasks for user testUser1, I need to log in with testUser1 to get it to work, if I log in with any different user or make it a non-authenticated application, it won't work.
Again, help on this is much needed and will be appreciated.

Similar Messages

  • Getting tasks for all users in a role

    Hi,
    We need to get all users in a Role, and out of those, find out which one has the least tasks in their UWL using a WebService. Saw some example codes and here's my attempt at it. Doesn't quite work, I'm getting the Logged in users context or session doesn't exist Exception. Any help on this will be GREATLY appreciated.
    public class LeastTasksBean implements LeastTasksLocal {
         public String getUserLeastTasks( String sRole )
              try{
                   Map<String, String> users = new HashMap<String, String>();
                   Map<String, String> tasks = new HashMap<String, String>();
                   final int sessionIdleTimeout = 60;
                   String Users[] = UMFactory.getRoleFactory().getUsersOfRole( sRole, true );
                   if( Users != null ){
                        for( int i = 0; i < Users.length; i ++ ){
                             UWLContext  uwlContext      = new UWLContext();
                             IUWLService uwlService      = findService();
                             uwlContext.setAllowBackEndConnections( true );
                             IUser uwlContextUser        = UMFactory.getUserFactory().getUser( Users[0] );
                             uwlContext.setUser            ( uwlContextUser );
                             Locale loc                  = new Locale( "ES" );
                             uwlContext.setLocale          ( loc );
                             HttpServletRequest request  = getHttpRequest();
                             uwlContext.setOriginRequest   ( request );
                             IUWLSession session         = uwlService.beginSession( uwlContext, sessionIdleTimeout );
                             uwlContext.setSession         ( session );
                             IUWLItemManager itemManager = uwlService.getItemManager( uwlContext );
                             QueryResult result          = itemManager.getItems( uwlContext, null, null );
                             users.put( String.valueOf( i ), uwlContext.getUserName() );
                             tasks.put( String.valueOf( i ), String.valueOf( result.getItems().size() ) );
                             uwlService.endSession( uwlContext );
                        int userTasks = 0;
                        int leastTasks = Integer.valueOf( tasks.get( 0 ) );
                        int userKey = 0;
                        for( int i = 0; i < Users.length; i ++ ){
                             userTasks = Integer.valueOf( tasks.get( Integer.toString( i ) ) );
                             if( userTasks < leastTasks ){
                                  leastTasks = userTasks;
                                  userKey = i;
                        return users.get( Integer.toString( userKey ) );
                   else{
                        return "No users exist for this role";
              //Exception Handling
         private IUWLService findService() throws NamingException
              Properties properties = new Properties();
              properties.put( InitialContext.INITIAL_CONTEXT_FACTORY, "com.sapportals.portal.prt.registry.PortalRegistryFactory" ); 
              InitialContext ctx = new InitialContext( propiedades ); 
              IUWLService uwlService = ( IUWLService ) ctx.lookup( IUWLService.ALIAS_KEY );
              return uwlService;
         private HttpServletRequest getHttpRequest() throws Exception
              Properties properties = new Properties();
              properties.put( "domain", "true" );
              ApplicationWebServiceContext wsContext =
                   (ApplicationWebServiceContext) new InitialContext( propiedades ).lookup( "/wsContext/" + ApplicationWebServiceContext.APPLICATION_WSCONTEXT );
              HttpServletRequest request = wsContext.getHttpServletRequest();
              return request; 

    Hi David,
    I have a similar requirement on our project. I need to get a count of pending workitems for all user but I'm getting similar message when I try to access UWL context of any other user.
    Did you find any solution for this? Is it possible to get the workitems for all users using webservice or wendynpro?
    I would appreciate if you can provide some inputs on this.
    Thank you in advance.
    Regards,
    Seema Rane

  • How to get failed tasks list for a user in OIM.

    Hi All,
    Can anybody please suggest me a way to get list of task that got failed(when a user trying to provision to a resource) in OIM using java code.
    Thanks in Advance.
    SP.

    Use the code snippet below to get the task status. Based on this you can filter rejected tasks.
    userintf = (tcUserOperationsIntf) ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    provintf = (tcProvisioningOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcProvisioningOperationsIntf");
    long userKey=100;
    tcResultSet userresultSet = userintf.getObjects(userKey);
    for(int i=0;i<userresultSet.getRowCount();i++)
         userresultSet.goToRow(i);
         long processKey = userresultSet.getLongValue("Process Instance.Key");
         tcResultSet provresultSet = provintf.getProcessDetail(processKey);
         for(int j=0; i<provresultSet.getRowCount();j++)
              provresultSet.goToRow(j);
              String taskName = provresultSet.getStringValue("Process Definition.Tasks.Task Name");
              String taskStatus = provresultSet.getStringValue("Process Instance.Task Details.Status");
    Let me know if you have any queries...

  • Getting the task list for a user

    i´ve created a bpel project in which all i do is a simple human workflow asssined to user1. Next i want to create a jsp in which i list the tasks assigned to that user for which i looked into the tutorial 10.UserTasks.
    The difference between the example in there is that the active bpel is the TaskManager in my case it just opens the TaskActionHandler.
    Now when i look into the exmple in listTasks.jsp it uses
    ITask[] tasks = worklist.listTasksByAssignee( "[email protected]" );
    when i set the user to user1 it returns no tasks, even though i can see 3 tasks opened.
    any clues? any pointers would be appreciated.
    gabriel

    Hi,
    In 10.1.2 the TaskManager is replaced with the TaskActionHandler.
    You don't necessarily have to build a JSP to access tasks - you can use the out of the box sample worklist. This can be accessed at:
    http://localhost:9700/integration/worklistapp/Login
    However, if you would like to create your own worklist, you will have to use the new 10.1.2 Worklist apis.
    These are documented in Chapter 14 and Chapter 16 of the BPEL developers guide.
    You can also find the javadoc at
    ORABPEL_HOME\integration\orabpel\docs\workflow
    To see a sample you can look at the VacationRequest or the HelpDeskRequest sample

  • "expand role" nt waiting for all users in the role to view the notification

    I have created adhoc roles using the following code.
    lv_user_list_txt := 'SYSTECH'||','||'FNATECH';
    wf_directory.createadhocrole (lv_role_name_txt, lv_role_display_txt);
    wf_directory.adduserstoadhocrole (lv_role_name_txt, lv_user_list_txt);
    I have assigned it to the Item attribute of type 'Role' using the following code.
    wf_engine.setitemattrtext (
    itemtype => itemtype,
    itemkey => itemkey,
    aname => 'LIST_OF_APPROVER',
    avalue => lv_role_name_txt
    I have checked the 'Expand role' check box in the notification and assigned the performer as the Item attribute(Role type) 'LIST_OF_APPROVER'.
    But when one user in the role approves or rejects, the notification of the other user is cancelled. the other user can no longer view the notification.
    Ideally, after checking the 'Expand role', the workflow should not proceed to the next node until, all the user have performed an action. But this is not happening. Please help on this :(
    Thanks in Advance.
    Anitha.

    yes, I did. I spent at least 8 hours searching for a solution here, in the forums and tried everything making sense... The EFI downgrade was the only thing that helped.
    My personal opinion is: Apple should offer the EFI downgrade option to all users in an official way. It looks like my favorite vendor does not want to admit they made a hardware+software mistake (the EFI 1.7 update solves some HDD issues on some new MBPs but causes other problems on other MBPs).
    Message was edited by: Bartek Bargiel

  • How to change the UWL refresh rate for all portal users.

    Hi Portal Experts,
    How to change the UWL refresh rate for all portal users?
    Users can individually change the refresh rate through "Personalise View" in UWL.But we want this to set it for all users(we have 10k portal users).
    It was defaultically set to 5 mins for all users.How to change this to 20 mins.
    Thanks
    Sony.

    1.      Launch the UWL iView configuration page.
    You can access the iView from the UWL administration pages (System Administration ® System Configuration). Navigate to the property editor as follows:
          From the Universal Worklist Systems, choose the system for which you want to edit the properties.
        Choose Edit.
    may be you can get clear help from below help file
    http://help.sap.com/saphelp_nw04s/helpdata/en/eb/101fa0a53244deb955f6f91929e400/frameset.htm
    regards
    nagaraju

  • Hi, While installing XQuatrz-2.7.7, the installation blocks at the "destination" level. It asks how to install this soft, "Install for all users" is shadowed, but frozen: i cannot select anything and move on. Any idea how to get that fixed? Thanks!

    Hi,
    While installing XQuatrz-2.7.7, the installation blocks at the "destination" level. It asks how to install this soft, "Install for all users" is shadowed, but frozen: i cannot select anything and move on. Any idea how to get that fixed?
    Thanks!

    It says above 2 relevant and 1 correct answere available .............
    I'm new here so could anyone direct me to these answeres?

  • Task List URL (to FR Report) opens in new window, but not for all users!

    Hi all,
    I am not sure if this is the correct forum to ask the question (for me it looks like an IE topic), but perhaps anybody can help me anyway...
    In one of our Planning apps (9.3.1) we defined several task lists and tasks that link to relevant FR Reports (URL Tasks). If I open the URL task in basic view the relevant FR Report opens in the same IE Window (in the main frame of the planning app). If my colleague opens the same task the FR Reports opens in a new IE Window.
    My problem is that I dont have any ideas where I can set the relevant property. Is that a planning property, a workspace property or an IE property setting??? Where can I adjust the settings that for ALL users the URL opens the Report in the same window??????
    Thanks in advance!!!!
    Kind Regards
    André
    P.S.: We are on IE8.

    Have you both got the same settings in Tools > Internet Options > Tabs Settings
    There was also a bug though I can't say if it is related to your issue
    9549216 - Instead of a new tab, a new window is displayed after you create a Financial Reporting task in Workspace.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do I get the HDD to show on the desktop for all users?

    I have found it by going to finder and preferences and show hard disks, but when another user logs in, it doesnt show. The Macs are networked and login using Active Directory, but as soon as I change the logon it doesnt show anymore.
    I need this to show or a network share using SMB to be mapped for all users when they logon. I have software "Read and Write Gold 4 for Mac" and upon starting the software, it needs to look for a license file. I can either copy to all the Macs, or have one on a network share.
    Any ideas welcome.

    Looking around, it seems that some people have changed the Launchpad key and want to go back.
    If there's a way to go back, then there must be a way to change it completely?
    In this thread, Fabien says that if you enter
    rm ~/Library/Preferences/com.apple.symbolichotkeys.plist
    into Terminal, you can bring the Launchpad key back.

  • I am trying to get Menu Editor 1.2.7 to work globally for all users. I have added the .xpi to the extensions folder and it is not being installed auto-magically.

    I would like to have Menu Editor installed for all users. I attempted to put the .xpi file in c:\Program Files (x86)\Mozilla Firefox\extensions with the expectation that the user would be prompted to install.

    You need to rename the XPI file to the (GU)ID of the extension as listed in the file install.rdf or just install the extension in a profile and copy the file or folder from that profile to the extensions folder.

  • Adding a domain user to the admin role within the local user management breaks all metro apps for all users!!

    Hi,
    I have posted this in another large thread under the "Windows 8 General" group but have not had any appropriate feedback from MS.
    After hours of testing and working with other users I have managed to isolate a simple situation that breaks all metro ui applications within Windows 8 for all users on the machine. Here are my exact steps and notes.
    Before continuing if you are running Avast then your solution may be to turn of the behaviour shield functionality as this also breaks metro apps. This is NOT the problem we are having!
    I have performed 3 cleans installs after isolating the problem and am able to reproduce the issue every time using the same steps on two different machines. 
    First thing to say is that for us it has nothing to do with simply joining the domain, domain/group policies nor does it appear to have anything to do with the software we installed, the problem here is much more simple but the result is pretty terrible.
    Here are my exact steps of what I did to reproduce our problem:
    Complete format of HDD in preperation for a clean install
    Clean install performed
    Set up the machine initially with a local account
    Test metro apps - all working fine
    Open control panel from the desktop, click on System, change the system to join the domain, click reboot
    Log into the system using my domain account
    Test metro apps - all working fine
    Here's were the problem starts. I need my domain account to have admin rights on the local machine so I can install programs without the IT men having to come over and enter their password every 5 mins.
    I go to control panel via the desktop and click on User Accounts. From with here I then click on "Manage User Accounts". This requires the IT guys to enter their details to give me access to such functionality. This is fine
    In the dialog box that opens I can only see the local user that was initially created during setup. The "Group" for this local account shows as "Administrators" - Image included below (important to note that metro apps are working at this point)
    I click add and then add my domain account - also giving it administrator access
    Sign off or reboot to ensure the new security is applied
    Sign back in to the domain account
    Test metro - ALL BROKEN
    Sign out
    Sign in as local account
    Test Metro - NOW ALL BROKEN FOR THIS USER ALSO
    So as soon as I add my domain account to the local user accounts and set it as admin it breaks all metro apps for all users. This is on a totally clean install with nothing at all installed other than the OS.
    Annoyingly if I go back and change the domain account to a standard user or if I totally remove the domain account from the local account management system the problem does not go away for either user. basically it is now permanently broken. The only fix I
    could fathom was a full re install and not giving the domain user admin access to the local  machine.
    Screen one - this is the local user accounts window AFTER joining the domain and logging in with my domain account (All metro apps working at this point)
    Screen 2: User accounts AFTER joining the domain and AFTER adding domain account to local user management (METRO BROKEN)
    I have isolated my machine from all group policies so nothing like that is affecting me. Users I have spoken to in different companies have policies that automatically add users to the local user management. This means that metro apps break as
    soon as they join the domain which leads them to wrongly think it is group policies causing the error. Once they isolate themselves from this they can reproduce following my steps.
    Thanks

    Hi Juke,
    Thank you for the response and apologies for the delay in getting back to you. My machine was running a long task so I couldn't try your suggested solution.
    I had already tried running the registry merge suggested at the top of the thread to no avail. I had not tried deleting the OLE key totally so I did that and the problem still exists. I will post all the errors I see in event viewer below. For
    your info, since posting my initial comment I have sent out my steps to 7 different people and we can all reproduce the problem. This comes to 10 different machines (3 of them mine then the other guys) in 3 different businesses / domains. We see the same errors
    in event viewer.
    Under "Windows Logs" --> "Application" : I get two separate error events the first reads "Activation of app winstore_cw5n1h2txyewy!Windows.Store failed with error: The app didn't start. See the Microsoft-Windows-TWinUI/Operational log for additional
    information." The second arrives in the log about 15 seconds after the first and reads "App winstore_cw5n1h2txyewy!Windows.Store did not launch within its allotted time."
    Under "Windows Logs" --> "System" : I get one error that reads "The server Windows.Store did not register with DCOM within the required timeout."
    Under "Applications And Services Logs" --> "Microsoft" -->  "Windows" --> "Apps" --> "Microsoft-Windows-TWinUI/Operational" : I get one error that reads "Activation of the app winstore_cw5n1h2txyewy!Windows.Store for the
    Windows.Launch contract failed with error: The app didn't start."
    If you require any further information just let me know and I will provide as much as I can.
    Thanks

  • Remove Following people from mysite for all users

    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
    $web = Get-SPWeb https://www.contoso.com/teams/yourteam
    $context = [Microsoft.SharePoint.SPServiceContext]::GetContext([Microsoft.SharePoint.SPSite]$web.Site)
    $upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager $context
    $users = $web.AssociatedMemberGroup.Users | where IsDomainGroup -eq $false
    $useraccounts = $users | select loginname | Foreach {"$($_.loginname)"}
    foreach ($user in $users) {
    $profile = $upm.GetUserProfile($user.UserLogin)
    #$objectToFollowRelativeToWeb = "/"
    if ($profile)
    #Create a Social Manager profile
    #SPSocialFollowingManager
    $followManager = New-Object Microsoft.Office.Server.Social.SPSocialFollowingManager($profile, $context)
    $following = $followManager.GetFollowed([Microsoft.Office.Server.Social.SPSocialActorTypes]::Users)
    for ($i=$following.Count - 1; $i -ge 0; $i--) {
    $followed = $following[$i]
    $acctname = $followed.AccountName
    #if claims:
    $acctname = 'i:0#.w|'+$acctname
    if ($acctname -iin $useraccounts ) {
    [Microsoft.Office.Server.Social.SPSocialFollowResult]$res = $followManager.StopFollowing($followed)
    Write-Verbose "$($user.UserLogin) stop following $acctname result is $res"
    I have the above script from one of the technet solution to remove followeronly  for Contributors from MySite. I want this script to run for all user and remove all existing association. Can someone help me update this script.
    Thanks Ba$va

    Hi Basva,
    According to your description, my understanding is that you want to remove all existing association for all users
    The $users = $web.AssociatedMemberGroup.Users | where IsDomainGroup -eq $false is to get all users in Contributors group. You can change the line to
    $users = $web.AllUsers, then run the script, compare the result.
    Here is an post for getting all users using PowerShell, please take a look at:
    http://www.sharepoint2013.me/Blog/Post/160/Get-all-the-unique-users-in-a-farm-using-PowerShell-script
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Unable to change keyboard layout for all users on Windows Server 2012 R2

    Hi,
    I have a requirement where I need to support national keyboard layout for Danish for all users on that machine. When I ran the powershell with script Set-WinUserLanguageList
    -LanguageList da-DK it only sets the Danish keyboard layout to the specific logged in user.However the for other users its same English(US) keyboard which is not expected.
    Please help me how to set the Danish keyboard for all users on the machine. Its Urgent!Thanks

    Hi Mike,
    Thanks for reply.
    But I need to configure everything using powershell script. Is it possible to use powershell script to setting group policy/ adding logon script ?
    These are pretty basic administration tasks and almost always quicker to accomplish with the GUI. Why do you want to use a PowerShell script?
    EDIT: Here's some information on the topic however:
    https://technet.microsoft.com/en-us/library/cc781361%28v=ws.10%29.aspx
    http://blogs.technet.com/b/heyscriptingguy/archive/2011/01/06/use-powershell-and-group-policy-for-your-logon-script.aspx
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • How to change settings for all users?

    Hi All,
    In cPro we have User Settings button. On clicking that we get a Tabstrip where you will find "User" tab.
    my question is: How can we change the default settings for all users e.g setting the checkbox "Scheduling only manually" to true ?
    Best Regards,
    Arti.

    Hi Arti,
    In cProjects the authorizations can be managed either by authorization profile administration by system administrator for General authorizations or by Project specific authorizations for individual cProjects elements by Project owner.
    Try the first one and I hope you will get the solution.
    Regards,
    Nishit Jani
    Award points only if you find the information useful.

  • How to change preferences for all users in a Citrix enviroment

    Hello.
    I need change some preference settings for all users in my Citrix enviroment.
    I know change the preference settings for a user, of course, but a have 160 users and a need to change some settings configuration one time on the server for all users.
    The preferents I need change are: 'disable javascript' and 'don't show pdf in IE'
    Thanks.

    Hi Arti,
    In cProjects the authorizations can be managed either by authorization profile administration by system administrator for General authorizations or by Project specific authorizations for individual cProjects elements by Project owner.
    Try the first one and I hope you will get the solution.
    Regards,
    Nishit Jani
    Award points only if you find the information useful.

Maybe you are looking for