Automated Job Recovery

 6 Replies
 2 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
GWilkins
Basic Member
Posts: 4
Basic Member

    Currently Lawson 10 - Windows/SQL

    My site currently has a VB Script monitoring the job queue using jqstatus -hrw
    The current monitor works, but we are hoping to get some additional functionality out of it and IPA/ProcessFlow is where we have decided to house the new setup. 

     

    I am trying to build a branch for any job in a 34-Needs Recovery status, which will then automatically recover that job. Thankfully the volume here is infriquent for recovery jobs and is typically an ED502 or RQ500 that recovers without issue, but we'd like to at least begin the recovery so that an analyst has a little more time to VPN in and check the run status of the job.

    I found the below SQL snippet, but I have only every used the QUEUEDJOB table to force close a couple "ghost" jobs that were actually closed, but stuck in a 0-Running status. I wasn't sure if forcing the status to 30-Waiting would cause a true recovery/initialization of the job, or if the job would just sit out in limbo and never actually run. I also wasn't sure if this would cause issues dependent on where the job went into needing recovery.

    UPDATE GENDB.lawson.QUEUEDJOB
    SET STATUS = 30,
    QJBSET12_SS_SW = 'N',
    QJBSET6_SS_SW = 'N',
    QJBSET7_SS_SW = 'N',
    QJBSET8_SS_SW = 'Y',
    QJBSET9_SS_SW = 'Y'
    WHERE STATUS = 34

    from https://www.lawsonguru.co...ss-Job-Recovery.aspx

    I also considered using an AGS call, but I couldn't quite figure out the path and didn't see anything in the IPD transaction builder that was immediately recognizable.

    Appreciate any and all assistance with this.

    Bob WCHN
    Basic Member
    Posts: 6
    Basic Member

      I have a Process Flow that checks Jobs and Recovers and Kills them (Invalid Parameters Staus jobs aren't going to recover).

      I do it easily with SysCmd Nodes using the jqstatus -wr to get the Job List and then jqaction -r to recover a job and jqaction -k to kill a Job.

      Jimmy Chiu
      Veteran Member
      Posts: 641
      Veteran Member
        After you queried the QUEUEDJOB table for status 34, you can assign the jobname and jobnumber to variables. Use a webrun node to recover the job if you want to do it from IPA. You can email notifications etc also. 

        /lawson-ios/action/RecoverQueuedJob?jobName=queryNode_JOBNAME&jobNumber=queryNode_JOBNUMBER

        put < and > around the variables.

        <!--queryNode_JOBNUMBER-->
        GWilkins
        Basic Member
        Posts: 4
        Basic Member
          Thank you both for the quick response.

          I will take a look at both approaches and see which one I want to implement into my flow. Both are going into my notes though!
          Alex Tsekhansky
          Veteran Member
          Posts: 92
          Veteran Member
            Also I suggest implementing a mechanism that tracks how many times you recover a specific job. A job that failed recovery will probably require manual intervention. We implemented logic for one of our clients where a failed job that auto-recovered before will result in an e-mail sent to a Lawson admin.
            GWilkins
            Basic Member
            Posts: 4
            Basic Member
              I am actually building in that logic already. We still intend to have someone review the log/work files to see what happened, we just want to get the ball rolling. Our biggest benefit from this is to kill invalid parameter jobs and notify the user.
              GWilkins
              Basic Member
              Posts: 4
              Basic Member
                I have opted to go with the webrun to simplify Security since the Pflow is running through a System ID. For anyone ever trying to complete a similar project in the future, the functions can be found at lsf\web\lawson\portal\reports (file structure may vary per install) under jobschedule.concat.js and jobschedule.js

                URL to call
                SERVER/lawson-ios/action/FUNCTION?jobName=JOBNAME&jobNumber=JOBNUMBER

                SERVER = Your Server
                FUNCTION= Action to be taken
                    Primary Functions
                        -Run Job = RunImmediateQueuedJob
                        -Recover = RecoverQueuedJob
                        -Kill Active Job = KillActiveJob
                -Cancel Waiting Job = CancelWaitingJob
                JOBNAME & JOBNUMBER = Variables from initial query against QUEUEDJOB on the GEN DB. 


                The WebRun node is setup like:
                Configuration name: Our Default Lawson App Server
                URL Type: Infor Lawson
                Web Program: lawson-ios/action/FUNCTION?jobName=JOBNAME&jobNumber=JOBNUMBER
                Post String: (Blank)