Trigerring and Terminating Events in Task

Hi Friends,
Acutallly i need to know whats the use of triggering and terminating events in Tasks and in what kind of scenerios they are required..
THanks

Hi Munish,
Please check this thread
Triggering Events and Terminating Event
Please check this thread exclusively for Terminating events. Lots of information in this thread..
Regarding terminating events in workflows
Hope this would help you.
Good luck
Narin

Similar Messages

  • Fork : triggering and terminating event ?

    Hi Experts,
    I am a begginer in  Workflow ..
    I just want to know how Fork can be used for paralled processing with triggering and  terminating event.
    It would be appreciated if provided with some scenarion in detailed steps.
    Thanks in advance.
    Ganesh..

    Mike,
    It would be HELPFUL for me if i get my problem solved as earlier so i can concentrate on other my commited topics..thats why expecting info., from the experts.
    Anyway , you  triggered me to read SAP help..thanks for the indirect motivation..
    Let me start reading the SAP help information!!!
    Thanks .
    Ganesh

  • Worktiem and Terminating Event with Condition

    System : SAP Solution Manager 4.0
    Business Object : BUS2000116
    Custom Screen
    No.     Text               Position          Status     
    1.     IT manger                           Position1          
    2.     IT Integration manger                     Position2
    3.     Development manager     
    4.     Business process Owner     Position4
    5.     SQA               
    6.     Change management                     Position6
    7.     Basis and Operation     
    8.     -
    9.     -
    While creating CR(Transaction code CRMD_ORDER) user has option to choose any number of approvals from the above mentiond custom screen. Lets say user chooses four approvals.
    Requirement
    Now in workflow I have to send Workitem for Approval in Parallel to all four positions(Position1,Position2,Position4,Position7). When any one from respective positions Approves the workitem , workitem should remove from the inbox of all other users belongs to that position.[Note from other users belong to other positions]
    So at the end workitem should have approval at all 4 levels from the each respective position.
    Can I achieve the above mentioned scenario?
    Background step : to find out number of approvals for CR. [in this example 4.]
    In WF design
         Step "Loop Until" number of approvals
              Find Agent for Approval Number 1
              Send Workitem to Position Belond to item number 1
         Loop End
    But How Can I use terminating Event "APPROVED" ?
    Please suggest.

    Amandeep  Singh wrote:>
    > System : SAP Solution Manager 4.0
    > Business Object : BUS2000116

    > Now in workflow I have to send Workitem for Approval in Parallel to all four positions(Position1,Position2,Position4,Position7). When any one from respective positions Approves the workitem , workitem should remove from the inbox of all other users belongs to that position. (Not from other users belong to other positions)
    > So at the end workitem should have approval at all 4 levels from the each respective position.
    >
    > Can I achieve the above mentioned scenario?
    Yes.
    > Please suggest.
    Try reading some starter material and learn about the concept of work items and agents. That should let you understand why the answer is yes, and how to achieve it. The tutorials on workflow scenarios (help.sap.com or online help in your system) are perhaps a suitable start?

  • Firefox doesn't load webpages at random times, after closing and terminating it in task manager it works again

    I just did a fresh install on my computer, and whenever I open firefox and leave it there for a while it would stop loading any web pages. When I close it and reopen FF it tells me that FF is still running and I have to use task manager to end process to reopen FF and it'd for for a while and repeat itself.
    Thanks for any help in advance.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!

  • Terminating event and abap oo class

    Hi, gurus,
    I 'd like to know how the terminating event works.
    for example,  i define a custom abap oo class (which has been implemented the interface of IF_WORKFLOW), and i want to use it as the terminating event of a standard task.
    could you please tell me how does it works?
    1. there must be an instance defined in the container of the task?
       which must be instanciated in the run time?
    2. then in another abap report, i simply raise the event defined as the terminating event, using the same key, then the pending task will be terminated?
    could you pls provide more information on this ?
    thanks and best regards.
    Jun

    Hi Jun Zhang,
    An event that is used to stop a workflow or task, or change the behavior of an already started workflow is called Terminating Event.
    If the event linkage is active and the linkage rules are satisfied, the status of the work item is set to COMPLETED.
    Defining Event Linkage  Terminating event linkage consists of 2 parts.
    Type linkage which specifies business object type, event name, generic name for event receiver (WORKITEM for terminating events of tasks or EVENTITEM for wait for event steps)
    Instance linkage which identifies the particular receivers (I.e. work item Ids) per object instance.
    Terminating event linkages can be seen in SWE3.
    For terminating events, along with Business object and Event a Container Element should be specified that holds the Object Instance.
    Terminating Event for Workflow is available from Release 6.10 only. This is defined in Basic Data of Workflow Builder.
    Binding Definition is optional for Terminating Events. Binding can be defined b/n event container and workflow container to pass event information to the workflow if required. That is the only way of passing information from an asynchronous method to the task that started it.
    Thanks and Regards,
    Prabhakar Dharmala

  • Copy of task TS50000075 and  EXTSRV - termination event not working

    Hi,
    We have done copy of TS50000075 and extended business object EXTSRV to ZEXTSRV
    this was done to call function module ISR_CALL_FOR_CHANGE to open up adobe form in edit mode
    it works well but the task is not terminated
    if termination event is put just like TS50000075 like WIOBJECT, ZEXTSRV COMPLETED then workitem never ends and always stays in inbox
    ZEXTSRV COMPLETED event is not triggered when the workitem is completed in the UWL
    even if we trigger this event programatically , it does not find receiver and the task stays in-process
    if termination event is put as _WORKITEM PROCESSED then it bahves like synchronous task ie even if the workitem is clicked and form is not completed, the workitem ends. so the user can click it only once
    also i've tried following
    1 - used the function module to complete the workitem in QISR BADI. but the workitem ID is not available inthe BADI. If I try to export it from business object method and import in BADI, it doesnt work
    2 - find active workflows and derive workitem id and complete workitem using FM SAP_WAPI_WORKITEM_COMPLETE
         this FM doesnt work , step becomes logically deleted which is not desirable
    3 - find active workflows and derive workitem id and complete workitem using other FM SAP_WAPI_SET_WORKITEM_COMPLETD
         work item is complete but there is workflow error - cannot determine succesor node
    4 - find active workflows and derive workitem id and change a particular container element
        check this container element in complete workitem condition in activity step of dialog step of workflow of this task-
         workitem stays inprocess
        check this container element in parellel wait step to complete the workitem-
         parellel step executes but fork is not complete, workflow doesnt proceed
    kindly help in this matter. the workitem does not get completed at all even if we force complete, workflow goes in error of - cannot determine succesor node.
    is there anything specific to the EXTSRV-PROCESS method which makes the TS50000075 task to trigger EXTSRV-COMPLETED and end the workitem ?
    help is much needed in this case
    thank you,
    b

    Hi,
    You need to see the event in SWEL, otherwise it will never work with workflow. Make sure that the event monitor is on (in transaction SWELS).
    I cant see the event in SWEL. The vent monitor is on because if I create event in SWUE, it shows up.
    How you actually create the event now?
    There is BADI QISR which is always called to handle user action of PDF form. I have written the function modue to create event in the user action
    >If i trigger it using funciton module -- then it doesnt find any receivere so it doesnt terminate the task. it is seen in SWEL with no receiver found. do i still need to do commit work ?
    You need the COMMIT WORK always if you trigger the event in any program&function or whatever.
    ok ill try doing commit work after the create event function module
    Test your event with transaction SWUE. Make a test case first in a way that the task is waiting in the inbox/UWL. Then create the event in SWUE. Now, if the task gets completed, you will know that that event itself is working and your terminating event configuration is done properly. If this works, your only problem is in the event creation itself. And for that you need to tell exactly how you create the event. If you do it with your own custom code, use SAP_WAPI_CREATE_EVENT and don't forget to have COMMIT WORK after the function call.
    I am doing exactly like you said. but it doesnt work ie even if I create the event in SWUE, the workitem doesnt get completed.
    This event is seen in SWEL with no receivere found
    I am able to infact set the workitem to complete using WAPI funciton module to complete teh task in the BADI.
    but the workflow goes in to error saying , next node cannot be determined
    Regards,
    Karri

  • Warning: "No terminating events defined for the task used"

    Dear all,
    I created a task with ABAP class and method as its object method. This task is a background task. The ABAP class inherits the IF_WORKFLOW interface but doesn't implement any method of the interface.
    When I try to confirm the task settings in transaction SWDD, a message shows up "No terminating events defined for the task used" and I cannot continue the work. Does anybody have any idea what I should do?
    Thanks + Best Regards
    Jerome

    Hi Jerome,
    If you set a background task in your workflow, and if it is asynchronous, then you need some way to tell the template if it is finished and what happened.  In this case you set terminating events - that is events which are published in the system as a result of your method (ie document.posted etc).
    Either use a synchronous method for your task or set appropriate terminating events in your task setup.
    Regards
    Gareth

  • Task 20000051 : Terminating Event INPUTFINISHED

    Hi,
    I am using standard task 20000051 which has business object type IDOCAPPL with a terminating event INPUTFINISHED. Question is: even after the IDOC is processed successfully and set the IDOC staus to 53, workflow is still "In Process" status. What needs to do be done to set the WF automatically status to complete? Currently I set the status to "logically delete" which is a painful action every time.
    Thanks in advance for your help.
    Best, Nagarajan

    Actually don't know. This is the standard task and being using as it is. Where do I see that the method is used to set the IDOC status.
    Also I found that terminating event is getting triggered, I see the terminating event in the log. The only issue is WF is "In Process" status. What to do to set the status to complete automatically.
    Here is what happened:
    (1) IDOC went into error which triggered WF
    (2) IDOC content was changed
    (3) IDOC was re-processed successfully with IDOC status 53
    (3)Terminating event was triggered
    WF status still "in process". What to do?
    Thanks
    Nagarajan

  • How to raise a Terminating Event for a Standard Task?

    Hi Experts,
    I have a standard task where I have defined the Terminating event to stop the workflow.
    This Task/Workflow will be triggered by a batch program.
    Also in a class method I am using function module SWE_EVENT_CREATE to raise a event which should complete the workflow.  But somehow the work items are still in In Process status.
    May be I am passing wrong parameters OR using wrong FM to raise a terminating event.
    Request you to help me on this.  Thanks in Advance.
    Regards,
    Sudhakar.

    Hi Sudhakar,
    Since there are entries in SWE3 which show link each time event is triggered. So I would suggest you will have to check the standard task you are using is working. So create a parallel branch with activity on one end and wait for event step on other. See if the the wait for event step works, when you create the event using create event. If it works then most likely your task binding has a problem. If not then event that is triggered does not getting picked by workflow. So based on the finding we can find a solution.
    I notice that you are calling the event from an ABAP class, so in that case the code for calling event seems to be different. Check out the below SAP help documentation.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a1/172437130e0d09e10000009b38f839/frameset.htm
    Regards,
    Kartik N.
    Edited by: KARTIK Nayak on Dec 12, 2008 8:25 PM

  • Terminating event of a task is not working

    Hi,
    I implemented WS20000075 for purchase order release.
    The dialog workitem of approval has terminating event 'released'
    all thru the developement in dev and Q system., this was working
    but in production , it happened that other user release PO from me29n
    the approval workitem is still in process
    i cant check events because trace is off
    cud please suggest wat cud be the reason that inspite of release of PO, the workitem did not complete ?
    thanks
    r

    Two questions first:
    #1) In Dev and Q, did you test (or experience) the scenario you are facing in Prod, that being someone else is Releasing the PO?
    #2) In Prod, when the Approver performs the release step, does the WF advance?
    I'm going to presume that the answer to #1 is NO, and the answer to #2 is YES.  If that is the case, here's what I believe to be the dilemma you face.
    A "Terminating Event" is not the same as a "Wait for Event".  The purpose of a Terminating Event is to essentially call back to an activity that is "In Progress" that the work is done and that its time for the activity to end and to move on.
    Your PO Release for example; The user clicks the Release icon and then clicks Save.  At that point, processing is handed off to the Update Process (Asynchronous) and the screen is exited.  Even though you've left the screen, there's no telling if or when the Update Process for the save has even started or when it has been completed.  But it's only when the Update Process has completed that the true Logical Unit of Work (LUW) has completed, and hence when it's appropriate to move on to the next step in the WF.
    The way this gets accomplished is to trigger a Terminating Event at the very end of the Update Process, which in turn gets picked up by the PO Release activity that is still sitting and waiting with status "Executing".  And that's the key.
    I'm almost 100% certain that the Activity has to be in the state of "Executing" before it will react to a Terminating Event.  In your scenario, where the Release gets performed outside of the WF, the Release Activity is still in "Ready" status.
    I think the solution here is to put a "Wait for Released" in parallel with the Release Activity as a means of capturing the Release that occurs outside of the WF.
    Hope this is relevant....Apologies if not.
    Tom Carruth

  • Terminating Event Not Triggering

    HI Guys,
                   I have added a custom task to call MRBR screen and set a Terminating Event for this task. It is a Asynch Method.
    Through SAP_WAPI_CREATE_EVENT i am calling the terminating event but my task is not getting terminated.
    I checked in SWEL i could see evnt log for my terminating event without Receiver type.
    Kindly help me to sort out this issue.
    Regards,
    Dheepak

    Hi
    Where have you written the code for triggering the termination event?
    Also in your task have you created an entry:
    WIOBJECT_ID   FIPP  TerminatingEvent Name.
    When everything is done properly in SWEL you would see the receiver as workitem.
    Thanks and Regards
    Aman

  • Terminating event 'Created' in ABAP OO context

    Hi,
    I need a little help here. A lot of times I have used terminating event ‘Created’ for different BOR types – and asynchronous tasks where users are asked to create an object using call transaction from a work item.
    Now I am struggling with the same in ABAP OO and have an issue:
    The goal is to have a terminating event raised on a custom class  - and received by a work item if a customer is fully created, that is the general part, the company code part and the sales area part.
    Raising the event is working great. I have put in a class in trx. SWEC together with a function module which set the class as object type if the condition is fulfilled.
    Then in trx. SWED I have entered another function module to set the key for class together with object_por-catid = ‘CL’.
    Then when a customer master record is created I can see in the event trace that the event is raised with the correct key.
    No I want to receive the new object into my asynchronous dialog task. I define the event as terminating event – and in the code call transaction XD01.
    When the work item is created I find a waiting event linkage in trx. SWE3 – of cause without key; this is unknown until after creating.
    But after executing the workitem and raising the event the workitem does not receive the event and is therefore not completed.
    Is this approach not possible in ABAP OO – or do I miss something in the class definition / coding?
    The event is defined as public instance – I have not coded any event handler method.
    Thanks,
    Claus.

    Hello Claus,
    Interesting question, unfortunately not with a simple answer.
    The issue is that you are waiting for an instance event without a key. Your object raises an event with a key => No match.
    If you raise the created event without a key, you won't be able to match up two near-simultaneous creations with their corresponding work items. Same thing if you wait for a static event.
    So how does SAP do it with BOR events? By breaking the rules of course!
    They do some hidden trickery to bypass this problem by doing an 'Export to Memory' of the work item ID, and the CREATED event raising code bypasses the usual event linking mechanisms and looks for it's creator by retrieving the memory variable. I don't have the exact spots of code in my head, but a bit of debugging should find it.
    So what can you do? Given that you have full control of the class you could do something similar and maybe also create some kind of temporary key consisting of the Work Item ID and raise an event with that, or you could maybe skip the transaction concept completely and run the create GUI entirely within your WF step - maybe a custom screen gathering the initial data and then create the object via BAPI. Time to get creative!
    Hope that helps,
    Mike
    Edit: Or you could do the quick and dirty solution and just use the BOR events for the step and instantiate the class during the binding back to WF...

  • ECC6.0 WebDynpro(ABAP) - raising terminating event

    Hi, in ECC6.0 I have a custom WDA application with a custom workflow.  The workflow is launched via an event that is raised in the WDA application.  However, at one point workflow sends a link to one of the WDA pages, whereby the user clicks a button which raises what should be a terminating event for the workflow task.  However, while this event is raised, as confirmed in SWEL, it doesn't terminate the task.  The event is raised through a WDA assistance class.  The object type, event and object key are all being set properly during the raising of the event.  Viewing the event in SWEL confirms the proper setting of the key fields.  So why isn't the step terminating?
    Thanks in advance,
    Kevin

    Hi,
    If the object that is waiting for event has no instance, the task will not be terminated when the event is created in the system (As I said). So now the reason is clear for you.
    >The event is raised through a WDA assistance class
    I am not sure what you mean by this. You raise the event from the WDA assistance class? Or you raise an event for the assistance class? (Or perhaps both?).
    If you raise the event for the assistance class, you should have an instance of that class in the workflow container (which you would then bind from workflow container to the task container). So, now the question is: do you have an instance of the assistance class in the WF container (when you look it from log)? Or is it initial also?
    Actually I don't really even understand how you have managed to combine the WDA assistance class and WF class? How do you actually start the workflow (with which kind of event)? Whatever event it is, it should most likely instantiate some class/object in the workflow. Then in your problematic task you should most likely use this same class in the terminating event (unless there is something really fancy in your workflow).
    Regards,
    Karri

  • Read workitem Container Value in Terminating event Check Function Module

    Hi
    I have some problems reading work item data / values of a work item container element in a check function module on a terminating event – Do any of you know if this is possible, and if so, how it’s done ?
    In My scenario I have created a multiline approval step for my business document, one task pr Line Owner.  The Event Approved is defined as a terminating event for this task, and the line owner is passed to the task container.
    Now, when I raise the event, with the line owner as an event parameter, I would like to check if the line owner on the raised event, matches the line owner in the task container in question in a check fm. But here I faced the problem, that only event data, and not work item data, are passed to the Check Function module.
    Regards,
    Morten Nielsen

    Hello Morten, hello Arghadip,
    in the instance linkage's check function module (entered via transaction SWEINST) you'll have the workitem-id in the system event parameter EVTRECEIVER_ID
    With this number you can use the frame work in order to read the work item container.
    This is a sample coding, how you access the correct work item container using SAP Enterprise and it's new OO frame work, which checks on the terminating event of BUS2105.Released the correct release code for a work item.
    INCLUDE <cntn01>.
    INCLUDE <SWFCNTN01>.
    INCLUDE RSWEINCL.
    *** Read workitem instance and container from event
           DATA: wi_id            TYPE swwwihead-wi_id.
           swc_get_element EVENT_CONTAINER evt_receiver_id wi_id.
           IF sy-subrc <> 0.
              MESSAGE E015(ZPREL) WITH evt_receiver_id
                                           RAISING wrong_call.
           ENDIF.
           DATA: lv_wi_handle    TYPE REF TO if_swf_run_wim_internal.
           DATA: ls_context      TYPE sww_wimctx.
           DATA: lv_wi_container TYPE REF TO if_swf_cnt_container.
    *    - set context
           ls_context-do_commit  = ' '.
           ls_context-called_btc = 'X'.
           ls_context-exec_user  = sy-uname.
           ls_context-fbname     = 'Z_CHECK_RELEASE_CODE'.
           CLEAR lv_wi_handle.
           CALL METHOD cl_swf_run_wim_factory=>initialize( ).
           CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
                   EXPORTING
                      im_wiid             = wi_id
                      im_read_for_update  = ' '
    *                 im_enqueue_owner    = fb_name
    *                 im_wait_for_enqueue = 'X'
                      im_context          = ls_context
                   RECEIVING
                      re_instance         = lv_wi_handle.
    *** This check is only done for workitem linkage TS90100081
           IF lv_wi_handle->m_sww_wihead-wi_rh_task <> 'TS90100081'. "#EC_SYNTEXT
              EXIT. "Let event pass, as this is an instance linkage to another workitem
           ENDIF.
           DATA: releaseCode_wi        TYPE t16fc-frgco.
    *    - read releaseCode from workitem container
           lv_wi_container = lv_wi_handle->get_wi_container( ).
    *    - perform binding event container -> workitem container
           swf_get_element lv_wi_container 'RELEASECODE' releaseCode_wi.
          DATA: e             TYPE REF TO cx_swf_run_wim.
          CATCH cx_swf_run_wim INTO e.
             RAISE WORKFLOW_RUNTIME_ERROR.
       ENDTRY.
    *** From here on, the variable releaseCode_WI hold the
    *** container element RelaseCode of the work item, that
    *** is going to be terminated...
    *** Further coding from here as appropriate...
    Best regards,
    Florin

  • Terminating event -- No active receiver found

    Hi -- on an Integration project I just need a workitem that stays active until explicitly closed via an event..
    It's easy enough to create a triggering event which starts a process.
    I've followed all the rules (as far as I can see) to create a terminating event but it doesn't work.
    I've created a test Bus Obj ZZJIMBO which simply has a key of the SAP user ID.
    I've defined 3 events
    STARTSYN  ====> Synchronous
    STARTASY  =====> Asynchronous
    FINISHED ======>  terminating
    Using SAP_WAPI_CREATE_EVENT the STARTSYN and STARTASY  are triggered and the relevant processes start - both for the synchronous and asynchronous tasks.
    However on raising the FINISHED event the system just errors with NO Active receiver found.
    All the binding etc is fine and SWU0 doesn't find any problems.
    Looking at the instance table (transaction SWE3)
    I see that the eventid is the same as the current workitem but the object key is empty
    object key  <empty> 
    eventid    000000250100
    The only possibility I can see is that my Business object doesn't really have "instances" like say a sales order as it only exists at run time.
    Would I have to say trigger the event finished using something like the Work item itself which does have a valid individual instance -- I can extend the WORKITEM bus obj and add an event FINISHED to it instead.
    I can get the workitem id via the container so that shouldn't in theory be a problem to "instantiate"  the Workitem (or ZWORKITEM) business object.
    I really hoped to have all the events in the SAME business object however.
    Any ideas
    Cheers
    jimbo

    Hi James.
    1. Yes, I think the workitem in runtime would expect the triggering event should be from the instance of the object either from
            a. standard workitem relevant obejct instances like _WORKITEM, ATTACHOBJECTS, RULERESULT
           b. or the associated BO in the task i.e WIOBJECT_ID
    2. However as you say >>I really hoped to have all the events in the SAME business object however>>. I can suggest the following
           a. create a parallel fork to the step which is creating your workitem
           b. In this parallel branch create step 'Wait for Event; and refer it to your ZZJIMBO.FINISHED.
          c. define necessary branches required to complete the fork as 1. meaning, if any one of the branch ends flow will continue to next step in main workflow.
    So, when the event ZZJIMBO.FINISHED is raised with the correct instance which was used in workflow. 'Wait for event' will receive it and this branch will end and eventually other branch will get logically deleted. You can put some flag in the 'Wait for event' branch using which u can understand whether the workitem is completed in normal way or through exeption.
    Hope this helps !!
    Regards
    Krishna Mohan

Maybe you are looking for