Using the Job Notification Outbound REST Message

Purpose: Use the Job Notification outbound REST message to notify an external system of each periodic process that has run, or any job that has gone into Message status.

Message contents: The message includes:

         The code identifying the job or the periodic process that has run

         The job number identifying the job at the Job Management Screen

         The name of the job or process

         The status of the job or process

         The date and time when the job or process started

         The date and time when each function completed

         The date and time when the job or process completed

Required setup: The outbound message is generated only if the following setup is completed.

         Endpoint: Use the JOB_NOTIFICATION_ENDPOINT_URL setting in Working with Customer Properties (PROP) to specify the endpoint to receive the outbound messages.

         Web service authentication: Use the Working with Web Service Authentication (WWSA) menu option to define a valid Job Notification user or client ID and client secret for outbound web service authentication.

Also, if using OAuth, the interface built to communicate with this service must implement OAuth 2.0 authentication with a /getAuthToken endpoint. The /getAuthToken process should expect an “Authorization” http request header with a basic authentication consisting of username and a Base64 encoded password. If the username and password pass validation, the expected JSON response should include:

{

“access_token” : “token_string”,

“expires_in” : nnn

}

Where nnn is an integer value in seconds.

For more information: See:

         Working with Periodic Processes (WPPR) for background on periodic processes.

         Executing Periodic Processes (EPRO) for information on submitting and scheduling periodic processes using Order Management System screens.

         Scheduling Jobs for background on scheduling jobs, and a listing of periodic functions available to schedule.

In this topic:

         Job Notification Outbound Message

         Sample Job Notification Message

         Job Notification Contents

Job Notification Outbound Message

Sample Job Notification Message

Below is a sample Job Notification outbound message.

{  

  "companyCode":6,

  "jobCode":"PROCESS",

  "jobNumber":"175947",

  "jobName":"SAMPLE PROCESS",

  "status":"Completed",

   "processHistoryDetailBeans":[  

      {  

        "date":"2018-04-11",

        "time":"15:35:58",

        "function":"*INIT",

        "message":"Process started"

     },

      {  

        "date":"2018-04-11",

        "time":"15:35:59",

        "function":"FUNCTION1",

        "message":"Function completed"

     },

      {  

        "date":"2018-04-11",

        "time":"15:36:00",

        "function":"FUNCTION2",

        "message":"Function completed"

     },

      {  

        "date":"2018-04-11",

        "time":"15:36:01",

        "function":"*FINISH",

        "message":"Process completed"

     }

  ]

}

Job Notification Contents

Tag

Description

company_code

The company code where the periodic process or job ran. Leading zeroes are omitted.

Numeric, 3 positions.

job_code

The code identifying the periodic process or job.

Alphanumeric, 10 positions.

jobName

The Description of the periodic process or job.

Alphanumeric, 70 positions.

status

Set to Completed if the process or job completed successfully; otherwise, set to Error.

processHistoryDetailBeans

Includes a separate entry for starting the job or process, completing each function, and completing the job or process, including the date, time, function, and message.

date

The date when the entire process or job started or completed, or when a function within the process completed.

time

The time when the process or job started or completed, or when a function within the process completed.

function

Set to:

         *INIT to indicate when the entire process or job started, or

         The code identifying a function within the process or job that completed, or

         *FINISH to indicate when the entire process or job completed.

message

Possible messages are:

         Process started

         Function completed

         Process completed

 

________________________________