IPA Batch Job Montioring after WebRun node kicks it off

 5 Replies
 3 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Deb Roberts
New Member
Posts: 3
New Member

    When we kick off a batch job with the WebRun node in IPA, is there a way to delay the flow from moving to the next node until the job successfully completes?  Or do we have to use a Wait node and determine how long the job usually takes to run?

    Thanks in advance for your help!

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      Of course! You can query the Job Queue table to check the status of the job and if it is still running, go into a wait for a few minutes and keep checking until it's done.
      David Williams
      JimY
      Veteran Member
      Posts: 510
      Veteran Member
        Check out KB 1667935 on the Infor Support site. It has sample IPA Flows and one of them is submitting a job and checking the status.
        pbelsky
        Veteran Member
        Posts: 80
        Veteran Member

          I also query QUEUEDJOB, but use it a little differently. The query below checks the job's staus code in QUEUEDJOB every .01 seconds and breaks out of the loop when the status is no longer zero. Then the select returns the final status code of the job so you can check and act on it.

           

          DECLARE @status as integer
          DECLARE @timer as decimal(8,0)
          SET @status = 0
          SET @timer = 1

          WHILE @status = 0
          BEGIN
          WAITFOR DELAY '00:00:00.100'
          SET @status = (SELECT STATUS FROM .dbo.QUEUEDJOB WHERE JOBNUMBER = '')
          --PRINT @status
          IF @timer = 6000
             BREAK
          ELSE
             SET @timer = @timer + 1
             --PRINT @timer
          END

          SELECT A.STATUS
          FROM .dbo.QUEUEDJOB A
          WHERE A.JOBNUMBER = ''

          pbelsky
          Veteran Member
          Posts: 80
          Veteran Member

            Sorry, sql did not paste in properly:

            DECLARE @status as integer
            DECLARE @timer as decimal(8,0)
            SET @status = 0
            SET @timer = 1

            WHILE @status = 0
            BEGIN
            WAITFOR DELAY '00:00:00.100'
            SET @status = (SELECT STATUS FROM .dbo.QUEUEDJOB WHERE JOBNUMBER = 'xxxxx')
            --PRINT @status
            IF @timer = 6000
               BREAK
            ELSE
               SET @timer = @timer + 1
               --PRINT @timer
            END

            SELECT A.STATUS
            FROM .dbo.QUEUEDJOB A
            WHERE A.JOBNUMBER = 'xxxxx'

             

            dmcdougald
            Posts: 3

              Here is the example written in IPA as mentioned above. You might have more control over error handling if you do it this way as opposed to SQL.

              Attachments