Terminating Event to Event Queue due to Work Item Lock

I have a dialog workflow task based on an asynchronous method defined with a terminating event.  When the user executes the work item, the method generates the terminating event (via a V2 change document) but the work item is enqueued (locked) by the same user (locked when they execute the work item from SBWP) and therefore the terminating event goes into error and is placed in the event queue.  The background job which processes the event queue does not redeliver the event so it stays in the event queue and the work item fails to complete.  Other than dequeing the work item lock myself with a function call how do I get around this catch 22?

Hello Martin,
Actually, the locking happens whether I have the task as asynchronous or synchronous.  The problem is the timing. If the user does not release the lock (by backing out of the dialog which is executed) prior to the terminating event attempting to enqueue and complete the work item then the event goes into error and is inserted into the event queue (and lingers there indefinitely, almost). Another issue with the asynchronous approach is that even if the user backs out of the dialog before the event actually attempts to complete the work item they will still see the work item in the inbox unless they click the refresh button when they get back to the inbox. 
I have changed the task to synchronous but here is my scenario and another question.
The process being workflowed is the approval of service entrysheets (similar to an invoice if you are not familiar with External Services).  In our process, there are a large number of documents being created and requiring approval by particular approvers.  It is a normal scenario for an approver to have, lets say 25 documents in his inbox awaiting approval. It was not practical for him to have to navigate back and forth between his inbox and the approval task screen.  Therefore, I give the users the option of (when executing a work item) having all the documents in his in-box (for this particular task) be presented in an approval list screen.  They can then do a mass approval of the 25 documents with 1 click and 1 navigation.  This list screen is also available to be executed outside workflow via a tcode.  So, when the user executes the mass approval (either from the inbox or outside workflow) the work items are terminated via the terminating event assigned to the approval task.
A couple of issues remaining:
1) Given my example of 25 work items (user executes 1 work item from in-box
and I displayed all 25) being approved, when the user returns to the in-box, the 24
items remain in his inbox until he clicks the refresh button since these were not actually "executed" from the workflow engines point of view.  However, these were terminated successfully because they were not "locked".
<b>Question:</b> Is there a way (user exit?) to trigger the inbox refresh automatically.
2) Now, the issue with the actual work item which the user executes from the inbox.  As I mentioned, the work item is locked as soon as the user executes it and is not released until they back out of the dialog or logoff.  So, here is what happens:  If the terminating event is sent before the lock is released the event is sent to the event queue.  If they then back out back to the in-box, its OK since I put some code in the SWO1 object type program (rememeber, its now synchronous) which will determine if they did the approval/rejection and the work item will complete and the event in the event queue will be deleted the next time the Event Queue Background job runs (it deletes any events for work items already in COMPLETED status). However, lets say they simply log off rather than backing up to the in-box or they don't do anything and are eventually logged off by timeout. In this case the code in the object type program to determine if the approval/rejection was done does not get executed (control does not return to the object type program) and the work item remains in "STARTED" status and remains in the users inbox and the event is in the event queue. So, now we have a work item that should be completed still sitting in the users in-box and the terminating event in the event queue. So the next time the user goes to their inbox the work item is still there.  The interesting thing is that though this may be confusing to the user, if they then attempt to execute the work item, they will get a message: "Work item currently being completed by event" (Message SWF_RUN 644) and the event sitting in the event queue gets redelivered and completes the work item.  To alleviate this problem I was thinking of adding a call to SAP_WAPI_WORKITEM_COMPLETE in the approval list screen after they do the approval but I'm guessing it wont work since it probably will try to enqueue the work item and it will still be locked. 
Hopefully you haven't nodded off reading this rambling note...
Thank you,
Bob

Similar Messages

  • Run an event when update or create TFS Work items

    Hi
    I have tried to check for updates in work items in TFS(new work items or changes in available work items).
    Then I need to write title of the changed work item to a text file.To do it I am using system center Orchestrator.
    I have integrated tfs 2010 integration pack to it. So I could be able to create a new bug and edit existing bug. Then I could be able to get work item and write some property to a file.
    Using that integration pack. But I could not found a way to detect changes in TFS work items and do some thing.
    I tried monitor work items query to detect the changes.
    I have used query to query bug
    select * from WorkItems where [Work Item Type]='Bug'
    Query interval(seconds)-10
    Query in day precision - false
    get changedwork items-true
    When I run the runbook it do not go to next step and stop running. Runbook shows the status as warning!

    My suggestion would be to do this using a run .net script activity with a powershell script inside. If you want examples of working with TFS from powershell check out
    https://gallery.technet.microsoft.com/-SMA-Integration-20cb04cf -- there are a bunch of scripts in there that monitor and take action based on tfs changes.

  • SM58 Errors due to Work Item/Task

    Hello,
    we are getting a lot of sm58 error messages related to a workflow task TS00007989 (Error during outbound processing).
    All the errors carry the same message "Work item 000000549001: Task TS00007989 locked for  instantiation"
    What could be the root cause of this issue? Is it possible to resolve this without deactivating the standard workflow task.

    Hi Mohan,
      Its RFC error. Please check the workflow instance using T-code SWI2_DIAG to get details about this error. Also you can contact your BASIS Team for the same to check the connectivity of the system for which these IDOCS get triggered.
    Also check the T-Code WE02 to get details about error in IDOC.
    BR,
    Prakash

  • Repetitive Work Items for the same trip in UWL

    Hi Experts,
    Every time user clicks on save and send button , work flow gets triggered and work item is sent to user's UWL.
    For the same trip no multiple workitem are appearing in approver's uwl.
    Please suggest how we can restrict one work item at a time.
    Regards,
    Kamal

    Dear Surjit,
    1) Create a parallel fork, in the starting point of the workflow. In one branch put all the step which you developed.
    It was already created.
    2) In another step, create a "Wait for Event", in this call the change event.
    I changed from Created Event to Changed Event.
    But still the previous work item is not getting completed.
    When I have checked in SWEL.
    When I changed the Travel Expense then 2 events are trigerred.
    i)  Changed
    ii) Created
    Work Item is trigerred through Created Event.
    Do we need to map the Work flow object with Events somewhere ?
    Regards,
    Kamal Rawal
    Edited by: Kamal Rawal on Mar 26, 2009 11:43 AM

  • Terminating Event Terminating all work items

    System : Solution Manager
    Business object : BUS2000116
    1. I have multiline container element for Agent.Agents are Dynamic not static.Approval from all agents is required.
    2. Work flow desing
    a.Defination of Agent : ABAP Dictionary type SWP_AGENT with Multiline
    b. FORK with two steps , One step Required
    c. One part of FORK has WAIT FOR EVENT "REJECTED" Event and other has Activity with Agent "_underline []Agent()Index of: Agent _underline"
    d. Under the Miscellaneous tab Multiline line element Agent.
    e. Terminating event for this activitiy is APPROVED Event, which I have defined in business object.
    Let say in Program [Custom tab for standard transaction CRMD_ORDER] I have three agents I am getting Three work item in the workflow log with different Agent.
    PROBLEM:
    When any user open the workitem from SAP Inbox and APPROVE it[ Custom button on standard screen CRMD_ORDER], Program raises Event APPROVED by using Function Module "SWE_EVENT_CREATE". But it set other two work items also in Completed status.
    concatenate 'US' sy-uname into v_creator.
            call function 'SWE_EVENT_CREATE'
              exporting
                objtype                       = c_objtype    "BUS2000116
                objkey                        = objectkey    "Key field Which is GUID from CRMD_ORDERADM_H  table
                event                         = gs_event      "APPROVE"
               creator                       = v_creator
                take_workitem_requester       = 'X'
              START_WITH_DELAY              = ' '
              START_RECFB_SYNCHRON          = ' '
              NO_COMMIT_FOR_QUEUE           = ' '
              DEBUG_FLAG                    = ' '
              NO_LOGGING                    = ' '
              IDENT                         =
             importing
               event_id                      = v_eventid
               receiver_count                = v_count
            TABLES
              EVENT_CONTAINER               =
             exceptions
               objtype_not_found             = 1
               others                        = 2
            if sy-subrc <> 0.
              message id sy-msgid type sy-msgty number sy-msgno
                      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            endif.
    Please let me know what could be the reason?
    Thanks in Advance.

    I think instead of using a event you can use a container element. You want to make sure that the users performs the approving action properly. If the user does that inside your code you set this container element as X. You pu the approval step inside a loop that checks whether the container element is X. Also another important thing you need to put the parallel approval step along with the loop inside a subworkflow.
    Thanks
    Arghadip

  • Flush Event Queue doesn't work with "Key up"

    Hi,
    probably just a simple thing I am missing here. See the attached VI (including SubVI). In case 1 I fetch the Key Up event for ENTER and issue a Value Change on the Stop Button. This results in a check for the string length and in case it is too short brings up a dialog telling you the ID string is too short and brings you back to the ID entry. Unfortunately - when confirming the dialog with ENTER instead of using the mouse on the button theKey Up event fired again and therefore fetched by the Event Structure.
    So I thought I just flush all events in the queue. To be sure, I put a time value on the flush function which proceeds AFTER the dialog is completed, so the ENTER Key Up should be deleted as well. Bummer is - it doesn't work. Anyone know why?
    I tried as well with the dynamic event, which I unregistered right after the Stop Event is issued in the Key Up case. I then "re"register for the Key Up event at the same time/position as the flush event queue function is positioned now in the VI below. Still no joy.
    What is my mistake? Thanks a lot.
    Solved!
    Go to Solution.
    Attachments:
    Manual_ID_Entry.llb ‏47 KB

    comrade wrote:
    I don't understand 2 things:
    a) Why is the Key up event even fired? It doesn't come from the VI where the event structure resides and to which "Instance" the event is bound (VI->Key up), but from the dialog box (which is a different VI). Unless a calling VI inherits all events from its SubVIs or something like that.
    b) Why isn't the event fired by the button in the dialog box discarded as the flush event queue function is supposed to perform?
    Because you are slow.  Not you personally.  But compared to the computer, you just don't stand a chance.  So you hit the Enter button on the dialog.  That dialog's OK button activates on the key down.  So the dialog is long gone by the time you manage to get your finger off of the Enter key.  In fact, you loop should be back around to be waiting for an event first.  So it is waiting for an event when you finally get your finger off of the button.  Hey, we have a Key Up event!
    Your current checking for the validity of the id is just flat out annoying.  Use the Key Down? event to check for a valid character being entered.  Notice the '?' in my choice of event there?  That means it is a filter event.  This means you can throw away (discard) the character being pressed before the control even sees it.  You could also discard if there are already enough characters (Greater Or Equal, not Equal).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • OpsMgr Management Configuration Service failed to execute 'DeltaSynchronization' engine work item due to the following exception with event id 29181

    Hi , sometimes this error shows in event viewer:
    OpsMgr Management Configuration Service failed to execute 'DeltaSynchronization' engine work item due to the following exception
    Microsoft.EnterpriseManagement.ManagementConfiguration.Interop.ConfigManager.ConfigurationChangeException: Configuration change occurred during delta synchronization. Delta will be restarted
       at Microsoft.EnterpriseManagement.ManagementConfiguration.SqlConfigurationStore.ConfigurationStore.WriteConfigurationDelta(IConfigurationDeltaDataSet dataSet)
       at Microsoft.EnterpriseManagement.ManagementConfiguration.Engine.DeltaSynchronizationWorkItem.TransferData(String watermark)
       at Microsoft.EnterpriseManagement.ManagementConfiguration.Engine.DeltaSynchronizationWorkItem.ExecuteSharedWorkItem()
       at Microsoft.EnterpriseManagement.ManagementConfiguration.Interop.SharedWorkItem.ExecuteWorkItem()
       at Microsoft.EnterpriseManagement.ManagementConfiguration.Interop.ConfigServiceEngineWorkItem.Execute()
    thanks

    For this issue, You can refer below link
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=se&lc=sv&dlc=sv&tmp_geoLoc=true&docname=c03699441
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • Handling events in subvis - think this should work but it doesn't.

    In part of a large project I need to handle key down events, but elsewhere I need to handle them differently and want to be able to dynamically register and unregister them in each location. I also want to be able to put one of the event handlers in a subvi. To quote the Help system, "Dynamically Registering Events: With dynamic registration, you can handle events in a subVI rather than only in the VI where the events are generated."
    ViThatHandlesEvents.vi handles key down events. It uses dynamic event registration to demonstrate that it works (though in this simple example it isn't necessary).
    ViContainingSubviThatHandlesEvents registers key down events and passes this to KeyDnEventHndlrSubVI. I thought it would work but it doesn't.
    Attachments:
    KeyDnEventHndlrSubVI.vi ‏14 KB
    ViThatHandlesEvent.vi ‏22 KB
    ViContainingSubviThatHandlesEvent.vi ‏18 KB

    cebailey wrote:
    Here's a version with Panel > OwningVI > Key Down selected in the nodes that register events. It seems to do what I want. It acts on keystrokes that occur when the cursor isn't even over the parent's window, which is good in my situation. I made these choices by experimenting - is this a good approach, if I want to act on all the keystrokes that occur when the parent VI has focus?
    As you noted, this will have the event structure respond to keypresses whenever the parent VI is active. You can simplify the subVI by simply wiring the "VI Refnum" terminal directly to the Register for Events node. Getting the Panel, and then the Owning VI simply gets you back to where you started.
    That's a valid way of doing it, and I'm assuming that this is intended to be a test case. As you noted you have a large project, so I don't know what your overall architecture is, or how you intend to use this technique, so I can't really say whether it's a "good" approach. It's an approach.
    Say, I should have said this before, but you have to be pretty good to answer the question somebody should be asking, especially in brief forum postings.
    Thanks for the compliment. It's just a matter of seeing a lot of code and a lot of questions. I'm only a teenage pup compared to the real veterans on this board.

  • Event put  in queue....

    Hi,
    Im trying to trigger a workflow to do my testing which is already working in prod (im doin my testing in QA). The event gets trigerred in another workflow. Im doin all the steps which triggers the event, but when I check in SWEL there are two entries for the event one says "event put in queue" the other says "SWW_WI_CREATE_VIA_EVENT"... I checked everything ... I dont know whats the problem. Please help me out gurus...
    Thanks,
    Sukumar.

    I think you hvae enabled the option Enable Event QUEUE in SWETYPV to know more
    SAP say's
    Event Linkage: Enable Use of Queue
    This indicator is only evaluated if the event queue is active. If the indicator is set, the event receiver is started via the event queue. If the indicator is not set or the event queue is not active, the receiver is started immediately.
    Once the event has occurred in the system, this receiver is not started immediately, but is first put into the event queue. The event queue is processed at regular intervals by a background job. Processing the event via the event queue means that the system load can be reduced if a lot of events occur for this linkage in a short period of time. The load reduction is achieved by not calling the transactional RFCs for the start of the receivers immediately (increasing the load on RFC processing), but in small numbers with time delays instead.
    Using the event queue hence delays the calling of the receivers.
    The above information is provided in the F1 help of SAP for the option
    Disable this option and try to execute the workflow again
    It will work
    and also compare the workflow configuration settings in SWU3 Txn in both Prod and QA

  • How do I keep my home calendar events from showing up in my work calendar (outlook)? I have my work e-mail on my phone and need to see the work calendar but I don't want personal appointments showing up on it, like drs. appointments, soccer games etc.

    I want to keep my home and work calendars separate but be able to look at both on my phone. I don't want my personal appointments and events to show up on my work calendar, although it's fine if work events show up on my home calendar.  When I delete a personal appointment from my work calendar in Outlook, it disappears from my home calendar on my phone. I just want it to disappear from my work calendar!. FYI, I have my work and personal e-mail accounts on my phone.
    Thanks for any help/advice you can offer!
    AlinaM

    When you say "use the same purchasing apple ID for both to share books/music apps"- will this allow him to see what apps I download on his ipod (don't want)? will this allow me to continue to see what apps/games he gets on his ipod, on my phone (do want)? and do I set those changes on both devices?
    To do this:
    iPhone: Settings > iTunes & App Stores > Automatic Downloads:
         Music: ON
         Apps: ON
         Books: ON
    iPod: Settings > iTunes & App Stores > Automatic Downloads:
         now you decide what he gets automatically.
    He doesn't use game center, imessage, facetime or anything else (mainly just games, music and picture taking)- so does he really need his own apple id and email address? also- if he wants to start getting text messages, would i still have access to all of them if he has his own apple id? would i have access to them if he stays on my apple id?
    Then he doesn't need an Apple ID.
    Switch in
    Settings > Messages >
         iMessage: OFF
         Send & Receive > Apple ID: > sign out
    Settings > FaceTime > FaceTime: OFF

  • Event Log Help Links No Longer Working?

    Have the help links in the Windows XP event log entries been discontinued?
    They used to open up the Help and Support Center with further information about the Event Log error if it was available.
    For some time now they have all just given a "page not found" error, which then re-directs to Bing with offered results that are no use at all!
    This happens now on every XP system I've tried it on.
    As a user of Windows 8.1 as well as XP, I'm well aware that the Windows 8 Event Log help links have never worked so far, but the XP ones always did, and despite the looming "End of Support" I can see no reason for all that information to have been
    removed.
    Any explanation for this?
    Thanks, Dave Hawley.

    Hi - thank you DaveHawley for the report. Just wanted to confirm that I've passed this on to the team that looks after the redirect service behind the "More Info" link.
    There have been some major changes in how this redirection works over the years as well as in the last months. The most recent efforts added the option to enable use of the TechNet Wiki [sample]
    to allow the community to comment & contribute for a given component. I'm only guessing here, but this might have accidentally impacted XP.
    Thanks
    Bruno

  • TFS work item store is not connecting in production server using server side event handler code

    Server side plugin code to connect to work item store
    tfs = new TfsTeamProjectCollection(new Uri(tfsUri));
    store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
    I used the above code and accessed work item store in my TFS DEV server without username and password. But the same plugin code is not working for the TFS Production server.
    Exception:
    Account name:
    domain\TFSService Detailed Message: : TF30063: You are
    not authorized to access http://localhost:8080/tfs/xx. Exception Message: TF30063: You are not
    authorized to access http://localhost:8080/tfs/xx
    Please guide

    Hi divya,
    From the error message, you might not have the permissions to get the work item store in TFS production server. You can check the permissions on your production server by using
    tfssecurity command in VS command line.
    Please execute tfssecurity /imx “domain\username” /collection:url, for more information about tfssecurity /imx, please refer to:
    http://msdn.microsoft.com/en-us/library/ms400806.aspx 
    If you have the permission, then you can also clean team foundation cache and try again.
    Best regards,

  • Disabled button fires events to event structure

    Hi all,
    I was trying to disable a Button on the frontpanel by using its enabled property while the event was executed. The ide wa not to create more events of this buttopn while its fucntion was executed. However thsi did not work.It was creating events even though it was greyed out.
    I troied two different versions:
    1) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and then enabled it again
        Result: All events were generated even though the button was greyed out
    2)  in the event case of the button (value changed) in a sequence I disbaled the Button and then started a second event. The Second event executed the code and then enabled the Button egain
       Result: Even though the Button was greyed out events were generated
    3) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and in the timeout event I thenenabled it again
       Result: No additional events were generated
    it seems that the enable state of the button is analysed at teh time when the event is execute din teh event case but not at the time when it was created?
    So I Tried the Time Input of the case expecting that it woudl give me a time stamp of the time when the key was pressed - but instead it gave me the time point when teh event was executed...
    Teh only othe rsolution was to set teh cursor to busy (however I dont want to see the changed cursor during the busy cycle)
    So how can I make shure that no additional events are fired during the time teh code of the Button s executed?
    Thanks for any help,
    Rainer

    to altenbach:
    The evet takes about one or two seconds - I checked the behaviour as shown in the attached examples with LV 8.5, LV 2010, TV2011, LV2012 - allways exactly the same behaviour.
    It does not make any difference weather you use switch when pressed or latched when pressed.
    It does not make any difference weathe ror not you tag "Lock front panel" for that event
    to sth:
    > If you disable a front panel control (ie the button) you cannot click on it and a value changed event will not be
    generated.
    This is my experience so far as well, but if you disable and enable the control within the same event it does not work (see attaced example 1) and 2). It only works if you do the enable in the timeout event.
    > The time stamp from the event case left hand property is the time of the event not the time of execution.
    > If you ask for the timer value inside the event case it will be the time of event case executing.
    In the attached exampel this is not the case. The time differecne between the Time input on the left and the Tick count
    placed in the event is 0 for all events generated whil the button is supposed to be disabled.
    As I wrote before, the explanation I have for this behaviour is that the events are generated by windows weather or not
    the button is disabled and they are queued to the event cue. Only when the event is handeled LabVIEW tests weather
    or not the button is disabled and ignores the event in case it is disabled. If the Disabling and enabling is done
    withim the same event the button pressed events are added to thw event queue and the button is set to enabled before the  next event (button pressed while it shoul be disabled) is handeled. When that event is handeled the button is enabled again (by the original event) and therefore the evenet is not ignored (because by the time of execution of the event the button is enabled again).
    If the button is enabled in the timeout event instead of the button change value event all event in teh queue are executed before teh timeout event. At their time of execution therefore the button is steill disabled. Only then the timeout event enables the button again.
    If the vi is set to busy (sand clock) this is activating actually a windows function/property and no events are queued to teh event queue by windwos. Therefore no button change event is added to teh queue.
    Funtciomn of the 3 attached Vis (LV 2010):
    Run the Vi, then press the Test button once - when it is greyed out click it a few more times. The test button value
    changed event has a 2 second delay. You will see the event counter increase, and you will see the time difference
    between the time property on the left of the event and the tick count vi whci is displayed in the waveform chart.  
    DisableButton 1: Disable and enable are ste in teh same event  
    DisableButton 2: The button is disabled then a second event is called to do the work and then enable teh button again
    DisableButton 3: The Button is disabled in button change value event and it is enabled again in teh timeout event.
    Attachments:
    DisableButton1-3.zip ‏29 KB

  • Integration Event - Delete Events

    Is there any way that I can delete individual events in the queue?
    documentation says,
    "If the DateTime argument is supplied, all
    events older than the specified date and time are deleted. If the LastEventId argument is supplied,
    all events older than the specified event are deleted"
    Getevents returns the modified date. If I pass the modified date to the delete events as a parameter, would it delete all the events older than the modifled one + the exact match of the date time filed.
    thanks

    I've deleted events by the last modified date in the past and it has worked for me, it will also delete the event for the record that the last modified date was taken from.
    I did have some flakyness when there was only a single record in the event queue and I tried to delete it by the last modified date, it wouldn't remove it.

  • Calendar on iOS 7.1: Cannot Save Event - That event does not belong to that event store.

    Hi All,
    I have an iPhone 5 running iOS 7.1.
    Yesterday, while updating a birthday in the iPhone iOS calendar app (default calendar = GMail), I noticed that the new 'List View' in the iOS 7.1 calendar (and only that view) showed an event called 'New Event' - which has a start date of 2014 and an end date of 2001. If I go into that event, it will show me no title and no location - only, as mentioned, funny start and end times. The 'Delete Event' button is completely missing. This 'New Event' does not come up in any other view.
    Trying to input a ficticious title with a valid start and end time into that event slot leads to a message from the calendar app saying: "Cannot Save Event - That event does not belong to that event store." I have deleted all calendars and re-add them again via settings, with / without soft and hard reset and tried every possible combination. Yet, the event will not disappear.
    The funny thing is that this 'New Event' will still showed up, even when my GMail, work and iCloud calendars were disabled. I have, however, subscribed to a GMail calendar for Australian holidays, and there is a built-in 'Birthday' calendar that pulls the dates from the contacts (I do not use that contact field, though).
    Does anyone have a similar issue? Any suggestions how to fix it?
    Thanks in advance!
    Edit: This 'New Event' does not seem to sync to any calendar other than on the iPhone - not to Gmail, not to work, not to iCloud.

    Had same problem. Although the phone looks off   it actually isnt.  If you actually turn it off and then on again this problem will disappear. I think its a memory overload issue that is solved by clearing the memory by turning it off.
    Worked for me

Maybe you are looking for