APPX Background Processing on a Windows Server

This document will demonstrate the setup of APPX background processing when APPX is installed on a Windows server.

Overview

JOB is the only APPX process type you can make available for back ground processing. At the end of this document you will have made all the demo (DMO) JOB output reports candidates for background processing.

Required software components

APPX Desktop Client

  • You can get the APPX Desktop Client from here.

APPX Server

  • You need a functioning APPX installation. Follow instructions in this document to install APPX on Windows if you don't already have APPX installed.
  • You should also have the variable APPX_BG_SCRIPT=appx_submit.cmd. You can place this variable setting inside your appx.env file. The appx.env file should go into your %APPXPATH directory (C:\Appx\data\appx.env)

DMO Demo APPX Application

DMO is demonstration application that is included with APPX on default installations.

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.

The appx.env file.

The appx.env file is a file that is referenced by all appx processes. The file contains environment variables that you want to be present for APPX sessions. Any line that starts with # is a comment line and is not used by APPX. The other lines have a syntax of VARIABLE=VALUE, where VARIABLE is an environment variable such as APPXPATH, and VALUE is the text that you want to assign to the variable, such as C:\Appx\Data. Here is an example appx.env file.

###############################################################################
#
#  APPX Configuration File
#  -----------------------
#
#  This file can be used to configure your APPX environment.  Upon startup, 
#  APPX will read this environment file, then it will look for an environment 
#  file in the user's home directory (or c:\ for Windows) for any overrides.
#
#  Comments are denoted by a leading "#" symbol, blank lines, and
#  lines not containing an = symbol.  The only exception is an "include"
#  which looks like this:
#
#  include=/etc/appx.env
#
#  The following file contains a list of the valid environment settings that
#  can be used with APPX.  To active any of these settings just remove the
#  comment symbol from the first column and then make any edits needed to the
#  environment variable value.
#
#  For this release, no substitution or expansion is done.  Every value is
#  taken as a literal value.
#
##############################################################################

#=============================================================================
#  GENERAL BASE CONFIGURATION SECTION
#=============================================================================

#  APPXPATH can be set here.  The default path is the APPX executable location
#  appended with a "data" subdirectory.
#
#APPXPATH=

#  APPX_MSG can be set to display a constant text message at the bottom of all 
#  of the APPX screens during an APPX session.
#
#APPX_MSG=Message text goes here

#  APPX_KEYMAP can be set to the name of the default keymap you would like to 
#  load.  This is the same as using the -m= command line option.
#
#APPX_KEYMAP=vt320-k

#  APPX_SHOW_PROGRESS will activate a running status message during Query
#  and related Output and Update processes.  This message will keep you
#  informed as to the progress of the batch process.  Number of records
#  processed, number of records selected, etc.  The message is updated
#  every record until it reaches 10, then it updates every 10 records
#  until it reaches 100, then it is updated every 100 records, etc.
#
#APPX_SHOW_PROGRESS=true

#  APPX_MAX_FILES will set the maximum number of physically open files
#  APPX can have open during an APPX session. If APPX tries to open more
#  files than this, it will start closing stale files that have no
#  records locked to make way for new files. If an closed file is
#  required to do I/O, it will automatically be re-opened without the
#  Application knowing anything has happened. We call this Open File
#  Descriptor Caching.
#
#APPX_MAX_FILES=80 

#  APPX_PIVOT_YEAR controls how APPX will "synthesize" the century
#  component of date fields.  "Synthesizing" a century is the process of
#  defaulting it based upon the two digit year and the pivot year value,
#  when the century is not explicitly available.  See the y2k Implementation
#  Guide for details.  Pivot year is implemented in APPX release 3.2.83
#  and greater.  By default, pivot year logic is disabled.  It is enabled
#  by setting this variable.
#
#APPX_PIVOT_YEAR=50

#=============================================================================
#  PRINTING AND JOB SUBMISSION CONFIGURATION SECTION
#=============================================================================

#  APPX_PRT_FI_DIR is used to set the disk location for creating print files
#  on your system.  The default location in unix is /tmp/.  The default 
#  location in Windows is $APPXPATH\print\{userID} #
#APPX_PRT_FI_DIR=/tmp/

#  APPX_PRT_SCRIPT points to the name of the script used to spool APPX reports
#  to a print device or queue manager.  The default is appx_print in the
#  APPXPATH directory.
#
#APPX_PRT_SCRIPT=appx_print

#  APPX_BG_SCRIPT points to the name used to submit batch jobs into background
#  or a job scheduling system.  The default is appx_submit.
#
# APPX_BG_SCRIPT=appx_submit.cmd

#=============================================================================
#  KEA INTERFACE CONFIGURATION SECTION
#============================================================================

#  APPX_KEYMAP can be set to the name of the default keymap you would like to 
#  load.  This is the same as using the -m= command line option.
#
#APPX_KEYMAP=keaterm

#  APPX_KEATERM controls how APPX talks to the KEA Terminal emulation package.
#
#APPX_KEATERM=Buttons
#APPX_KEATERM=NoButtons

#=============================================================================
#  SCRIPTING & REGRESSION TESTING CONFIGURATION SECTION
#=============================================================================

#  APPX_SCRIPT_OUT will record all enduser keystrokes (and selected 
#  Processes executed in the program flow) into an output file.  This 
#  file is quite readable, and is editable for the use of APPX_SCRIPT_IN 
#  (described below).  It is initialized upon entering APPX.  It is not 
#  populated until APPX is successfully exited.
#
#APPX_SCRIPT_OUT=/tmp/appx.script

#  APPX_SCRIPT_IN will "play back" all keystrokes recorded in it, 
#  into the invocation of the APPX engine, as if the enduser had 
#  manually pressed these keys.
#
#APPX_SCRIPT_IN=/tmp/appx.script

#  APPX_SCRIPT_STEP if set will cause APPX to pause before each APPX OPTION
#  key is sent from the script.  While paused, you can press certain keys
#  to do special processing.  Here is a list of the actions and keys that
#  work while you are paused.
#
#  c = continue running remainder of script without stepping.
#  p = pause and you take over the keyboard until you press ^r
#  e = terminate script playback and take control of the session.
#
#  any other key will step forward in the script until the next APPX OPTION
#  key is encountered in the script and then it will pause again.
#
#APPX_SCRIPT_STEP=true

#  APPX_TST_DIR points to a directory to capture screen images.  If this is
#  set, APPX will record every screen image it comes to into this location.
#  If you are running with APPX_SCRIPT_OUT set, then it will store the
#  images in a subdirectory of "expect" and if you are running with
#  APPX_SCRIPT_IN set, then they will be stored in a subdirectory of
#  "actual".  The screens themselves will be saved with a file name starting
#  with "screen000" and incrementing the last three digits.
#
#APPX_TST_DIR=/tmp

#=============================================================================
#  DESIGNER AIDS CONFIGURATION SECTION
#=============================================================================

#  APPX_DB_TRAPS when set will cause APPX to stop for TRAPs regardless
#  of who is running a process or how the process was started.  Without
#  this set, APPX will only execute traps when a process was started
#  from within Application Design.
#
#APPX_DB_TRAPS=true

#  APPX_PORTABLE_DATE when set will force the Import/Export utility to 
#  hide the bad_portable_date error that can sometimes come up quite
#  often when dealing with data from a SpeedII migration.  Speed would
#  allow you to store invalid dates in a date field via ILF code where
#  APPX will reject any invalid date during import.
#
#APPX_PORTABLE_DATE=true
  
#=============================================================================
#  VISION DATABASE CONFIGURATION SECTION
#=============================================================================

#  APPX_PD_SIGNS will tell APPX what byte pattern to use for the sign bits
#  of packed decimal numbers.  The default is "CD" which is how APPX
#  is normally distributed.  Vision uses a default of "FD" which can be
#  overridden when the vision programs are compiled.  This setting also
#  affects the APPX EMs which store some packed decimal information.  This
#  setting also affects files stored as native APPX files.  So, to use this
#  setting of "FD", you must install a special set of APPX internal EMs,
#  and if you have and existing data in "CD" format, you must export the
#  data, set the APPX_PD_SIGNS=FD, then import.
#  
#APPX_PD_SIGNS=FD

#=============================================================================
#  APPX FOR WINDOWS CONFIGURATION SECTION
#=============================================================================

#  APPX_0SA_PATH will tell APPX to look at this path for its System 
#  Administration files.  This is handy for running several copies
#  of APPX on networked PCs while sharing one common set of System
#  Administration settings.
#
#  You can also store shared design files on a common shared drive while
#  storing local copies of all of the EMs on a local drive.  To do this,
#  you create a FMS group for your design files and set the FMS Path to
#  the shared location while setting the FMS Controls fields to the local
#  path for storing EMs.
#
#  FMS Path     [r:\appx\data           ]
#  FMS Controls [EM=c:\appx\data        ]
#
#APPX_0SA_PATH=r:\appx\data

#=============================================================================
#  TECH SUPPORT DEBUGGING CONFIGURATION SECTION
#=============================================================================

#  APPX_UNIXIO_STATS and APPX_UNIXIO_PROCS work together to help 
#  debug file access and performance problems.  If you set APPX_UNIXIO_STATS
#  to a log file name, Appx will log all file i/o's performed.  The
#  format of the report is:
#    open_count read_count readnext_count start_count write_count rewrite_count filename
#  The statistics are written as each file is closed so if a file is closed and 
#  reopened, it will appear more than once in the log file.
#
#  Setting APPX_UNIXIO_PROCS will cause Appx to include the current process name
#  in the logfile.
#
#APPX_UNIXIO_STATS=/tmp/file_stats
#APPX_UNIXIO_PROCS=1

  • Place the following inside your appx.env file, which should be in %APPXPATH or C:\Appx\data\appx.env

APPX_BG_SCRIPT=appx_submit.cmd

The appx_submit.cmd Windows batch file

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

::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
:: an APPX session with syntax that will be similar to
:: c:\APPX\Appx.exe -session=BY2Z7JDC

:: If you were to view each argument passed to APPX_SUBMIT.CMD with the
:: following loop:

:: FOR %%A IN (%*) DO (
:: echo %%A >> c:\Appx\arglist.txt
:: )

:: You would likely see something like this in arglist.txt
:: -image 
:: C:\Appx\Appx.exe 
:: -session 
:: BY2Z7JDC 
:: -mode 
:: SPOOL 
:: -notify 
:: Yes 
:: -date 
:: 2009031201020202 
:: -priority 
:: 1 
:: -queue 
:: A 
:: -user 
:: Administrator

:: The following command should execute APPX with the session data as
:: an argument
::

%2 %3=%4

APPX Run Time

  • On the JOB's output disposition screen select SUBMIT to BG.
  • JOB-OUTPUT-002.gif

Bugs:

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

Comments:

Read what other users have said about this page or add your own comments.
-- JoeOrtagus - 10 Mar 2009
Topic attachments
I AttachmentSorted ascending History Action Size Date Who Comment
GIFgif JOB-OUTPUT-001.gif r2 r1 manage 38.9 K 2009-03-10 - 20:13 JoeOrtagus JOB OUTPUT - Notice the Sep. Task value is checked.
GIFgif JOB-OUTPUT-002.gif r1 manage 24.3 K 2009-03-10 - 20:13 JoeOrtagus JOB OUTPUT - Notice Submit to BG button
Edit | Attach | Watch | Print version | History: r11 | r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 2012-04-05 - BredaHennessy
 
  • Edit
  • Attach
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