Standard Error Processing within Workflow
I am working on my first custom workflow so I am reletively inexperienced. Within one of the steps in my workflow, a method is called which executes the transaction FB02 to change vendor info. I would like to do some type of error processing logic in case it returns from the transaction with an error. (The actual transaction screen processing is hidden to the user.)
What is the standard for error processing within a workflow method? I was thinking about changing the status of the workflow to Error using SWW_WI_STATUS_CHANGE_NEW and then possibly creating an attachment describing the error. Suggestions for a better method?
If this is the best method, can someone give me directions on using SWW_WI_STATUS_CHANGE_NEW? There is no documentation for it in English. Is the id passed the workflow header id or the task id?
Mike Pokraka replied
Temporary errors are typically used for things such as a document that is currently locked by somebody else. the number of retries can be configured as part of the error monitoring job configuration - I don't have a system in front of me right now, but it is In the workflow menu under administration.
I don't usually have outcomes for temporary errors because I do not expect them to fail. The default of three times at twenty minute intervals is pretty reasonable , and I have very rarely had occasion to change it. On the very odd occasion where somebody does lock the document for over an hour, it is usually a simple matter for a workflow admin to just restart the workflow.
Most other types of errors should be set up as application errors, this will 'fail' straight away, giving you the opportunity to proceed down different branches of the workflow based on various conditions you can set in your code.
Hope that helps,