ABAP-OO .Created-Event as terminating event

Florin Wach florin.wach at gmx.net
Fri Jan 8 04:35:19 EST 2010


Hello Mike,

thanks for following up on this issue. And it's not solved yet.

I'm currently using a simple CALL TRANSACTION in the class method .Create and a GET PARAMETER ID ... statement right after that. As we know, this has some restrictions, like that the object may not exists on the database yet, or that the posting could be cancelled by the runtime system.


I have used this opportunity to dig a little deeper and this is what I've found:

- Some transaction call function module WF_COMMIT that generates the event IMAGE.Assigned including the linked objects as container elements, when the REQUESTER is of type IMAGE
- Some transaction have the built-in functionality to raise the event .Created and they use function module SWE_EVENT_CREATE_FOR_UPD_TASK (or similar). This function module pushes the REQUESTER into the memory of the event creation
- Yes Mike, the class CL_SWF_EVENT_UTILITIES->get_standard_container(), that creates the standard event container for the check/receiver function modules does retrieve again the requester from memory and puts it into element _REQUESTER

This way, whatever will be the last line of the memory built-in requester will be found later in the event container of the .Created / .Changed event, if the transaction has it built-in. (look at function SWO_QUERY_REQUESTER)

However, this doesn't yet explain fully, why a work item using the method BKPF.Create having the terminating event .Created gets correctly completed (even when there're several other work items waiting for a .Created event).

- The function module SWW_WI_COMP_EVENT_RECEIVE_IBF had to retrieve the correct workitem ID from the transaction manager, in order to match (that's what I guess) using cl_swf_run_event_receive_srv=>get_instance_via_wiid
Maybe the function WF_COMMIT and the table WFIUT sheds a light on it.

What still can be done is a workaround that uses a terminating event on an instance-ID, which is
- Unique
- Known to the workflow before work item creation
=> This could be the Flow-item ID

1. Create a class or a business object with a terminating event here.
2. Pass that instance to the work item
3. Use that event as terminating event for the workitem
4. Within the method call, add a new REQUESTER to the transaction control before making the call transaction
5. Create a global type linkage for the .Created event, where the element _REQUESTER is picked up and raise the appropriate event for that requester, making the workitem to stop. Transfer any appropriate values (e.g. the key of the just-created object) as event parameters.

Next time, I might solve it that way, this time I've used the shortcut :-)


Best wishes,
Florin







-------- Original-Nachricht --------
> Datum: Thu, 7 Jan 2010 09:45:59 -0000
> Von: "Mike Pokraka" <wug at workflowconnections.com>
> An: "\'SAP Workflow Users\' Group\'" <sap-wug at mit.edu>
> Betreff: RE: ABAP-OO .Created-Event as terminating event

> Hi Florin, 
> 
> Not sure if you're still struggling with this one, but try populating a
> container element "_REQUESTER" with the calling work item ID. This is what
> standard BOR items do even though the element is not defined as an event
> parameter. 
> 
> Cheers, 
> Mike
> 
> 
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of
> Florin Wach
> Sent: 16 December 2009 09:13
> To: sap-wug at mit.edu
> Subject: ABAP-OO .Created-Event as terminating event
> 
> Hi there,
> 
> in the old ways, you could use the static CREATE method of a business
> object
> to be terminated by the instance event .Created of the business object,
> transferring this into the _WI_OBJECT_ID of the work item.
> This worked through the internal QUERY_REQUESTER-Option.
> 
> With ABAP-OO, I have created a new class method CREATE, an instance event
> .CREATED and called within the create method the transaction (in this
> example: MIRO)
> 
> There's a general event linkage established, that raises the .CREATED
> event
> of the ABAP-OO-Object, once the BUS-event was created. At this point, the
> connection between the work item and the .Creeated event seems to be lost.
> 
> Question:
> 
> 1. Did anyone used the CREATE method analog to the Business Object within
> the context of ABAP OO ... SUCCESFULLY
> 
> 2. And if yes, HOW ?
> 
> Meanwhile I'll work on a workaround using a BADI to terminate the work
> item
> directly, but that's not the solution that should be there at the end.
> 
> 
> 
> Best wishes,
> Florin
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>  
> 
> __________ Information from ESET Smart Security, version of virus
> signature
> database 4749 (20100106) __________
> 
> The message was checked by ESET Smart Security.
> 
> http://www.eset.com
>  
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug



More information about the SAP-WUG mailing list