Unexpected Error Message from Web API Despite Successful Process Model Execution

Certified Associate Developer

Hello,

I have a Web API configured to trigger when a process model encounters a failure. The logic to detect the failure in the API's body section is as follows:

error_code: if(fv!processInfo.pv.success, fv!processInfo.pv.errorCode),
error_description: if(fv!processInfo.pv.success, fv!processInfo.pv.errorMessage, "Failure in process model")

The issue I'm facing is that the process model executes successfully — no errors occur, and I receive the expected data in the response. However, the API still returns the error message: "Failure in process model". Also, the errorCode and errorMessage passed from the process model are empty.

Could anyone help me understand why this is happening? Is there something wrong with how the condition is structured? Keep in mind it used to work prev and is working perfectly in other processes/web APIs?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    What is the value in pv!success in your process? you mentioned the pv!errorCode and pv!errorMessage are empty - that sounds correct given process had no errors.

    You need to ensure that if no errors are there the pv!success should have true() in it. If its null or empty then the if conditions will evaluate to false - hence the message "Failure in process model" always

    Also check the below line, if statement is missing one parameter here - it is a syntax error before anything else! May be its just here for the question like this yet worth highlighting this isn't right. 

    error_code: if(fv!processInfo.pv.success, fv!processInfo.pv.errorCode),
Reply
  • 0
    Certified Lead Developer

    What is the value in pv!success in your process? you mentioned the pv!errorCode and pv!errorMessage are empty - that sounds correct given process had no errors.

    You need to ensure that if no errors are there the pv!success should have true() in it. If its null or empty then the if conditions will evaluate to false - hence the message "Failure in process model" always

    Also check the below line, if statement is missing one parameter here - it is a syntax error before anything else! May be its just here for the question like this yet worth highlighting this isn't right. 

    error_code: if(fv!processInfo.pv.success, fv!processInfo.pv.errorCode),
Children
No Data