Closing an open task programatically

HI,
I have created a custom component in order to establish connection to BPM .
The flow is such that , the connection gets established and i need to fetch the tasks based on the workflowInstance and user ID specified.
I am able to fetch the tasks from which i extract the task state.
Need to close the state of an open task i.e need to update the state of the task to close. Not able to do it.
How do i achieve this?
This is the piece of code that is supposed to perform the functionality.
Please have a look and provide your inputs in order to achieve the needed.
Function Call:
this.updateTaskOutCome(task1, "CLOSE");
Function Defnition:
public int updateTaskOutCome(final task,
                                 final String outcome) {
        // variable to show success or failure
        int success = 0;
        // creating reference for TaskQueryService
        TaskQueryService taskQueryService = null;
        // creating reference for WorkflowContextType for admin context
        WorkflowContextType adminContext = null;
        // creating reference for WorkflowContextType for user context
        WorkflowContextType userContext = null;
        TaskService taskService = null;
        oracle.bpel.services.workflow.task.model.Task outcomeUpdatedTask =
            null;
        CredentialType adminCredentialtype = this.createAdminCredentialType();
        CredentialOnBehalfOfRequestType onBehalfRequestType =
            queryFactory.createCredentialOnBehalfOfRequestType();
        // calling getService method og BPMConnection
        //get taskQueryService Object from BPMConnection
        //taskService = getService("taskAction");
        //creating WorkflowContext for admin
        //setting admin context to onBehalfRequestType
        try {
            taskQueryService = (TaskQueryService)getService("taskQuery");
            adminContext = taskQueryService.authenticate(adminCredentialtype);
            onBehalfRequestType.setOnBehalfOfUser("username");// admin username given
            onBehalfRequestType.setWorkflowContext(adminContext);
            //creating WorkflowContext for user
           userContext= taskQueryService.authenticateOnBehalfOf(onBehalfRequestType);
            // getting BPM Client for performing user actions
            taskService = (TaskService)getService("taskAction");
            // creating UpdateTaskOutcomeType object and setting its property
            UpdateTaskOutcomeType updateTaskOutcomeType =
                taskActionFactory.createUpdateTaskOutcomeType();
//            //setting outcome
            updateTaskOutcomeType.setOutcome(outcome);
            //setting task
            updateTaskOutcomeType.setTask(task);
            // setting userContext
           updateTaskOutcomeType.setWorkflowContext(userContext);
            // calling webservice operation for performing user action
            //setting success variable
            outcomeUpdatedTask =
                    taskService.updateTaskOutcome(updateTaskOutcomeType);
        } catch (StaleObjectFaultMessage e) {
            Report.trace("mysectionstring",
                         "inside staleobject fault message catch block", null);
//        } catch (WorkflowErrorMessage e) {
//            TaskQueryServiceFaultType faultInfo = e.getFaultInfo();
        } catch (Exception e) {
            e.printStackTrace();
        if (outcomeUpdatedTask != null) {
            success = 1;
        return success;
Thanks in advance,
Bharath

Any one facing similiar issue?
Could someone please provide some information.
Thanks,
Bharath

Similar Messages

  • Firefox won't open. I followed instructions in help. I closed Firefox via Task Manager, processeRestarted my comp. It still won't work. (as a test I ran Explorer to see if that would work. It does.) What can I do to get Firefox working properly?

    These are the help suggestions from Firefox Help that I followed:
    Firefox will not start and no error message is shown
    Another program may be preventing Firefox from starting. Restart your computer to end all running programs then try starting Firefox again. If Firefox still does not start or if the problem returns, the other suggestions listed below can help you fix the problem.
    An extension prevented Firefox from closing properly
    Sometimes your previous Firefox session did not close properly and this prevents you from restarting Firefox. Norton IPS, Norton Toolbar, and Skype 4.0 are all known to prevent Firefox from closing properly. Firefox is still running, but no windows are open.
    note: TO MY KNOWLEDGE I DON'T HAVE NORTON
    1. Right-click on an empty spot in the Windows task bar and select Task Manager (or press Ctrl+Shift+Esc).
    Note: On newer versions of Windows (XP, Vista, 7) the combination Ctrl+Alt+Del opens Task Manager as well.
    notron360sucks-taksmanager.png
    2. When the Windows Task Manager opens, select the Processes tab.
    TaskManagerProcesses.png
    3. Select the entry for firefox.exe (press F on the keyboard to find it) and click End Process.
    4. Click Yes in the "Task Manager Warning" dialog that appears.
    TaskMgrWarning.PNG
    5. Repeat the above steps to end any additional firefox.exe processes, if more than one entry is found, then exit the Windows Task Manager.
    6. Start Firefox normally. NOTE: THIS IS WHAT DOESN'T WORK AFTER CLOSING THE PROCESS IN TASK MANAGER AND RESTARTING THE COMPUTER...THEREFORE I COULDN'T DO THE REST OF THE INSTRUCTIONS
    7. At the top of the Firefox window, click on the Tools menu, and select Add-ons.
    8. Select the Extensions panel.
    9. (If it is listed) Select Norton IPS and click Disable.
    10. (If it is listed) Select Norton Toolbar and click Disable.
    11. (If it is listed) Select Skype 4.0 and click Disable.
    12. Click on Restart Firefox.
    ADDITIONAL NOTE: BEFORE THIS PROBLEM STARTED TODAY I WAS ON THE WEB LOOKING UP A PHONE NUMBER = THERE WAS SOME WEIRD JAVA ERROR MESSAGE SO i DIDN'T DOWNLOAD THE PAGE AND EXITED. SOMETIME LATER IS WHEN FIREFOX NO LONGER WORKED.

    Hi mcclausky, you may need to manually remove a policy setting from the registry. You also should scan for malware that might have created this problem.
    This article lists scanning and cleaning tools other Firefox users have found helpful: [[Troubleshoot Firefox issues caused by malware]].
    To check your Windows registry for policy settings that might affect Firefox or other programs, I suggest consulting a Windows forum or Microsoft's forums. For example:
    * http://windowssecrets.com/forums/
    * [http://answers.microsoft.com/en-us/windows/forum/windows_8-system/this-operation-has-been-cancelled-due-to/9677848e-072d-4206-87f4-9da9284d6151 This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator. - Microsoft Community]
    * [http://answers.microsoft.com/en-us/windows/forum/windows_xp-security/restrictions-this-operation-has-been-cancelled-due/8af1d0cd-8fbd-4223-9396-86d7497bb275 Restrictions. This operation has been cancelled due to to restrictions in effect on this computer.Please contact your system administrator. - Microsoft Community]

  • When closing my Firefox window, all processes are not closing requiring me to open task manager and kill the process before using Firefox again. Received recent upgrade and hasn't worked right since then.

    I open Firefox, use it, then close the window. Try to reopen Firefox and it fails with a message that a previous process is still running. Requires me to open Task Manager and kill the old process.

    Try to wait a bit longer before reopening Firefox to give Firefox more time to close completely.<br />
    Try to use "Firefox/File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit") to close Firefox if you are currently doing that by clicking the close X on the title bar.
    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    *https://support.mozilla.com/kb/Firefox+hangs

  • I have to open Task Manager to quit the Firefox process almost every time b4 it will shut down I just uninstalled & downloaded another copy/version & will reinstall again. Thought you would want to know. I am anjulz on comcast

    I have to open Task Manager & quit the Firefox process manually b4 it will stop. When I did it the last time b4 I just uninstalled my memory usage was up to like over 300,000 with only 1 tab open. Just downloaded another copy/version & will reinstall. Hopefully this will stop the problem. thought you would want to know this.

    The proper way to close Firefox is through the File menu "Exit" or the equivalent with the Firefox button.
    More detail in item '''#38 Firefox already running '''
    of
    [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6) (#fx4interface)]
    Firefox already running, to properly shutdown Firefox when closing the last window use File → Exit/Quit (or Firefox button → Exit). Closing Firefox with the [X] in the upper right corner closes the window ("Ctrl+W") but that does not necessarily close Firefox if it has subtasks running. If you want to close and reopen Firefox use the "Restart" within Add-ons if you made a change requiring a restart, or install "[https://addons.mozilla.org/firefox/addon/restartless-restart/ Restartless Restart]" ("Ctrl+Alt+R") which will allow you to take Firefox down and restart without having to check the Windows Task Manager to see if Firefox first actually ended. [http://kb.mozillazine.org/Firefox_hangs Firefox hangs]

  • GL balances differences between Year end closing and opening balances

    Hi friends,
    One GL account balances showing differences between year end closing & year opening balances.
    Example: 2006 closing balance is  250000 $
                   2007 opening balance is 150000 $
    difference is 100000 $ . why should coming like this. already completed balances carryforward (F.16) in 2006 & 2007 year. 
    any programe for this solution ?
    One more point is  just 2 days back i posted 2 entries for 2006 year equal to 100000 $ . after this entries shall we need go for F.16 (carry forwarded balances).
    please do the needful. It is very urgant issue.
    Raj

    HI,
    There shouldn't be any more postings to a GL Account once Balance carry forward has been executed.
    If postings have been made then you should execute the Balance carry forward again, otherwise you will see difference in opening and closing GL balance (as mentioned by you).
    Regards

  • Open Task Button does not come in Outlook

    I have a three level approval workflow in which each level an email is generated to the approve to approve or reject.
    But suddenly the Open Task Button does not pop up in Outlook 2010 anymore can you tell me why?
    Srinivasan Kidambi

    had the same issue with External users not using Outlook. This is how I fixed it:
    Open the task list that the workflow is using and connect it to Outlook. Then kick off a workflow to make a new task. Once the task is made open the task from Outlook. The bottom options (review, perform the specific req. for the task, and Open this task)
    are now links. Hover your mouse over the link and you will see the address.
    Now open SPD, connect to your site and open the work flow assc. to the doc lib.
    Start editing the workflow and click the "Approval" link
    Click "Change the behavior of a single task"
    You are going to have to look for all the instances of "then e-mail task notification to "Current Task:Assigned to"
    Open "Current Task:Assigned to"
    Click where you want he link to go and hit the Hyperlink button
    name the link whatever you want, then hit the string builder ("..." button)
    Copy the link from the Task in Outlook into the string builder (if you use External addressing you can also hard code the External address).
    At the very end of the link where is says ID=(then a number) delete the number and DO NOT put a space. Click the Add or Change Lookup button and use "Current Task: Approval" "ID" "As String" and click ok. Should like this:
    Now this will not pop the form up, but it will send the user straight to the task form (might have to enter username and password) for the correct task. Remember to do this to all the "Current Task:Assigned to" in the workflow. It sounds like a chuck of
    work but it does not really take thaty long on the OOTB Approval workflow.
    Just wanted wanted to add my two cents.
    Also check
    http://social.technet.microsoft.com/Forums/en-US/417466a3-cdcb-4559-8453-9fff6da4aceb/getting-around-a-missing-open-this-task-button-in-a-nonoutlook-email?forum=sharepointcustomizationprevious
    If this helped you resolve your issue, please mark it Answered

  • What constitutes an "open' task?

    How does the system decide which tasks to put in this list? Is it based on status, created date? A combination of fields?
    Any help would be appreciated!
    B

    I thought that was the case, but when I look at the open tasks on the homepage, it only seems to have ones for the current month. Is this correct?

  • Closing an open path

    I have a path that, although it looks closed, is open so does
    not fill correctly. How do I close it?
    I'm using FW8 on OS X.
    Thanks, Jake.
    P.S. Apologies if I'm being dumb and have missed something
    obvious!

    jakemcm wrote:
    > I have a path that, although it looks closed, is open so
    does not fill
    > correctly. How do I close it?
    Zoom in so you can clearly see the ends of the two paths you
    want to
    join. Use the Subselection tool to drag the ends together.
    You'll see a
    gentle snap when they join.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    http://www.adobe.com/communities/experts/

  • I want to reset Firefox, and the message is that something is preventing the reset. I have closed all open windows and I still get the "Oops" message,

    I have uninstalled and reinstalled Firefox because I was receiving unwanted adware and was being directed to untrusted sites. Now I want to reset Firefox because I want to change the home page and toolbars, and something is preventing the reset. I have closed all open windows repeatedly, but the problem continues.
    =====Moved from Firefox OS product to Firefox for Desktop product category by Moderator. -feer56=====

    Check the programs that are on your computer
    '''Windows:''' Start > Control Panel > Uninstall Programs.
    '''Mac:''' Open the "Applications" folder
    '''Linux:'''
    * [http://www.freesoftwaremagazine.com/articles/see_all_your_installed_applications_ubuntu_unity Ubuntu Unity]''' {web link}
    * Xfce: Applications Menu category sections
    * options depends on the package manager and the desktop environment
    Go thru the list. If you find something that you don't
    know what it is, use a web search.
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-caused-malware Troubleshoot Firefox Issues Caused By Malware]''''' {web link}

  • Why does closing all open windows (15) and leaving only one drop ram usage from 1.5 to 1.4Gb and not more.

    Why does closing all open windows (15) and leaving only one drop ram usage by only 100mb from 1.5 to 1.4Gb.
    What is in this 1.4 gb ?
    I don't care much about ram, It's just that cpu usage spike like crazy by the end.
    ''Edited to remove swearing - TonyE''

    Hi musicfan,<br />Sorry you are having problems with Firefox. Maybe you should have asked earlier and we could have fixed it.
    Reading your comments I do not see that rolling back to an insecure Firefox 22 will actually help you much. You are probably best using IE, unless you have also damaged that.
    *[[Export bookmarks to Internet Explorer]]
    You should not use old versions they are insecure. Security fixes are publicised and exploitable.
    * [[Install an older version of Firefox]]
    * https://www.mozilla.org/security/known-vulnerabilities/firefox.html
    Most others will not be having such problems. We are now able to say that with confidence because after developers missed a regression in Firefox 4 telemetry was introduced so that data was obtained. It may be an idea to turn on your telemetry, if you have not already done so, and decide to stick with Firefox.
    *[[Send performance data to Mozilla to help improve Firefox]]
    Trying safe mode takes seconds. Unfortunatly if you are not willing to do even rudimentary troubleshooting there is not anything we can do to help you.
    *[[Troubleshoot Firefox issues using Safe Mode]]

  • Filtering My Open Task in SAP CRM based on Status, Transaction & Partner Function

    Hello
    Whenever i create a Task in SAP CRM, it displays that transaction in the My Open Task of all Business Partners involved in that Transaction.
    I want to restrict the My Open Tasks based on Transaction Type, Status and Partner Function.
    1) The system should work as it is for all other Tasks but for my Custom Transaction Type the logic should be based on status of the Transaction
    2) When My Open Task component is prepared the system should consider the Status and Partner Function as well i.e. if the status is Approval of Manager, the system should show the Open Task only to the Manager and not other parties.
    3) if the status of the Transaction is Open, the system should only display this Transaction / Task only to Employee Responsible and not to Manager and other people involved in their My Open Tasks.
    I have gone through the following post in SCN:
    https://scn.sap.com/thread/2056959
    I have implemented the method DO_PREPARE_OUTPUT as per the post but it does not do anything. When i redefine the method GET_QUERY_RESULT and remove everything,it does not prepare any list.
    If possible please specify which method needs to be redefined in the component/view CRMCMP_GS_WC/TodaysTasks & if possible please share the code that needs to be maintained in that method.
    Thanks

    Hi,
    Method DO_INIT_CONTEXT should be redefined
    This should be redifined to get the collections with your required filter criteria.
    * get the collection of entities for the tasks
       lr_col      = get_query_result( gc_status-open ).
    If this does not help, Delete the collections which are not required after above selection but before this code.
       me->typed_context->resultnew->collection_wrapper->set_collection( lr_col ).
    Thanks
    Ajay Singh

  • The background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black backgr

    the background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black background please help!

    or maybe the interface has been set to Dark?
    Go to Preferences > Interface tab, choose Light from Color Theme dropdown on Apearance section (upper part of the window)

  • How to send a work item ( Mail ) as open tasks in WEB UI

    Hi,
      I have a requirement as to send a WF work item of mail text to WEB UI as open tasks.  Upon click of te link; the mail txts comes there with the link detials to the service contract number and service contract quotation. Upon click of the links it need to redirect to the respective documents.
    The requirement is as such that 60 days prior to the contract end date we need to trigger a mail that 'the contract expires in 60 days,do you  need to renewal it'. This text need to go to the WEB UI respective agent of this mail as tasks. Upon click of the task description link need to navigate to the mail text with the details of the contract and quotation numbers in link. upon click of the lnk it needs to navigate such that they can change accordingly and the contractrenewal process is completed.
    How to acheive this one.
    Thanks and Regards,
    Satish Akkina

    Hi,
    Sending Mail to Outlook : U need the Following things done for this:-
    1> Use the Mail Step in the WF and Choose the Receipient as the E-Mail Address and Give the E-Mail Address there.
    2> Check the Configurations that need to be done in Transaction SCOT. SMTP Server Settings are done to get the Desired Results.
    From the external mail, they should have the flexibility to approve or reject PO.
    To get Workitems in Outlook..!!
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/workflow%252bscenario
    Problem in transferring the workitems into OUTLOOK
    /people/saujanya.gn/blog/2006/12/19/how-to-get-work-items-your-outlook-inbox
    Workflow Items in Outlook
    Let me know if u still face any issues.
    Regards,
    Kanika

  • Auto closing of open Purchase Orders

    hai all
    My requirement is to find all the Auto closing of open Purchase Orders which donu2019t have any more use in business transaction
    using BAPI.pls send me one sample report
    regards
    Asish.

    Hi Lebogang
    Go to the open items list under sales or purchasing reports, select PO's on the top right and then highlight all the PO's you want to close. Then right click on the grey area on top of the report and select close. This will close all at once.
    Kind regards
    Peter Juby

  • Form Filler Yellow Task Bar Link Does Not Open task or do anything SharePoint 2010 InfoPath 2010

    Form Filler Yellow Task Bar Link Does Not Open task or do anything (SharePoint 2010 InfoPath 2010)
    Using a SPD workflow to run a approval process. This is a non-browser form. User receives task notification, opens form in IP Form Filler and sees yellow task bar notification. User Clicks on open task, nothing happens... OS = XP, On Win7
    = We get a never ending download box, and several logon security windows
    Attempted Fixes
    Clear
    InfoPath Cache
    Workflow History Looks good

    Hi,
    I understand that when you click on Edit this task in the message bar in InfoPath 2010, nothing happens. Does this happen when you open the email which contains the ‘Edit this task’ link?
    If so, you can try to check whether this key is in your regedit. If so, you can delete this key and have a test.:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility\{00000000-0000-0000-0000-000000000000}
    Back up the regedit keys before making any changes. For more information about backup and restore the regedit, please refer to these sites:
    Fix “Edit this task” In Outlook 2007:
    http://vettekerry.wordpress.com/2008/06/11/edit-this-task-in-outlook-2007-doesnt-work/
    How to back up and restore the registry in Windows XP:
    http://support.microsoft.com/kb/322756?wa=wsignin1.0#method1
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

Maybe you are looking for

  • How to install Premiere CC (not 2014) on a new machine?

    Just added a new machine to the studio, and am looking for a way to install Premiere Pro CC 7.2.x. The rest of the studio still hasn't upgraded to 2014 (and, no offence Adobe, but your track record means there's a few good months of forum-watching st

  • Need help with advanced JTable

    The application I am converting to Java has a string grid (table) with special behavior that I need to be able to bring to the Java version. It let's users filter the column data (that I know how to do) using a locked first row (just below the column

  • New to Mac and iWeb, was use to Dreamweaver on a PC

    Hi All I am a newbie to Macs, I have been publishing my web site via Dreamweaver for a few years. I have seen the iWeb application on my Mac but for the life of me I can not see how I can import my site to the iWeb application and publish from here,

  • Apply License for Adobe Interactive Forms

    Hello Experts,                         I Have installed and configured Adobe Interactive Forms using temperory license                         Can anyone tell me under which catagory do I need to apply for Permanent License                         In

  • Clearing out the counters on the WAE 512 interfaces

    Can anybody please tell me how to clear the counters on the WAE 512 interfaces? Thanks..