WF Document Status Change - Locking - Methods

Question:

The customer have a requirement where I need to change the status of a trip when an custom event occurred within workflow. For this, I am are using an activity which will call custom method created for trip status change. The custom method just changes the status of the trip if the trip/employee is not locked by someone else.

Now, the problem is with the status change when the trip/employee is locked by someone. Current workflow logic is handling this situation.

I can think following solutions to handle above situation:

1. Code changes in custom method to check whether the trip/emp is locked or not. If locked, wait for some time and try. This can be repeated for some time say 5 mins.

2. Workflow design can be changed using another activity which will check the lock status of the trip/emp and using a loop, which will be executed every 10 secs till next 5 mins.

Which solution is better and why? 

Answer:

Create a method to make the change and have it check if the object is locked. If so, it should throw an exception that is marked as a "temporary error". Workflow will then re-attempt three times at 20-minute intervals; if it's still throwing that exception then it becomes a real error.

You can adjust the 3x and the 20 minutes.

You can set this interval and number of retries globally in transaction SWWD.

This setting can be overridden for each background step in workflow definition - in SWDD open task details and go to Miscellaneous tab page.

Notes:

The 3X attempt in 20 min interval is performed thru the background job SWWERRE for all the workflow items globally.

This can be overwritten by the Miscellaneous tab for individual items in the SWDD tcode.

Get help for your SAP WF problems 
Do you have a SAP WorkFlow Question?

SAP Books
SAP WorkFlow Certification, Interview Questions and Configuration Reference Books

SAP WorkFlow Tips
SAP Business WorkFlow Tips and WF Discussion Forum

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.