Results 1 to 2 of 2

Thread: Code to help make sense of E1 errors when called via a BSSV

  1. #1
    Senior Member johndanter's Avatar
    Join Date
    Sep 2003
    Cork, Ireland

    Code to help make sense of E1 errors when called via a BSSV

    Hi folks,

    I'd like to share some free java code with you guys as some have been very helpful here. I got together with my resident java geek and we came up with this.

    If like me you've noticed that calling E1 BSFNs isn't the best when you get an error, I can help you
    E1's engine by default is designed to throw an exception when your manager encounters an error back from the BSFN it called. It also handles E1 error/warning messages via E1 Message List in the java wizard, but these messages are just the glossary text of the error.
    You do not get the Object, Line Id or Error Code in E1 Message List......until now

    In the snippet of java below, I've commented out the If messages contains errors, throw the exception and replaced it with my own new 'If messages has errors' java object called RRDMSG
    RRDMSG goes off to some bssvfoundation objects and helps flesh out the error message and appends the DTAI, Line ID, and OBJ plus error DESC into the message.
    This makes fault finding so much easier now, as you can see the EXACT line of code that got upset

    //PublishedBusinessService will send either warnings in the Confirm Value Object or throw a BusinessServiceException.
    //If messages contains errors, throw the exception

    // John Danter BSSV Error E1 Message List mods 24/07/2017
    RRDMSG.handleErrorMessages(messages, context);
    if (messages.hasErrors()) {
    //Get the string representation of all the messages.
    String error = messages.getMessagesAsString();
    //Throw new BusinessServiceException
    throw new BusinessServiceException(error, context);
    //Exception was not thrown, so create the confirm VO from internal VO
    ConfirmGetDOC01InvTransManagerVO confirmVO = new ConfirmGetDOC01InvTransManagerVO();
    finishPublishedMethod(context, "GetDOC01InvTrans");
    //return outVO, filled with return values and messages

    Code for RRDMSG inside RRDUTIL
    ================================================== ===============
    package oracle.e1.bssv.RRDUTIL;

    import oracle.e1.bssvfoundation.base.IContext;
    import oracle.e1.bssvfoundation.exception.BusinessService Exception;
    import oracle.e1.bssvfoundation.util.E1Message;
    import oracle.e1.bssvfoundation.util.E1MessageList;

    public class RRDMSG {

    public static void handleErrorMessages(E1MessageList messages, IContext context) throws BusinessServiceException{
    if (messages.hasErrors()) {
    //Get the string representation of all the messages.
    //String error = messages.getMessagesAsString();
    String error = "";
    for (E1Message e1Message : messages.getE1Messages()) {
    if (e1Message.getCallObjError() != null){
    error += "\n" + e1Message.getCallObjError().getGlossaryText();
    error += "\nD: " + e1Message.getCallObjError().getAlphaDescription() + ", ";
    error += "O: " + e1Message.getCallObjError().getFileName() + ", ";
    error += "E: " + e1Message.getCallObjError().getDDItem() + ", ";
    error += "L: " + e1Message.getCallObjError().getLineNumber() + "\n";

    //Throw new BusinessServiceException
    throw new BusinessServiceException(error, context);
    ================================================== ===============

    Any questions, just ask.
    John Danter
    You don't go out looking for a job dressed like that do you, on a weekday?

    E900 TR Unix

  2. #2
    New Member
    Join Date
    Jun 2005
    Thank you John!
    JD Edwards XE B7333, EnterpriseOne 8.11, 9.0 and 9.1, BSSV, C, JAVA

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.