I have a simulation that involves getting a link from an email then doing a bunch of stuff with it. Sometimes an email never gets sent. When that happens none of the steps after that are useful. Here’s my (failed) attempt to address:
.exitBlockOnFail(
exec()
.exec(ApiSignatureRequest.sendRequest)
.exec(_.set(“signerLink”, “”))
.exec(SignDocument.getSignerLink) // this is the method that looks for the email and sets signerLink
.exec( doIfEqualsOrElse(session => session(“signerLink”).as[String], “”) { exec(session => {
Failure(“Unable to get signer link”) session }) } { System.out.println(“Link Found ${signerLink}”) }
)
.exec(SignDocument.visitSignerPage)
…more things…
)
The “Unable to get signer link” message appears on the logs but all of the things following it are still executed. Any suggestions?
That did exactly what I wanted it to do, thank you. One follow up question…
The resulting report shows no failures or ko, is there a way to indicate that all is not as it should be on the reporting side?
Thanks for the reply. It’s not an http call, I’ll see if I can’t wrestle in a check there somehow anyway. Excellent tip on not having to initialize that session var.