Skip to content

XAware Community

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
XAware 5.6
Need Help
Webinars and Events
Advanced Tutorials
Webinars and Events

You are here: Home arrow Forums
XAware Community Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Error handling in BizComp (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Error handling in BizComp
#5945
ritwik1981 (User)
XAware member
Posts: 1
User Offline Click here to see the profile of this user
Error handling in BizComp 10 Years, 1 Month ago Karma: 0  
Hi,

I am new to XAware. I am trying to convert a fixed length file (multi format) to XML.
If any of the field length in the actual file is less than that specified in the mapping ,no error is thrown by the BizComp. Instead it proceeds with the processing and embeds the error inside the corrosponding tag of the XML created.

Ex:-
<referenceCode>ERROR - Field exceeds record size 93</referenceCode>

In the above example "referenceCode" field's length does not adhere to that specified in the mapping .

Is there a way to catch this error and not generate it as part of the output XML ?

Also is there a way to catch all the errors at once, instead of one error at a time ?

Thanks in advance
Ritwik.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5952
prichards (Admin)
Admin
Posts: 319
User Offline Click here to see the profile of this user
Re:Error handling in BizComp 10 Years, 1 Month ago Karma: 18  
Currently, the Multiformat BizComponent assumes that the data is formatted correctly and attempts to process all of the records. You could apply a Functoid (to each field - or the latter fields where text may run out; the actual error message you are seeing means you have more data defined than is present in the current record, i.e. the text is shorter than the length you have defined) to check the value or check for the "ERROR" string and throw an exception - which would then trigger the XAware error handling. This could then be treated as a fatal error by default (and processing stopped), or it could be handled and processing could be continued (review the Help on error handling for further details).

Alternatively, you could code a functoid to return some other default value instead of the error message and possibly log the error in the functoid; or you could transform the result with another (XML Mapper) BizComp and log any error messages with a BizComp. You could also use an extension, or a functoid with the xa:optional instruction, to remove the error elements. There are many ways to approach this depending on your required output.


The File and Multiformat BizComponents both process a single record at a time, so as not to read the entire file at once. So currently, it does catch all of the errors at once, i.e. the final output will contain the error message in every record that is too short (it does not stop processing on the first of these type of errors), which you could then check in the BizDoc. You could pre-process the file to look for all the invalid record lengths before executing the BizComp, but that would require a custom functoid or another pass with Multiformat just to look at the field lengths.

You might also consider logging a Feature Request in our SourceForge Tracker if you have a specific idea on how this error should be trapped in the Multiformat BizComp. (It does seem a little different from the other components, in which an error typically does invoke the error handler.)
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Community Login

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
Commercial
Free Training
QuickStart Packages
Image 4 Title
Image 5 Title

Visit XAware.com