Support > Repository > CSV/Excel input/output > Upload update job
ja | en

Upload update can be prepared as a job. Regular upload update processing is realized. R7.6

Apart from doing upload update processing manually from the screen, it can be executed as a time designated job.

Please prepare the file to be uploaded in the path accessible from "production server".

Activate "Create upload update job" in "Screen> Upload> Upload update job".In addition, describe this job in "explanatory note".

Fig. 1 Preparing jobs

Prepare jobadmin account

"Support> Administrator Guide (R7)> Preparation: Enable job execution accountPlease prepare the jobadmin account according to the procedure of ".

As for the jobadmin account, please give authority (principal) to operate the target model.If you do not have permission, upload update job will fail.

Set upload update job

To handle Wagby's job for the first time, go to "Support> Administrator Guide (R7)> Job managementPlease read.Here, we will explain how to use jobs concretely.

  1. Log on with an account with administrator privileges.
  2. Open the "Job Management" "Job Schedule Search" screen from the menu.
  3. Click the "Register Screen" button to register a new job schedule.
  4. Select "UploadUpdate + Model ID + Job" from the job name.An explanatory text entered in Designer is displayed in the explanation column below that.
  5. In the job parameter, write the command you want to execute.[To be described later]
  6. Specify scheduleTo do.
  7. Check the "valid" flag.
  8. Enter the account and password of the administrator who will execute this job.It is good to use jobadmin prepared earlier.
  9. Register the job schedule.The command will be executed at the specified time.
Figure 2 Creating an upload update job
Figure 3 Setting Upload Update Job Parameters

Specify all the control related to this job as a job parameter.

Parameter name Description Description example
processfilename The file name to be processed.Be on the production server.This parameter isprocessdirnameIt takes precedence.Please specify either processfilename or processdirname.If both are not specified, an error occurs. C:\Downloads\YOURFILE.csv
/home/wagby/YOURFILE.csv
processdirname The name of the folder in which the file to be processed is stored.Be on the production server.Please specify either processfilename or processdirname.If both are not specified, an error occurs. C:\Downloads
/home/wagby/downloads
processdirfilter Specify the regular expression for the file name of the file to be processed.
The default is ". * \. (Csv | tsv | xls | xlsx | zip)".
That is, it targets only files with the extension csv, tsv, xls, xlsx, zip.Extension Alphabetic case is not distinguished.The extension is either csv or CSV.
.*\.csv
isLockModel Set "true" when locking the whole model.
Set "false" if you want to lock one model at a time for each processing row.
Default is "true".
false
processedfilemode Specify the processing target file after processing.
Delete if "delete".
If it is "rename", it moves to the specified destination.
It defaults to "delete".
When specifying "rename" renamedirrenamefilenamerenamefileheaderrenamefilefooterYou can set either.If all these have been omitted,renamefilefooterIt is assumed that ".processed" is set to "0".
rename
renamedir processedfilemodeIt is valid when "rename".
Specify the destination folder of the processing target file after completion of processing.
If the specified folder does not exist, create it.
When this is specified, "processing result file" "error file" will also be moved to the specified folder.
Relative path notation is also possible.It is treated as a relative path from the directory where the file to be processed is located.
If it is not specified, it will be moved to the directory where the file to be processed is located.

By specifying {0, date, yyyyMMdd - HHmmss}, the whole processing start date and time can be specified.
By specifying {1, date, yyyyMMdd - HHmmss}, you can specify the processing start date and time of the file.
By specifying {2}, you can specify the number of processing files.
By specifying {3}, you can specify the total number of processed files.
customer{0,date,yyyyMMdd-HHmmss}
It will be customer20150801-100000 and so on.
renamefileheader processedfilemodeIt is valid when "rename".
Specify the beginning part of the destination file name.
For example, if you specify "Processed_", the file a.csv will be renamed to Processed_a.csv after processing.

You can also use the notation {0} {1}, ....(renamedirPlease refer to the explanation of)
{1,date,yyyyMMdd-HHmmss}_
It will be 20150801-100000_a.csv etc.
renamefilefooter processedfilemodeIt is valid when "rename".
Specify the end part of the destination file name.
For example, if you specify "_Processed", the file a.csv will be renamed to a.csv_Processed after processing.

You can also use the notation {0} {1}, ....(renamedirPlease refer to the explanation of)
_{1,date,yyyyMMdd-HHmmss}
A.csv_20150801-100000 and so on.
renamefilename processedfilemodeIt is valid when "rename".
Specify the destination file name.

You can also use the notation {0} {1}, ....(renamedirPlease refer to the explanation of)
The following notation is also valid.
{4} - File name (ex: a.csv)
{5} - File name without extension (ex: a)
{6} - extension (eg. Csv)
{5}_backup{6}
It becomes a_backup.csv.
processingdir It refers to the destination of the target file at the start of processing.
If specified, the target file will be processed after it is moved to this folder.
If not specifiedprocessingfilefooter".processing" is assumed to be set to.
C:\work
/tmp
processingfileheader Apply the specified character to the beginning of the target file that started processing.Indicates that you are working.
If specified, processing will be done after renaming the target file.
If not specifiedprocessingfilefooter".processing" is assumed to be set to.
processing_
processingfilefooter Apply the specified character to the end of the target file that started processing.Indicates that you are working.
If specified, processing will be done after renaming the target file.
_processing
processingfilename Change the target file that started processing to the specified name.Indicates that you are working. Working.csv
errordir It refers to the destination of the target file when an error occurs.
If specified, processing will be performed after moving the target file to this folder when an error occurs.
If not specifiederrorfilefooter".error" is assumed to be set to ".error".
C:\errorfile
/home/wagby/errorfile
errorfileheader When an error occurs, a specified character is added to the beginning of the target file.
If specified, change the name of the target file when an error occurs.
If not specifiederrorfilefooter".error" is assumed to be set to ".error".
error_
errorfilefooter When an error occurs, a specified character is added to the end of the target file. _error
errorfilename Change to the name specified when an error occurred. Error.csv

You can temporarily disable the job.

  1. Log on with an account with administrator privileges.
  2. Open the "Job" "Job Schedule Search" screen from the menu.
  3. Search the applicable "Job Schedule" and open the maintenance screen.
  4. Uncheck the "Enabled" flag and save it.
    Figure 2 Disable Job

You can send the job execution result by e-mail.

Here is an example of sent mail.

処理対象ファイル .\a.csv を処理します。

開始時刻:2015-07-09 11:56:16 / 終了時刻:2015-07-09 11:56:17
End 処理した行数:3/新規登録:1/更新:1/削除:0/エラー:0

処理対象ファイル .\a.csv.processing を .\20150709-115616\a.csv に移動しました。
処理結果ファイル C:\wagbyapp\temp\process_model13555561895887649907.csv を .\20150709-115616 に移動しました。
エラー結果ファイル C:\wagbyapp\temp\error_model1387678353843031222.csv を .\20150709-115616 に移動しました。

If the file specified by the job parameters processfilename, processdirname does not exist, the mail body is empty.This is because it is assumed that you want to skip in the job parameter mail: doNotSendEmptyMessage.

Multiple job execution can not be performed.

If you make a job start every minute, if execution of this job is not completed in 1 minute, a new job will not be executed.

Instead of specifying time, you can also run this job now."Execute job immediatelyPlease read.

  • If an error occurs during multiple file processing, skip the file and process the next file.Also, at that time, the name of the error file will be changed.(You will notice that an error has occurred.)
  • When an error occurs before the process starts, an error message is recorded in the log (system.log) and mail respectively.