Error trapping with an Email node

 10 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Ward Mitchell
Veteran Member
Posts: 81
Veteran Member
    Friends, I am in need of some help... I am trying to error check an email node to see if an email is sent out. On most nodes in PF, there are _errorCode, _outputData and _returnMessage properties (let's call them). Does the email node have any "properties" and if so, what are they can can they help with error checking? Thanks in advance for your help with this.
    M Graham
    Veteran Member
    Posts: 32
    Veteran Member
      You have to run your processflow on the server (and not using PF Designer on your desktop) in order for a log file to be created. You can then look in the log file to troubleshoot the email node. The log file is located at: LAWDIR/bpm/wflog/99999.wulog (where 99999 is the workunit number). The log file includes entries for the email node, such as:
      --------------------------------
      Executing Email Activity Email4400.....
      Variables in Process : pffilename_V01 Workunit : 14476, ActivityType=EMAIL, ActivityName=Email4400, ActivityId=EMAIL4 Date:03/09/2011 Time:10:28:03
      aTo(Type=String) = yourname@company.com
      aCc(Type=String) =
      aBcc(Type=String) =
      aFrom(Type=String) = processflow@company.com
      Executed activity : Type=EMAIL, ActivityName=Email4400, ActivityId=EMAIL4, Workunit=14476 Date:03/09/2011 Time:10:28:03
      -------------------------------------
      Hope this helps!
      Ward Mitchell
      Veteran Member
      Posts: 81
      Veteran Member
        M Graham, thanks for the response. I know about this. What I wonder though is. is there a way to tell if the email was sent successfully or not? We have issues where some emails are undeliverable and we want to know to route something else electronically to them - interoffice message, text message or something - regarding their ACH that went through or not so they know. From your screenshot I do not see any type of success variables but just wondered if there was something not "documented" by Lawson (which is how I find a lot of things like this). Thanks!
        M Graham
        Veteran Member
        Posts: 32
        Veteran Member
          I see what you are saying. What I have done in cases like that is contact my company email administrator to have them verify if an email was sent and/or received. Also, at one time, our email admin blocked email that was sent from the 'dummy' email address of "processflow@company.com". which is the email address stored in the process flow email node. Now email admins know not to block those emails.
          M Graham
          Veteran Member
          Posts: 32
          Veteran Member
            In other words, I do not think there is a way to track 'undeliverable' emails in Lawson process flow.
            Ward Mitchell
            Veteran Member
            Posts: 81
            Veteran Member
              Yeah it is starting to look that way. I also wondered about reading the actual log being generated to see if errors existed. The bad thing here is that the log is locked and cannot be opened or else is not in existance yet to the process flow to pick it up. The code runs fine but tells me that the workunit.wulog file does not exist. We can probably monitor this directory for new files with a cron job or something, but wanted to see if process flow could do it so we can make pretty little email messages for the developers to decipher to find the errors Oh, I am the developer, ok!
              JeffR
              Advanced Member
              Posts: 22
              Advanced Member
                The way that I know that an email didn't get sent successfully is that all emails are sent with a from address of pflow@ and our Exchange administrator has attached the pflow account to my email so I receive an emails that get bounced back.
                Josh W
                New Member
                Posts: 2
                New Member
                  on unix the server email log is often at /var/adm/syslog/mail.log

                  you'll see 'to=user@company.com' and later in the same line 'stat=Sent' if it was sent ok

                  i have a script that sends an email, then immediately reads backwards through this file and finds the first occurrence of the email address i'm trying to send to. all i needed to do was check for 'stat=User unknown' vs 'stat=Sent'...but you may need to do something more than that. if so, if you can locate this file, you can run some tests to see what the 'stat' value would be in each of your scenarios

                  you can do that in the flow if you have PFI...if not, itd be much tougher or should be done in a script
                  Ward Mitchell
                  Veteran Member
                  Posts: 81
                  Veteran Member
                    Here is what I found out and did friends...

                    I created a flow to send emails to vendors who we send ACHs out via the AP160. When the 160 job is submitted and ran, in the COBOL, we trigger a process flow to email the vendors. So all that works.

                    Well then we needed to see if any errors occurred. Since you cannot see the error log until a flow finishes running, I had an issue. For most nodes, you can use the _errorCode property to pull out errors, but sometimes those are misleading. So I created a new process flow that gets invoked and is passed the workunit from the last process flow that ran. Then this process flow I created, goes and looked for the wuerr files for that workunit, if one is there, and emails our developers in house (me).

                    So some 4GL changes are necessary, but in our case it is warranted. And so this is the best way for us to handle it. In the future, maybe we can even utilize this same flow to trap errors for other flows as well, so we can have some logging to inform us of issues.

                    So thanks to everyone who reponded, great ideas! That is why I love lawsonguru - Great minds think alike!
                    JudeBac
                    Veteran Member
                    Posts: 129
                    Veteran Member
                      Hi, have you considered querying LOGAN.dbo.WFACTIVITY using the ACTIVITY_ID of the email node? ACT_STATUS =3 is fail.

                      Regards,

                      Jude
                      Ward Mitchell
                      Veteran Member
                      Posts: 81
                      Veteran Member
                        JudeBac, this is a very good idea. My only hang up here is that I need to actually pull and email the actual error itself out for a developer to remedy ASAP. I will keep this in mind though for future flows because metadata will be helpful to access in some initiatives we have upcoming that will be more involved and detailed than this flow I m working on right here for sure!