Here are several ways to handle errors in Infor M3 Enterprise Collaborator (MEC).
(Disclaimer: I have not been to a MEC training, so these are my own findings, not necessarily the official Infor recommendation.)
1. Message detail page
By default, errors in MEC are reported in MEC Management Pages > Message > Status > State; we can drill down to see the MessageDetailPage with the manifest, the input/output files of each process, and the status:
This is sufficient for MEC administrators to troubleshoot.
But only users with the app-admin or grid-admin roles have access to this, and this is unannounced, so nobody will know there was an error unless somebody looks.
If it helps, the MEC Fundamentals workbook says: “If an error occurs in an XMLTransform step, and Retry is selected, the Process starts with re-sending the input to the XMLTransform step. Meaning that the mapping is executed from the beginning.”
3. Event logs
MEC also shows detailed event logs at MEC Management Pages > Event > Log; it uses the Apache Log4J logger with levels DEBUG|INFO|WARN|ERROR|FATAL; it has a search form to search by UUID, class, text, time, etc.; the loggers are configurable via the web form or via the log.config file; and the logs are persisted in the MecLog table of the MEC database:
This shows many more details than the message detail page, most interestingly the DEBUG|TRACE levels, and the Java stack trace.
4. Error reports
This is good to automatically notify administrators in case of errors, and it is great for deputies that don’t have the administrative privileges.
But the recipients risk receiving too many emails and becoming desensitized, resulting in the opposite intention.
6. Agreement Email
This is good to delegate administration to the respective deputies of each agreement, instead of spamming the MEC administrators.
If our mapping calls an M3 API and the API responds with an error, or if our mapping throws an exception, by default the mapping will stop and will call sendMail() to bubble up to the error report.
We can change this default behavior with the ErrorHandling property:
• Exit map on M3 NOK • Exit loop on M3 NOK • Ignore M3 NOK
All this to attempt recovering from errors, and to do our own error handling.
One of the MEC Development workbook exercises has the opinion that: “all API calls should have their ErrorHandling property set to “Ignore M3 NOK”to prevent the map from failing, and use method hasNOKOcurred() to determine if any API has returned NOK.”
Note: Sometimes it is desirable to produce a specific error output. However, mappings are unable to produce an output other than the XML schema they were designed for, i.e. there is no secondary schema we can output in case of error. The workaround is to do the error handling offline, e.g. build a custom error report and send it in a custom email.
I can summarize it like this:
// default if (OK) use output schema else send error report // desired, but not possible if (OK) use output schema else use error schema // workaround if (OK) use output schema else do custom error handling
8. Error handling tab
We can use the agreement’s Error Handling tab to handle the error with one or more of these processes:
- Apply Envelope
- Create ConfirmBOD
- Outbound MBM Status
- Retrieve MBM Identifier
- XML Transform
- XSL Transform
We can analyze the corresponding Java classes to understand what they do; they seem to made for peculiar requirements.
I created my own processes as illustrated in a previous post, and it works great:
In the DocErrorHandler properties, there are some AdminException regex properties such that if an exception matches the regex, the DocErrorHandler will send the error report to both the email addresses set in the ErrorMail, and the email addresses set in the agreement. To be tested.
There are several ways to handle errors in MEC:
- Use the default message detail page, event logs, and error reports for the administrators to troubleshoot in detail, and eventually retry/re-detect
- Set the ErrorMail and agreement email to automatically notify the deputies and delegate administration
- Write custom Java code in the mappings to attempt recovering from errors and to do our own error handling
- Develop our own error handling processes to have more control
Thanks for reading. If you liked this, please consider subscribing, give a like, leave a comment, share around you, and help us write the next post.