Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8065

Re: How to design and implement terminating event for custom transaction

$
0
0

>1) I have created custom Business Object with event as 'CREATED' and using this FM - SWE_EVENT_CREATE

 

Now you just create another event for your business object. You can call it for example CHANGED. Then you can create/trigger this event exactly the same way as the created event with SWE_EVENT_CREATE (actually I would replace this function with SAP_WAPI_CREATE_EVENT, but eventually they both do the same thing). You just call his logic from your transaction whenever there is a need to cancel the existing workflow instance.

 

>2) I have designed workflow template and given triggering event which is appearing in SWEC. Now I have to design and implement terminating event(whenever the original doc. gets changed/deleted the actual work item will be removed from SBWP

 

Open the workflow template with SWDD. Go to the "basic data" (it is the hat button). Go to Version dependent tab => Events. Add your event there, and choose "Cancel workflow" to the receiver type field. Now whenever your event gets triggered by the transaction, it will cancel the existing workflow instance (if there is any). You don't need to do anything in SWEC or in SWETYPV etc.

 

If you want that a new workflow instance gets started (at the same time when the old gets deleted), there are at least few ways to achieve this. You could try to set the receiver type to "Cancel and restart workflow" instead of the "Cancel workflow". Or, you can add the CHANGED event to the event linkage in SWETYPV (similarly as you have your CREATED event) => event CHANGED will cancel the existing workflow and start a new one.

 

Regards,

Karri


Viewing all articles
Browse latest Browse all 8065

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>