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
SAP Books
SAP WorkFlow Tips
Best regards,
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|