PREP_PROCESS_FILE() function pull old file content
search cancel

PREP_PROCESS_FILE() function pull old file content

book

Article ID: 218933

calendar_today

Updated On:

Products

CA Automic One Automation

Issue/Introduction

PREP_PROCESS_FILE() function appears to return results out of cache rather than from disk at time of :PROCESS ing

Stale file contents were gathered using the PREP_PROCESS_FILE() script function.  For example:

  1. Create file in C:\temp called test.txt  File contents:
    test
    test2
    blank
    test3
  2. Create script object that does:
    :set &hnd# = prep_process_file(WIN01,"C:\temp\test.txt","*test*")
    :wait 100
    :PROCESS &HND#
    :   SET &LINE#=GET_PROCESS_LINE(&HND#)
    :   PRINT &LINE#
    :ENDPROCESS
  3. Run the script
  4. During the wait 100, update the file, changed test to null in all but 1 line
  5. Wait for the script to finish

Results of the process command:

test
test2
test3

Environment

Release : 12.3

Component : Automation Engine

Cause

This is as designed

Resolution

Automic should not pull from cache on the file system rather than from disk; this is something that would be handled from the Windows side rather than from Automic.

The behavior outlined Introduction above is as designed, caused by the prep_process_file function writing to the database when activated and the file being changed between prep_process_file being assigned

Scenarios where this could occur:
If there is a script in a workflow with generate at activation set and it's activated before the file is updated, it will take the file contents at activation, not at runtime
If the script has the prep_process_file command assigned (declared) early in the script before it's actually processed and the file changes between assignment and processing, it will take the file contents at assignment, not processing

The file contents that were for the specific run can be seen by right-clicking the task execution, choosing "Execution Lists" -> "Child Task Executions" and opening the report called something like PREP_PROCESS_FILE([task name],[10 digit run number of script execution]).