End of Year Promotion—10 Hours of FREE Custom Template Design and Development. See Details →

The Windward Studio

Windward Blog Home

Verify and Error Handling: How to Build Robust Templates

by
Posted on 06/14/2017

Please Share This

 

Report generation can be a scary world if you’re not confident in the integrity of the data being used in your reports.  Luckily, the new Verify and Error Handling features in AutoTag and the Windward Engines allow you to make robust templates that can push past a host of issues caused by indecent data.

By adding Error Handling into your template, you can continue report generation past several types of exceptions that normally would have stopped your report dead in its tracks.  Additionally, the new Error Handling “Node must exist” and “Node must not return null” settings will allow you to identify the cause of problem tags that return empty values in your final report.

“…Robustness refers to the ability of a program to handle errors and less than ideal input…”

So what do I mean when I say a “robust” template?  In the world of computer science, robustness refers to the ability of a program to handle errors, and less than ideal input, at runtime without breaking.  In the world of templates generated using AutoTag, robustness refers to your templates ability to handle exceptions and less than ideal data source results while producing your report, without stopping report generation!  What could make that even better?  How about delivering you a comprehensive list of the issues encountered during run time!

Now, what’s the difference between Verify and Error Handling?  Verify and Error Handling each have specific issues they look for in your template.  Verify, you can run on any template you have laying around and it will give you a list of issues that may be affecting the quality of your report.  This includes elements being generated off the visible page during report generation, data sources connected to your template that are not being used, tags selecting from data sources that are not connected to the template at all, and tags that may not be visible in the template but will output in the final report.

While Verify checks for issues across your whole template, Error Handling handles issues in individual tags. Six Error Handling options can be set for individual tags in AutoTag to tailor the issues the tag can handle at report generation.

The first three (“Ignore type error”, “Ignore formatting error”, and “Ignore select error”) all catch specific exceptions that may be thrown during report generation. Instead of stopping report generation, when Error Handling is turned on and set on problem tags, the exception is logged for the user, and the report continues to generate with an empty value returned by the problem tag.

The fourth and fifth Error Handling options are “Node must exist” and “Node must not return NULL”. When these two settings are enabled, Error Handling will log an issue if the respective tag either selects a node that does not exist (common in XML and JSON data sources) or if the select returns a null or empty value. While neither of these issues would have previously stopped report generation, the report would have been delivered with empty values and no explanation. Now you can identify exactly what tag is producing null or nonexistent results.

The last Error Handling option is “Treat warning as error”.  While all Error Handling is reported in the Issue Stream as a “warning” by default, enabling this option will report the issue as an “error”.  What this does is allows you to identify tags crucial to the final document, report issues found in said tag as an “error”, and then identify the issue in the Issue Stream as a higher priority than other issues. This enables you to automate your application to catch reports missing essential data and choose whether to deliver them or not.

“Now you can identify exactly what tag is producing null or nonexistent results.”

Now that you have an overview of Verify and Error Handling, why should you incorporate these features into your templates?  Not only does Error Handling allow you to produce reports that would normally stop generating due to an exception, Verify and Error Handling open a new world of troubleshooting for your templates.  Since Verify and Error Handling continues to generate the entire report after encountering issues, you get a comprehensive list of issues with warning level (warning or error), the nickname of the tag producing the error, the type of issue being caught, and more.  Running Verify on your templates will also alert you of possible inefficiencies in your template, or imperfections you may have missed otherwise. In this way, Verify and Error Handling are the first step to producing robust templates, and identifying problems in your reports.

If you would like to learn how to implement these features in your templates or learn more about how Verify and Error Handling work, please visit our Wiki article here.

 

Please Share This



Author: Adam Austin

Other posts by