Process Model Error reporting via API

We have an  POST API on Appian that is being called to perform user related task ( add, remove, update, activate, deactivate) based on the data sent to the API. The API works fine as its a Cast and the API response of the Cast is being being sent back to the API initiator. However when there is an error the response is sent as an email alert how can the error be sent as an api response. For eg 

There is a problem with task “Deactivate User” in the process “PPL_IG Deactivate User Profile”

Problem:  An error occurred in executing an Activity Class.

Details:  The user [test.abc] you are trying to deactivate is invalid or does not exist.

Recommended Action:  Examine the activity class to correct the error and then resume.

How do i capture the "Details:  The user [test.abc] you are trying to deactivate is invalid or does not exist." from the error message received via email? 

  Discussion posts and replies are publicly visible

Parents Reply
  • The alert you are getting is from the Appian Smart Service in Process - so the process model has generated the alert and presumably the process model instance has now stopped. Presumably the PV's are not filled due to this alert. By validating the userid in the WebAPI you can send the invalid response back to the consumer before calling the process model to deactivate / update users based on the validation you've done in the webAPI. I'll try to knock up some sample code that might help

Children
No Data