IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

task URL opening auto aceept is not working

  • 1.  task URL opening auto aceept is not working

    Posted Fri May 13, 2011 06:33 PM

    Hi All,

    Am doing publish and wait concept to publish canonical document and getting back taskURL in to CAF project and opening the task URL, task is opening but auto accept is not happening even it is auto accept =true in task project, if iopen same task from task queue inbox auto accept is working fine with acceptBy value with user name , even from task list management if i open task,auto accept is not happening, can any one help me if open taskURL which is return by publish and waitt, auto accept should work.

    Regards,
    Anil Kumar Ellendula


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: task URL opening auto aceept is not working

    Posted Tue May 17, 2011 11:51 PM

    The auto accept = true is a feature implemented by the custom task inbox, that is why it isn’t auto accepted when you invoke the API or use the TLM. You’ll need to invoke the same code from the API if you want the task auto-accepted. Have a look at the links that the Task Inbox creates to learn how to mark the task accepted.

    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 3.  RE: task URL opening auto aceept is not working



  • 4.  RE: task URL opening auto aceept is not working

    Posted Thu May 19, 2011 10:16 PM

    This is the behavior of the InboxResultsPortlets when configured with autoAccept=true:

    • They have a command Link in one of their columns
    • That command Link is bound to a method: acceptAndOpenTask
    • That method delegates to the base class: BaseTaskInboxResultPageBean#acceptAndOpenTask()
    • That method calls acceptTask() on the TaskProvider and then calls BaseTaskInboxResultPageBean#openTask()
    • OpenTask creates a PortletUrl to the task Details page which includes a PortletURL back to the inbox and refreshes the inbox
    • OpenTask then redirects to the created URL

    So that large link below is the result of the URL created in the OpenTask() API


    Back to your question. Do you just want to make sure that the task is always accepted when you browse to it?

    Maybe you should just accept it in the initialize() method of the Task Details page if it isn’t already accepted.

    Or, you should create a method that does something similar to what the task inbox page does and then create a commandlink to invoke that method.

    I hope this helps.
    –mark


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 5.  RE: task URL opening auto aceept is not working

    Posted Thu May 19, 2011 10:18 PM

    This is the behavior of the InboxResultsPortlets when configured with autoAccept=true:

    • They have a command Link in one of their columns
    • That command Link is bound to a method: acceptAndOpenTask
    • That method delegates to the base class: BaseTaskInboxResultPageBean#acceptAndOpenTask()
    • That method calls acceptTask() on the TaskProvider and then calls BaseTaskInboxResultPageBean#openTask()
    • OpenTask creates a PortletUrl to the task Details page which includes a PortletURL back to the inbox and refreshes the inbox
    • OpenTask then redirects to the created URL

    So that large link below is the result of the URL created in the OpenTask() API


    Back to your question. Do you just want to make sure that the task is always accepted when you browse to it?

    Maybe you should just accept it in the initialize() method of the Task Details page if it isn’t already accepted.

    Or, you should create a method that does something similar to what the task inbox page does.

    I hope this helps.
    –mark


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 6.  RE: task URL opening auto aceept is not working

    Posted Thu May 19, 2011 10:28 PM

    This is the behavior of the InboxResultsPortlets when configured with autoAccept=true:

    • They have a command Link in one of their columns
    • That command Link is bound to a method: acceptAndOpenTask
    • That method delegates to the base class: BaseTaskInboxResultPageBean#acceptAndOpenTask()
    • That method calls acceptTask() on the TaskProvider and then calls BaseTaskInboxResultPageBean#openTask()
    • OpenTask creates a PortletUrl to the task Details page which includes a PortletURL back to the inbox and refreshes the inbox
    • OpenTask then redirects to the created URL

    So that large link below is the result of the URL created in the OpenTask() API


    Back to your question. Do you just want to make sure that the task is always accepted when you browse to it?

    Maybe you should just accept it in the initialize() method of the Task Details page if it isn’t already accepted.

    Or, you should create a method that does something similar to what the task inbox page does.

    I hope this helps.
    –mark


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 7.  RE: task URL opening auto aceept is not working

    Posted Fri May 20, 2011 09:17 AM

    hi mimel,

    i have already tried in initialise method by checking

    if(!getAccountClosureRequest().isCurrentUserAccepted()){
    getAccountClosureRequest().acceptTask();
    }

    if i open the task first time, it is accepting by user, if i open same task second time it is giving below error

    [POP.017.0100] You may not accept this task because it is already accepted by another user

    can you please reply me with what condition i need to call getAccountClosureRequest().acceptTask();

    have tried with

    if(getAccountClosureRequest().getCanUserAcceptTask()){
    getAccountClosureRequest().acceptTask();
    }

    with it also same error am getting.

    Regards,
    Anil kumar Ellendula


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 8.  RE: task URL opening auto aceept is not working

    Posted Fri May 20, 2011 09:00 PM

    The API (getCanUserAcceptTask) is just a permissions check, not a ‘logic’ check. By default only one user can accept a task at a time, so below i show an algorithm that un-accepts the task if previously accepted and accepts the task for the current user. Hope this helps.
    –mark

    
    
    //Get a reference to the task provider
    ManualAcceptTask mat = getManualAcceptTask();
    
    //is the current user already accepted
    if (!mat.isCurrentUserAccepted()) {
    
    //If interested, have a look at the current 
    //accepted list and the maximum allowed to accept (default is 1)
    String [] currentAcceptedUsers = mat.getTaskInfo().getAcceptedByList();
    int maxAllowed = mat.getMaxAllowedToAccept();
    
    //empty out the accepted list and apply
    mat.getTaskInfo().setAcceptedByList(new String[0]);
    mat.applyChangesNoAccept();
    
    //accept on behalf of the current user
    mat.acceptTask();
    } 

    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 9.  RE: task URL opening auto aceept is not working

    Posted Mon May 23, 2011 04:39 PM

    Hi Mark,

    Thanks for reply, i have done below code in initialise();,does below code give the solution what am expecting.

        if (!getAccountClosureRequest().isCurrentUserAccepted()) { 
    
    String [] currentAcceptedUsers = getAccountClosureRequest().getTaskInfo().getAcceptedByList(); 
    int maxAllowed = getAccountClosureRequest().getMaxAllowedToAccept(); 
    
    if(currentAcceptedUsers.length==0&&maxAllowed==1)
    {
    //empty out the accepted list and apply 
    getAccountClosureRequest().getTaskInfo().setAcceptedByList(new String[0]); 
    getAccountClosureRequest().applyChangesNoAccept(); 
    
    //accept on behalf of the current user 
    getAccountClosureRequest().acceptTask();
    }
    }
    

    Regards,
    Anil Kumar Ellendula


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 10.  RE: task URL opening auto aceept is not working

    Posted Tue May 24, 2011 01:50 PM

    Hi Mark,

    After i kept above logic in initialise method my obeservation is that in my left navigation portlet am calling flow service having publish and wait service for this am using AsyTree and Portlet simple link and extended portletURL control it will ope taskURL on center navigation.

    if i click first time link, taskURL is opening in center and it is calling initialise() method and checking above logic and it is accepting the task by current user.

    if i click same link second time initialise() method is not calling and opening task in center and accepted by is happening with current user.

    i have check by putting logs in initiase method.

    i have implemented same above logic in 3 tasks initialise methods and it has 3 links in left navigation.

    if i click first time “A” task link,it is opening task in center navigation WITH ACCEPT BY CURRENT USER(calling initialise methods of that task).

    than if i click B task link it is is opening task in center navigation WITH ACCEPT BY CURRENT USER(calling initialise methods of that task).

    than if click again A" task link it is opening task in center navigation WITH ACCEPTED BY CURRENT USER(icalling initialise methods of that task).

    Can you please explain me why initialise method is not if i click same task link morethan one-time.

    Regards,
    Anil Kumar Ellendula


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 11.  RE: task URL opening auto aceept is not working

    Posted Tue May 24, 2011 07:51 PM

    The initialize method is called when the the managedBean has been newly created. I think in the situations you describe where the initialize() method isn’t invoked is because that bean hasn’t been destroyed yet. (See this doc for more details: http://communities.softwareag.com/ecosystem/communities/public/Developer/webmethods/tutorials/CAF/CAFandJSF/JSF_Mbeans_BindingExp.html)

    You could add your logic to beforeRenderResponse() and just add some flags as to whether you’ve already checked for the current taskID or not.

    Regards,
    –mark


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 12.  RE: task URL opening auto aceept is not working

    Posted Wed May 25, 2011 10:22 AM

    Hi Mimel,

    Thanks for reply yesterday after i replied this topic i did same by keeping the logic in beforeRenderResponse() , my observations are it is working fine ever time it is doing auto accpet for every new task but in my task has asycommands and command buttons if i click these buttons every time it is calling beforeRenderResponse() method and checking the condition, will these cause perfomanace in QA and Production environment.

    you replied that just add some flags as to whether you’ve already checked for the current taskID or not.i think it can achieve same if condition in my logic i.e if(currentAcceptedUsers.length==0&&maxAllowed==1)
    {

    And also in your reply you mentioned that “”“”“”“”““The initialize method is called when the the managedBean has been newly created. I think in the situations you describe where the initialize() method isn’t invoked is because that bean hasn’t been destroyed yet””“”“”“”“”',can you please reply me how to detroy the managedbean to call initialise method,now it is set with expireWithPageFlow “true” and managedbean scope session.

    Regards,
    Anil Kumar Ellendula

    Regards,
    Anil Kumar Ellendula


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine