Hi,
We have a use case where we want to prevent the task from getting approved when the validations fail.
Example.
The user submits a PO for approval.
Approver logins and review the PO. The PO looks good to release and hence he approves it.
However, upon approval, a stored procedure is executed. This procedure is called from the action (Event- Completed, Outcome- Approve). The procedure checks if there is an excess purchase happening by comparing it with the material plan or BOM. If it is an excess purchase, the user should be prevented from approving it.
The procedure has an out parameter that returns 1 or -1. In the case of -1, the execution must stop. If we raise an error when it is -1 and If we turn on "Stop Execution on Error", the task is getting completed in an ERRORRED state. It is a closed state and irrecoverable. This put a sudden stop to the workflow.
Could you pls advise a mechanism to overcome this?
Thanks and regards,
Arun