Project

General

Profile

Update EFFORT ARCHIVES table

Create/Install/Remove Software Versions

Currently the software is running on the appora server. The following are the commands for creating, installing and/or removing a new version of the software using ups/upd:

  • Setup ups/upd: for the next items it is assumed that ups/upd products have been setup:

. /usr/local/etc/setups/sh
setup upd
setup ups

  • Create new version: at the top directory of the software development area execute:

. setup.sh
release0.sh vn_m -c (vn_m is the version number to be created)

  • Install new version: to be able to install a new version of the software one needs to login as user products on dbweb1 (ssh -l products dbweb1.fnal.gov) and issue the commands:

upd install -G -c ftl_util_py vn_m -0 (vn_m is the version number to be installed)

  • Uninstall a version: to be able to uninstall a version of the software one needs to login as user products on dbweb1 (ssh -l products dbweb1.fnal.gov) and issue the commands:

ups undeclare -Y ftl_uti_py vn_m -0
ups declare -c ftl_util_py vn_(m-1) -0

Running the Python Application

Currently the software is running on the appora server. To define the application environment variables required to run the application in production mode, run the following script:

. setup_kronosImport

The setup_kronosImport script contains the following commands:

. /usr/local/etc/setups.sh
setup ftl_util_py
export FTL_UTIL_PY_SCRIPTS_CFG_FILE=/home/miscomp/ftl_util_py_cron/bin/config/ftl.config

The setup_kronosImport script defines the following environment variables:

FTL_UTIL_PY_DIR: root directory of the package. Current Version: /appora/products/prd/ftl_util_py/v1_27/NULL
FTL_UTIL_PY_SCRIPTS_CFG_FILE: configuration file. Default Value: /home/miscomp/ftl_util_py_cron/bin/config/ftl.config

The cron job that updates the oracle database table EFFORT_ARCHIVES with previous week's effort data runs every Wednesday at 2:00 AM:

00 2 * * 3 /home/miscomp/ftl_util_py_cron/bin/run_kronosImport.sh | /bin/mail -s "kronos data load"

To run the script manually:

python $FTL_UTIL_PY_DIR/py_src/kronosImport.py --option1 --option2

Note: The data are selected from the eBS view:

apps_applmgr.pac_kronos_effort_report_v@EBSDB

Command Line Options

  • --updatedb : update the EFFORT_ARCHIVES database table. Required for normal operations. If omitted the database table EFFORT_ARCHIVES is NOT updated
  • --debug : display debugging information
  • --display : display the records that are processed
  • --printsql : display the sql commands that are to be executed, used for debugging purposes to check the sql statements
  • --summary : display summary information
  • --startdate : record selection criteria
    Default value:
    If no --enddate is given --> Monday of previous week
    If --enddate is given --> Monday of the enddate week
    If --startdate is specified --> startdate is set to Monday of the startdate week
  • --enddate : record selection criteria
    Default value:
    If no --startdate is given --> Sunday of previous week
    If --startdate is given --> Sunday of the startdate week
    If --enddate is specified --> enddate is set to Sunday of the enddate week
  • --paytype : record selection criteria
    Default value: select all records
    --paytype=m select only monthly employee records
    --paytype=w select only weekly employee records

Examples:
To process last week's records and update the EFFORT_ARCHIVES table use the command:

python $FTL_UTIL_PY_DIR/py_src/kronosImport.py --updatedb

To process a specific week's records, update the EFFORT_ARCHIVES table and get a summary report use the command:

python $FTL_UTIL_PY_DIR/py_src/kronosImport.py --startdate=14-Dec-2010 --updatedb --summary
or
python $FTL_UTIL_PY_DIR/py_src/kronosImport.py --enddate=14-Dec-2010 --updatedb --summary

The above commands will process all records for the week starting on Monday December 13, 2010 and ending on Sunday December 19, 2010

To process records for an arbitrary period, update the EFFORT_ARCHIVES table and get a summary report use the command:

python $FTL_UTIL_PY_DIR/py_src/kronosImport.py --startdate=10-Sep-2010 --enddate=14-Dec-2010 --updatedb --summary

The above commands will process all records starting on Monday September 6, 2010 and ending on Sunday December 19, 2010

The help parameter displays the following information:

python $FTL_UTIL_PY_DIR/py_src/kronosImport.py help


Usage:

       kronosImport.py (Import kronos Effort Data) [--options]

Where:

  --options:
                         --debug # print debugging information
                       --display # display the records that are processed
                      --printsql # print out the sql commands that are to be executed
                       --summary # print summary information
                      --updatedb # update the effort arhives
              --division=<value> # for future Use
               --enddate=<value> # process only records till this start date (Format: 5-Jan-2011)
               --paytype=<value> # employee pay type (m (Monthly) or w (Weekly))
             --startdate=<value> # process only records from this start date (Format: 5-Jan-2011)

Required Data Types:
                         paytype : m (Monthly) or w (Weekly)

EFFORT_ARCHIVES Table Update Process

The Kronos effort files are processed as follows:
  1. Records are read and processed for one week at a time. If start and end dates specify a longer than a week period, that period is split and processed one week at a time
  2. All records in the eBS view are read and grouped on a per person per effort period basis. All required EFFORT_ARCHIVES field information is filled/calculated at this point.
  3. For each person and effort period being processed any existing entries in the EFFORT_ARCHIVES table are removed prior to the insertion
  4. The Adjusted for PTO effort is calculated over the entire FY for all employees after the current week records are processed