Difference: BackgroundProcessing (9 vs. 10)

Revision 102016-02-12 - JeanNeron

Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="APPXAdministrator"

APPX Background Processing on a Windows Server

>
>
META TOPICPARENT name="SystemAdministration"

APPX Background Processing

 
Changed:
<
<
This document will demonstrate the setup of APPX background processing when APPX is installed on a Windows server.
>
>
This document discusses APPX background processing.
 

Overview

Changed:
<
<
Background processes refers to the ability of APPX to spawn another session to run a report or finish other processing. This will free the foreground session immediately and allow the user to do something else. If you run somethign in backgroud that requires any user interaction, APPX wil behave as if the user pressed the END key.

Steps

APPX Designer

  • Modify the JOB's OUTPUT process type to have Separate Task (Sep. Task) checked as shown in the figure below.
  • JOB-OUTPUT-001.gif

APPX Server

If all you wish to do is submit an APPX JOB's OUTPUT process to the background, you do not need to set the APPX_BG_SCRIPT environment variable, nor do you need to have an appx_submit.cmd batch file. If however you wish to take specific action based on one of the arguments APPX passes to the appx_submit.cmd script , then you should set APPX_BG_SCRIPT=appx_submit.cmd and create an appx_submit.cmd file that can act on the 8 argument pairs that are past. They are (-image, -session, -mode, -notify, -date, -priority, -queue, and -user) These configuration files (appx.env file containing APPX_BG_SCRIPT environment variable, and appx_submit.cmd batch script) need to be placed on the APPX Windows server.

  • Place the following inside your appx.env file, which should be in %APPXPATH or C:\Appx\data\appx.env
>
>
Background processes refers to the ability of APPX to spawn another session to run a report or finish other processing. This will free the foreground session immediately and allow the user to do something else. If you run something in background that requires any user interaction, APPX wil behave as if the user pressed the END key. This is true on all Linux/Unix platforms, but in some versions of APPX on Windows the background process will hang waiting for user input, therefore on Windows platforms you should ensure your backgound job does not require any user input.
 
Changed:
<
<
APPX_BG_SCRIPT=appx_submit.cmd
>
>
Before a job or process can be run in background the designer must check the 'Separate Task' flag on the job step. Without this setting the job will always run in foreground, regardless of anything else. NOTE: A side effect of checking this flag is that you cannot get any values back from the job or process, even if it is run in foreground.

Next, either the user has to request background processing on the Disposition screen by clicking the 'Submit to BG' button or the Designer can set --- SUBMIT PROCESS to Y in the Pre-Invocation Event Point. There are other --- SUBMIT fields available, but those are intended for use with any 3rd party job queue managers, APPX does not use them.

On Linux/Unix platforms, APPX runs the appx_submit script to invoke a background job. This script in in the $APPXPATH folder. On Windows platforms, the engine invokes the background session directly without using a script or batch file. If you want APPX to use a script on Windows so that you can customize the behaviour, set the APPX_BG_SCRIPT environment variable (see below).

On all platforms the engine will spawn another APPX session, passing the -session flag. This flag points to a temporary file that contains the context, i.e., any open files, any work fields and anything the background session needs to continue processing.

APPX Designer

For example, we can modify the SALESREP LISTING job in DMO by checking the 'Sep. Task' option:

JOB-OUTPUT-001.gif

If the user clicks the 'Submit to BG' button on the Disposition screen, the report will run in background. Alternatively, the Designer coudl set --- SUBMIT PROCESS to Y in the Pre-invocation step of the Output, and the report would always run in background regardless of the user's selection.

Setting APPX_BG_SCRIPT

You can customize the processing by setting APPX_BG_SCRIPT to your own script. On Linux/Unix platforms, we recommend copying the existing appx_submit script and changing your copy. If you customize appx_submit directly it will get replaced when you upgrade APPX and you customizations will be lost. On Windows, there is no existing script or batch file, so you will have to create your own. Either way, you must set APPX_BG_SCRIPT to point to your script file. See Setting Environment Variables for more information on settting environment variables. The script is assumed to be in the $APPXPATH folder,

 
Changed:
<
<

The appx_submit.cmd Windows batch file

>
>
The script will receive 8 arguements: -image, -session, -mode, -notify, -date, -priority, -queue, and -user. In Release 5.4.4 & higher, the script will also receive -options which will contain whatever data is in the --- SUBMIT OPTIONS PDF. This might have been entered by the user on the Submit to Background screen in the 'Submit Options' field, or set by the Designer directly.

Example appx_submit.cmd Windows batch file

 
Changed:
<
<
The appx_submit.cmd file is a Windows batch file that you can parse the 8 argument pairs that APPX passes it.
  • The appx_submit.cmd command should contain
>
>
The following is an example of a Windows script that will invoke the background job. We are using a .cmd script, but it could a .bat file as well.
 
Changed:
<
<
::APPX_SUBMIT.CMD
:: A Typical Argument list will be 8 Arguments passed from APPX

>
>
::APPX_SUBMIT.CMD
:: A Typical Argument list will be 8 Arguments passed from APPX

 :: -image, -session, -mode, -notify, -date, -priority, -queue, and -user :: Windows will break on the equals sign giving us 16 arguments in total :: We will ignore all but the -image and -session pairs to submit
Line: 64 to 70
 %2 %3=%4
Changed:
<
<

APPX Run Time

  • On the JOB's output disposition screen select SUBMIT to BG.
  • JOB-OUTPUT-002.gif
  • NOTE: If you do not wish to present a Disposition screen, you can specify background processing in ILF code:
    • SET --- SUBMIT PROCESS = Y

Bugs:

  1. Fixed - Bug Description 1.
  2. OPEN - Bug test - Test bug. Not valid.

Comments:

>
>

Comments:

  Read what other users have said about this page or add your own comments.
Line: 81 to 79
 
META FILEATTACHMENT attachment="JOB-OUTPUT-001.gif" attr="" comment="JOB OUTPUT - Notice the Sep. Task value is checked." date="1236715995" name="JOB-OUTPUT-001.gif" path="JOB-OUTPUT-001.gif" size="39785" stream="JOB-OUTPUT-001.gif" user="Main.JoeOrtagus" version="2"
META FILEATTACHMENT attachment="JOB-OUTPUT-002.gif" attr="" comment="JOB OUTPUT - Notice Submit to BG button" date="1236716030" name="JOB-OUTPUT-002.gif" path="JOB-OUTPUT-002.gif" size="24911" stream="JOB-OUTPUT-002.gif" user="Main.JoeOrtagus" version="1"
Added:
>
>
META TOPICMOVED by="JeanNeron" date="1455301986" from="Main.SubmittingAJobToTheBackgroundInAPPXOnWindowsServers" to="Main.BackgroundProcessing"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback