BPM, Workflow, and Case

 View Only
Expand all | Collapse all

Reassignment of task to group on session timeout

  • 1.  Reassignment of task to group on session timeout

    Posted Thu March 26, 2020 11:23 PM
    Hi All,

    Is it possible to reassign the task to the original group on session timeout?

    Thanks

    ------------------------------
    Harish Gupta
    ------------------------------


  • 2.  RE: Reassignment of task to group on session timeout

    IBM Champion
    Posted Fri March 27, 2020 12:45 AM
    Hi Harish,

    Theoretically it should be possible.

    So, what you have to is - 

    1. Start a timeout on load of your page, use the actual session timeout milliseconds set in the server.
    2. Add listeners for "mousemove", "mousedown", "keypress", "touchmove" etc.  In case any of these events is triggered, clear the timeout and restart the timeout.
    3. In case there is no action in the page, the callback function will be called after the specified timeout period.
    4. Implement a service call in the callback function of the timeout which will trigger an UCA.
    5. You can a have a separate process to implement the actual reassignment logic, the process can be triggered asynchronously by the UCA.

    I have not tried this out, please try to create a simple PoC and let us know if you encounter any issue.



    ------------------------------
    AtanuRoy
    IBM Digital Business Automation Expert
    Barclays
    ------------------------------



  • 3.  RE: Reassignment of task to group on session timeout

    Posted Sat May 23, 2020 06:09 PM
    @Atanu Roy

    We tried the above option but we observed that this approach will trigger a lot of mouse events, it may not cause any performance issue. 

    Is there any way that we can run a servlet on session timeout which can reassign the task to group.

    We have our BPM dashboard located on an external portal and we observed that it never times out? Is that how it works or we are missing some configurations?

    Thanks

    ------------------------------
    Harish Gupta
    ------------------------------



  • 4.  RE: Reassignment of task to group on session timeout

    Posted Mon May 25, 2020 02:16 AM
    While there is a HTTP session for each web application in WebSphere (and thus BPM), there isn't anything meaningful (w.r.t. to business data) stored in that session for regular end user access.

    When working with a CSHS, there will be multiple session objects on the server side, e.g. for the web application hosting REST APIs and for the teamworks web application etc.
    These sessions expire independently, after 30 min of inactivity in the given web application by default.

    The only shared state between these web applications is LTPA (the logged in state). The token is encrypted and signed and includes an expiration timestamp. Expiry is not an event. It is only that an incoming request inspects the token and is only processed if the expiration time is in the future.

    Long story short:
    (1) there is no actual session timeout
    (2) if there was one, it would be specific to the web application (e.g. /teamworks) in BPM and not shared with other web applications in the same BPM server or even external systems

    You might consider variations of your requirement, e.g. reassign tasks (of type XYZ) that were claimed for more than <maximum-task-completion-time>.

    ------------------------------
    Jens Engelke
    ------------------------------



  • 5.  RE: Reassignment of task to group on session timeout

    Posted Mon May 25, 2020 06:24 AM
    @Jens Engelke

    For this particular requirement, we are banking upon LTPA timeout which is 120 mins but since the BPM Dashboard never times out, it won't make sense to reassign the task to groups before session timeout.

    Suppose a user keep the dashboard screen open for more than 2 hours without any activity​ and in the meanwhile we reassign the task to group(so that other people in the group can claim it and task does not get locked). After 2 hours user comes back and starts working on submission of form he will get below error.

    Error: The "Log Error" service failed with the following information:

    Error code: BPMTaskOwnerError

    Error data: undefined

    Hence we want to reassign task just before the timeout happens(which never happen)

    Thanks



    ------------------------------
    Harish Gupta
    ------------------------------



  • 6.  RE: Reassignment of task to group on session timeout

    Posted Mon May 25, 2020 06:59 AM
    Edited by Jens Engelke Mon May 25, 2020 07:10 AM
    How about introducing some piece of JavaScript that counts down at the top of the screen and when it reaches 0, there is some browser side JavaScript that invokes the assign back to team API?
    You should be able to include such HTML and JS as "custom HTML".
     
    This would address the issue of people walking away from the screen.
    This does not address the issue of someone claiming a task, close the browser and leave for the day. This task would remain in claimed state - unless you come up with some server side daemon.
     



  • 7.  RE: Reassignment of task to group on session timeout

    Posted Mon May 25, 2020 07:28 AM
    @Jens Engelke  For 1st point, How does it prevents the user from continuing on the current page of task?

    On browser close, we are able to detect the event and able to reassign task back to group.

    ------------------------------
    Harish Gupta
    ------------------------------



  • 8.  RE: Reassignment of task to group on session timeout

    Posted Mon May 25, 2020 07:37 AM
    You basically
    - start a counter at the top of the screen
    - upon activity: reset to <what ever you feel appropriate>
    - upon 0: 
       (1) execute the same logic as you'd do at browser close event
       (2) close the tab / redirect to external dashboard 

    --> reassigning the task back to team prevents the user from completing it on an API level. If the user is not the owner, it shouldn't be possible to complete directly.
    --> navigating away gives a clear indication that an action is required to continue

    ------------------------------
    Jens Engelke
    ------------------------------



  • 9.  RE: Reassignment of task to group on session timeout

    Posted Tue May 26, 2020 04:21 PM
    Following the "principle of least surprise" if you were to reassign the task to the group you should popup an alert for the user that tells them the task is no longer valid.  In an ideal world I would actually write the requirements along the lines of -
    1. We want to assign the task back to the group if there has been no interaction for X minutes.
    2. We want the user to know were are doing this.
    3. At X-5 minutes of inactivity put an overlay on the UI that says "this session appears to be inactive, do you want to continue working this task or go back to the task list" with buttons for each option.
    4. At X minutes, change the overlay to read "this task was reassigned back to the group due to inactivity"  The only button is then "return to task list".
    I'm not great at modern UI's, but I've seen this type of overlay in other web apps, so I assume a good JS / HTML5 person could create the coach view that enables the desired behavior.  Handling it this way would reduce the number of users reporting bugs that are the system "Working as Designed".

    ------------------------------
    Andrew Paier
    ------------------------------



  • 10.  RE: Reassignment of task to group on session timeout

    IBM Champion
    Posted Tue June 02, 2020 03:42 AM
    Hi Harish,

    It will definitely not cause any performance issue on the server as the code is running at the client side.
    I have tested this in a sample, it is working fine with me.

    ------------------------------
    Atanu Roy
    ------------------------------