Wait for Event won't work

Hi Guru,
I delegated an object zus2000140 and created a template.  everything was working until I added a "wait for event" as the first step, because I have to make the workflow to wait until "Assignment" created for the service item record.  What I did were:
(1) In object zus2000140, added an event "Assignment"
(2) Created a step as wait for event with
                       Container Element      ZUS2000140
                       BOR                            ZUS2000140
                       Event                          ASSIGNMENT
(3) Binding: ZUS2000140 <-- EVTOBJECT
                   WFINITIATOR <-- EVTCREATOR
(4) Created a program by calling 'SWE_EVENT_CREATE'  exp  objtype objkey and event (as "ASSIGNMENT")
      and tables event_container.
After this program run, I noticed the table event_container is empty.
Now the step wait for event is forever waiting.  Can somebody point out what might be wrong?   Thanks.

Thanks for replying.  Here is the code
CONSTANTS: c_objtype type SWO_OBJTYP VALUE 'ZBUS2000140',
             c_event   type SWO_EVENT VALUE 'ASSIGNMENTSTART'.
  CLEAR: objkey, wcont.
  REFRESH: wcont.
       objkey        = '4BB404B1E25002D0E10080000AD414AD'.
      CALL FUNCTION 'SWE_EVENT_CREATE'
           EXPORTING
                objtype           = c_objtype
                objkey            = objkey
                event             = c_event
           TABLES
                event_container   = wcont
           EXCEPTIONS
                objtype_not_found = 1
                OTHERS            = 2.

Similar Messages

  • Workflow WAIT FOR EVENT STEP deadline not working

    Hi,
    Need some inputs for the experienced people;
    I have a wait for event step in a workflow with deadline monitoring (Latest End) but it doesn't seem to work.
    Ofcourse, all the required setting are in place and deadline works fine for other Activity steps.
    The problem is specific to Wait for event step.
    The alternative is having a fork but I just want to know why the wait step with deadline doesn't work.
    Thanks,
    Roopesh

    Hello Ajay,
    Can you share with us what did you do to solve your problem?
    I'm facing the same thing in my project now, I'm wandering if you could help me with this one.
    I have this wait for an event step wich is configured to wait 4 minutes since the work item creation. I've also selected 'Modeled' on the Action field, and a display text for the outcome.
    But in one of my tests, the event hasn't occurred and the workflow stuck in this task forever.
    Thanks in advance.
    Regards.
    Actually, I think I got this handled. This thread was really helpful to me: http://scn.sap.com/thread/47482
    Message was edited by: Leandro Farias dos Santos Abreu

  • Wait for Event not Complete

    I have a Wait for Event step in a simple workflow. My problem is that the step won't complete even if the event is already triggered.
    In SWEL, the event is there, and Object Key and everything else seem right to me. And the Work Item Instance is there too. Check picture 1 for screenshot of Event Trace.
    In SWI1, everthing is fine except that the Wait for Event has only one action "Wait step Created". The WorkItem ID is the same as Receive Object Key in Event Trace. The object in the Wait step has an instance and LPOR is correct.
    The configurations in Instance Linkage is also attached. I suppose it should be automatically added when Wait for Event is set up in the workflow. But there was no entry so I had to do it manually. I also tried Receive Call method CL_SWF_RUN_HANDLER_EVT_RECEIVE. The result was the same.
    A screenshot of SWU0 is also attached. To me it says "something is wrong" which I already know well.

    Hello,
    "I have a Wait for Event step in a simple workflow. My problem is that the step won't complete even if the event is already triggered."
    What should the workflow do when that event is detected?
    "In SWEL, the event is there, and Object Key and everything else seem right to me. And the Work Item Instance is there too. Check picture 1 for screenshot of Event Trace."
    I agree, it looks okay.
    "The configurations in Instance Linkage is also attached. I suppose it should be automatically added when Wait for Event is set up in the workflow. But there was no entry so I had to do it manually."
    There is no need to do that, in fact it may be causing the problem. Try removing it.
    "A screenshot of SWU0 is also attached. To me it says "something is wrong" which I already know well."
    Why do you say that? I would use SWUE to create the event.
    regards
    Rick Bakker

  • Process chain Error: This AND process is not waiting for event RSPROCESS

    Hi All,
    I am facing an error in the process chain in PRD.
    Error message: This AND process is not waiting for event RSPROCESS.
    We had a process chain which had two sub chains which run parallel and below of this we had AND process type and below of the AND process we had 4 more jobs.
    Once the two subchains got successfully loaded, the and process should turn to green and further 4 jobs should start.
    It is a daily load , it worked fine from past years,but suddenly the AND processtype is getting failed.The thing is in the two subchains if one got completed, the AND process process is not waiting for 2nd subchain to get completed.The AND process is turning to RED (status: cancelled) . I tried to repeat the AND process once after above 2 subchains loaded, but it didnt worked.
    And i removed the existing AND process and created a new one and placed it in same place and activated and schedules again.but still it is getting failed with same error.
    Thanks in advance,
    Sai Chand.S

    Hi,
    If you did any transports related to that metachain we face similar kind of issues.
    not only the AND process , we need to remove all the process before executing the AND process and create it again.
    It helps you, you said your in production So you should take the proper approvals and do it.
    Regards,
    Yerrabelli.

  • Error in Workflow wait for event node

    Hello Experts,
    I am working on one QM notification. I shall explain the scenario first:
    1) User will take the usage decision on inspection lot in QA11. When user will take decision and save inspection lot BUS2045 event USAGEDECISIONMADE will be triggered and initiate my workflow here.
    2) After workflow initiation system will create notification and send to approver, but here i have wait step in my workflow for BUS2078 - Created (Notification).
    wait for Event step
    BO: BUS2078
    EV: CREATED
    I am posting error below:
    Error when starting work item 000000294361
    Error when processing node '0000000060' (ParForEach index 000000)
    Error when creating a component of type 'Wait Step'
    Error when creating an event item
    Error within method CL_SWF_RUN_WIM_EVENT->_CREATE_WORKITEM_CONTAINER
    Error within method CL_SWF_RUN_WIM_EVENT->_GET_INIT_WORKITEM_CONTAINER
    Workflow 000000294361 wait step 0000000060: No valid object ID in container element 'Notification
    Node 60 - wait for event step.
    Re.,
    Guri

    Hi,
    Based on your description what I felt is you are making use  of a wait step in which you have choose to wait till BUS2078 event CREATED is occured ... right.. Now can you please clear me that where and how this event will triggered.
    or is it some thign like you are making use of event creator step and in this case, When ever you are making use of the eventcreator  step and a BOR object inside it make sure that specific BOR object is already instatitaed in the workflow container , if it is instantiated then only it will try to identify the instance  or the BOR and it will try to rasie the event.
    Regards
    Pavan

  • Bpm:message being sent and wait for event

    Hi,gurus:
    My scenario is about BPM.In the integration process I used a loop and correlation.The scenario worked successfully yesterday,but after I changed some thing,it did not work.The outbound status of the message in sxi_monitor said "message being sent".And when I clicked PE to see the workflow log, it said " wait for event".
    Thanks in advance.

    Could you tell me how to reimport the integration progress in ID?
    reimport means...delete the already imported BPM from ID.....this would affect the corresponding ID objects....save and activate....and then again run the import Integration Process wizard....create the objects once again.....seems time consuming.....hence mentioned it as the last option in the list:(
    Also from SWWL delete only the instance with status as ERROR.
    Edited by: abhishek salvi on May 20, 2009 9:30 AM

  • NiDCPower Wait For Event

    Hello,
    I am using the PXIe-4139 SMU to source a current sequence that starts when a trigger is received and takes about 40 seconds to complete.
    After the niDCPower Initiate VI I have inserted the niDCPower Wait For Event VI with a timeout set to 300 seconds to allow for enough time to receive the trigger and complete the sequence. This VI waits for the Sequence Engine Done Event.
    Now this works fine, however, when the user wishes to stop the programm for whatever reasons, they have to wait the full 300 seconds until the Wait For Event VI produces a timeout error and stops the programm. This is rather inconvenient. How can I change the programm so that the user can stop it even when the Wait For Event VI hasn't reached its timeout?
    I tried this:
    But this doesn't work. For some reason, I get a timeout error with code -200474 but the boolean operator returns FALSE.
    Any other ideas?

    If there an output on the wait for event VI that flags a timeout? If so, set the timeout short (like 100 msec) and wait for 3000 timeouts before continuing on.
    Oh, and use an event structure. Timeout event (timeout=0) checks the wait for event, value change event for button breaks out of loop.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Need help on Wait for Event.

    Hello all.
    I faced an issue with wait for event step,Which goes like this.
    For a workflow one of the fork branches there is a wait for event step(wait for manual release) . On development server when ever that event is fired (manual release) , the wait for event is capturing and completing the workflow ( This is the correct process).(PO release procedure)
    On production system, this event is not been caught(after manual release is done) and and the workflow is not  complete and still in progress. (even po is released manually) Which should not happen.
    So what all the things i need to verify in the production to fix this. I cannot simulate any kind of event on production ryt. so please suggest.
    please suggest.
    Cheers
    PRASAD.

    Hi Prasad
    i doubt that in Production the event trace would be on. Check SWELS to see if you see the "OFF" button (this means the trace is on). If it is On, check SWEL to see if any event is there for rejection. You will have to ask example of the PO and search using the Key (PO number).
    Also, check the workflow instance which is supposed to complete when the rejection happens (which did not complete). Check the technical WF log. Look for the Business Object container element which should hold the runtime instance. Check if it has a value and the same is bound from the event to the workflow in the wait for event step's binding. (_EVT_OBJECT to Workflow Container element of same type). This WF container element should have an instance and should not be empty for the wait step to work.
    Regards,
    Modak

  • Wait for event step..

    hi all,
    I have a wait for event step in my owrkflow and it is working fine. My problem us i am not able to trigger this event using program can anyone please let me know what i am doing wrong. following is the code i am using to trigger the event
    DATA: key TYPE SWEINSTCOU-OBJKEY,
            object  TYPE  SWETYPECOU-OBJTYPE,
            event TYPE SWETYPECOU-EVENT.
      DATA: event_id LIKE swr_struct-event_id,
            return_code LIKE sy-subrc,
            input_container TYPE swr_cont OCCURS 0 WITH HEADER LINE,
            message_lines TYPE swr_messag OCCURS 0 WITH HEADER LINE,
            message_struct TYPE swr_mstruc OCCURS 0 WITH HEADER LINE.
    *  CONCATENATE pernr reinr INTO key.
    key = reinr.
      object = 'BUS2089'.
      IF action = 'APPROVED'.
        event = 'APPROVED'.
      ELSEIF action = 'REJECTED'.
        event = 'CANCELLED'.
      ENDIF.
    *  swc_create_object object 'BUS2089' key.
      CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
        EXPORTING
          object_type             = 'BUS2089'
          object_key              =  key
          event                   = event
         commit_work             = 'X'
         event_language          = sy-langu
         language                = sy-langu
         user                    = sy-uname
    *    IFS_XML_CONTAINER       =
       IMPORTING
         return_code             = return_code
         event_id                = event_id
       TABLES
         input_container         = input_container
         message_lines           = message_lines
         message_struct          = message_struct
    commit WORK.
    however if i execute the FM SAP_WAPI_CREATE_EVENT by passing the values it works fine.
    Thanks
    Saurabh

    Hi
    however if i execute the
    FM SAP_WAPI_CREATE_EVENT by passing
    the values it works fine.
    It will trigger only when you execute the above function module or
    SWE_EVENT_CREATE because 
    You have a BO and an event associated with it now when you want to trigger this this event through program then you have to make a kind of mapping between BO and your program so thta's what this Fm does, when ever you execute the program as you are passing all the values to the Function the Evnt associated with the BO is triggered.
    In order to trigger use SWE_EVENT_CREATE aand after calling this fucntion use COMMIT WORK statement
    Could you let  me know what condidtion did you write for the WAIT step to continue.
    Regards
    Pavan

  • Wait for Event FIPP - Completed Logically Deleted

    Hi WF Experts,
    We have a WF for Release of payments.
    It has 1 Fork with 2 parallel branches (both necessary).
    1 Branch has the approval process for Amount release and the other branch calling the Account assignment approval Subworkflow.
    The approval process branch has the until loop with increment counter and it picks the agents within the loop until a loop condition is reached and thereby till no more approvals required.
    The other branch, before calling the subworkflow, it checks a WAIT FOR EVENT FIPP->COMPLETED with container element FIPPID.
    Both these branches needs to be completed so that the forks gets ended and the wf comes out of the fork.
    The approval process branch is working perfectly. But in the other branch the WAIT FOR EVENT FIPP->COMPLETED  gets logically deleted and thereby, this branch does not go firther to start the Account assignment approval Subworkflow. This way the Fork with the 2 necessary branches does not end, and thereby, the WF stops here and could not go further to set release indicators (Which is a backgorund task).This will confirm the end of WF process.
    When I pass the WI ID for this Wait event in the SWIA, it shows the status as CANCELLED.
    The WF User log as a whole shows the status as COMPLETED as all the approvers has approved the release.
    Why is the Wait for Event gets logically deleted ?Please advice.
    Edited by: Sameer Anwar on Jun 12, 2011 9:17 AM
    Edited by: Sameer Anwar on Jun 12, 2011 9:21 AM

    Dear Experts,
    Any update on this . I am unable to sort this out why the Workflow is getting stopped.
    -Anwar

  • Wait for event step without callback

    Hi All,
    In 4.6C I have the following problem:
    We have a workflow that has a fork with 2 branches, with 1 necessary for continuing the fork.
    One of the branches has a dynamic parallel processing step on a multiline container element, where each parallel process is a wait for event step. For example if the multiline element has 5 records, than there will be 5 parallel wait for event steps on this branch, and if all 5 are completed, then the workflow continues after the fork and the other branch should be logically deleted (normal behaviour).
    The other branch has a single wait for event step, if this event is received, the other branch's parallel wait for event steps should be deleted to continue.
    The problem is that when the event for the latter single wait step is received, the step gets completed, but sometimes the parallel wait for event steps on the other branch are not deleted and the wokflow does not continue. The completed wait for event step shows that the callback is not completed yet.
    I tried to fix these steps in SWPC, but in 4.6C it does not work for wait for event steps w/o callback. There's an OSS note for higher releases where this is fixed to enable SWPC for wait for events, so I copied it to a custom program and use that right now.
    First question is why does the system not continue these workflow's when the event is received? My guess is that the tRFC calls get stuck and when the tRFC job reprocesses the entries, it does not do it correctly. For example lately we had a tablespace problem that caused some tRFC calls to go into error. The waiting steps in the instances were completed w/o callback. I reprocessed the tRFC entries, which created new entries in the Workflow logs showing that the events are received, but the workflows still hang.
    Second question, it takes a lot of time to logically delete those parallel wait for event steps. When the event for the single wait for event is received and the workflow continues w/o problem, it may take tens of minutes from the receipt of the event until the parallel wait for event steps get deleted and the WF continues. Why does it take so long?
    Thanks,
    KK

    Hi,
    Regarding the delay and the hundreds of thousand SWW_CONT updates... the main workflow on one branch does a dynamic parallel processing of a subworkflow using a multiline container element that can have 50 or even 100 elements. So we can have 50 or even 100 subworkflows waiting for their event to be triggered.
    The main workflow container contains many elements, some multiline with long structures, so in one instance the main flow had 8000 entries in SWW_CONT (each field of a structure is a separate record in SWW_CONT).
    Now if I do the math, when this workflow loads all the container elements of the main flow into the 100 waiting subflows before deleting them and continuing along the other branch, it creates 100 times 8000 entries in SWW_CONT, that is 800.000 inserts!
    And this was ONE single workflow.. Imagine when we have just a few hundred and they all want to continue at the same time...
    Anyway, the beauty comes now....
    I created a simple main flow with a single multiline import parameter USERS of object USER. It has a fork with 2 branches, 1 enough to continue. One branch is a user decision with 1 option: Continue. The other branch has a subworkflow and it does dynamic parallel processing with the multiline element USERS.
    The subworkflow has one single import element USER of object USER. It has only one step, a wait for event, waiting for the DELETED event of the USER object.
    That's the scenario.
    When I start the main flow, filling the USERS parameter with two user objects, on the first branch it starts the two parallel waiting subflows with one user each, and I get the decision step on the other branch. If I check the subflow containers this time, they only have one USER object each.
    Now if I complete the user decision, the workflow continues, logically deletes the subflows and completes. If I check the subflow containers after this, they all include the USERS multile container element with all the USERS I started the main flow with!
    So this time it was a different main flow, different subflow, different events. I guess there can't be any custom code doing this, unless there's some generic workflow user exit somewhere.
    Feel free to test this yourselves if you have 4.6C, quite easy scenario. Guess I'll try in ECC 6.0 too just to see...
    And I'll report to SAP for sure.
    Regards,
    Krisztian Klausz

  • Wait for Event in Fork - How to terminate the wortkflow in leg 2

    Hi Experts,
    My scenario is that there is a fork with 2 branches. 1 has a change Doc method. In this I have raised an enent when a action is performed which in turn calls a wait for event in other leg. The problem is that the other loop is executing but the workflow is not coming out of leg 1. The work item remains in the agents workplace.
    How to correct this?
    Thanks,
    Dinesh

    in the FORK step you have an option of mentioning the "necessary steps".
    it defines the minimum number of legs of the FORK step that must be completed before proceeding to the next step in the WF.
    mention the necessary step as 1 for your case.

  • Wait for event - workflow 4.7

    Hi, not sure if this is the correct forum for workflow or not but here is the problem.  I have a custom BOR with 2 key fields, both character.  The BOR has some some events one of these events is 'submitforapproval' and another is 'reviewed'.  The 'submitforapproval' event is raised by an external R/3 program and is used to trigger the workflow in question.  This works well.  The 'reviewed' event is also raised by an external program and is used in a 'wait for event' step inside the same workflow. Once this event is raised the workflow continues. This happens sometimes without error and other times it can't find a receiver.  I have looked at the event linkage through SWEINST when there is an error and while the receiver key is correct the object key holds incorrect information causing the 'receiver not entered' error.  Why is this happening?  When the workflow is triggered the event manager should set up the linkage for waiting event from the BOR key in question, why is this not happening?  What can I do?
    Any help will be appreciated,
    Kevin

    Thanks for the reply Gareth.
    My WF C has a normal step in it that calls the A workflow.
    I've tried numerous combinations, but as it is now, I have the WFINITIATOR, WFPRIORITY, ATTACHOBJECTS, and an object reference parameter being passed into workflow A.
    Basically, that task just references the WS workflow object to kick it off.
    WF A doesn't have any triggering events.  It was previously manually initiated through the SWW_WI_START function in a custom transaction.
    After the process has trickled through C->A->B and is at the wait step, I'm using another external custom transaction that initiates an event (for the wait step in WF B) using the SWE_EVENT_CREATE function.  I'll be doing some more testing here today...  but I have a feeling there's something wrong with the object key I'm passing through.
    I'm not new to WF...  but I've only really ever maintained existing workflows.  We'll say I'm still learning the complexities.  There is a pretty good chance that I'm just missing something really obvious or stupid.
    Thanks for your help so far...

  • Binding of a wait for event task

    Friends,
    I'm sorry because I wrote about terminating events, but I wanted to ask about <b>'wait for event task'</b>.
    I know that isn't obligatory to make binding of wait for event tasks.
    I've configured without binding, and it is working fine on developement system, but it can cause any problem if I don't make it ?
    Message was edited by:
            Glauco Kubrusly

    Hi Glauco,
    You should be fine as it will use the EVTObject reference to invoke the wait step.
    Regards
    Gareth

  • Query on Using fork with wait for event

    Hi All,
    I have a scenario in which a fork has two branches and one branch has the multiple steps along the line and also calls a subworkflow in one of the steps.
    The second branch has a single wait for event to complete the workflow in case of a cancel event.
    My understanding is that when the branch one executes and is on a single step decision or have gone inside a subworkflow and wating for user decision on the workitem created
    Whenever the wait event is triggered on the main workflow the second branch gets executed completing the workflow and all the branch one steps and the subworkflow gets logically deleted removing all the workitem from the inbox.
    Do I have to do any specific process control in main workflow to make sure that the subworkflow is deleted .
    Please clarify on this.
    Thanks,
    Charan.

    It should be taken care by itself. No additional steps required.
    Regards, IA

Maybe you are looking for