On any task that is added to a SmartConnect map, there is a section where the returned result from the task can be defined. By default, it is set to “Go to next step” for a successful task run and “Quit” for a failure. There is a third option that can be selected though called “Cancel processing” that can also be assigned. Each of these options produce slightly different results based on where the task is being run.
First off, a task will report success if it runs through its actions without encountering an error. A scripting task uses the statement “Return True” to denote that it has been successful. On the flip side, if a task encounters an issue/error or a script executes the statement “Return False” then the task will report a failure.
The “Go to next step” option will always function in the same manner, which basically tells the map to continue what it was doing – either running the next task or document in the process.
The “Quit” option has 2 slightly different results based on what task returns that result. If the task is a pre- or post-map task, then the entire map will stop at that point and report a failure. So if this occurs in the pre-map task the map can be stopped and report an issue before any records are run through.
If a document level task returns the “Quit” result, then that particular document/record that was being processed returns an error – but the map continues running the other records instead of ending at that point. If the pre-document task returns this result, it also stops any data that would have been sent through. If it is a post-document task then the data for that record may have already been submitted successfully since the task doesn’t start until the document has been submitted.
The “Cancel processing” option functions the almost the same as the “Quit” option. The only difference is that the map will not report a failure for that option, it will just end the map or prevent a document from being sent through. That makes the “Cancel processing” option useful when trying to prevent a map or recording from running but a failure event isn’t desired. Any post-map failure tasks would not be triggered by this return result.
The two screenshots below show the difference in what SmartConnect reports when using the “Cancel processing” and “Fail” results at the document level.
The first screenshot shows the “Cancel processing” result, which just prevents one of the records from running through. The “Quit” result returns an actual error, and fires of any post-map failure tasks such as emails.
If you have any questions feel free to leave a comment below or email email@example.com!