Skip To Content

Copy Job Files (Topographic Production)

Zusammenfassung

Copies Workflow Manager job files to and from a local machine and a shared directory for processing.

Vorsicht:

This tool is designed to be run as a step in a Workflow Manager workflow. Running this tool outside of Workflow Manager does not honor all Workflow Manager constraints such as job assignment, dependencies, or holds and may cause a job to enter an unusable state.

Vorsicht:

This tool is intended for use with the Topographic Mapping production workflows and will not support an improperly configured Workflow Manager repository. Sample workflows and instructions for configuring Topographic Mapping production workflows are available as part of the product files installer.

Verwendung

  • If the name of a file in the target path matches a file from the source path, the file in the target will be overwritten.

  • This tool updates the TOPO_PRODUCTION_PROPERTIES.Current_Job_Path extended property value.

  • This tool requires that the TOPO_PRODUCTION_PROPERTIES.Shared_Job_Path and TOPO_PRODUCTION_PROPERTIES.Current_Job_Path extended property values are populated for the selected job.

  • When the Archive Source Files parameter is checked, a .zip file will be created containing the files from the source path. The .zip file will be created in the target path and named with the job ID and the current date time stamp.

  • When the Archive Source Files parameter is checked, the path to the .zip file created will be written to the TOPO_PRODUCTION_PROPERTIES.Output_File_Path extended property.

  • When the Delete Source Files parameter is checked, the source path and all the files it contains will be deleted after they are successfully copied to the target path.

  • When the Create Job Folder parameter is checked, a folder will be created in the target path. The folder will be named using the job name. All of the files from the source path will be copied to this new folder.

  • If values exist for the TOPO_PRODUCTION_PROPERTIES.Item_URL, TOPO_PRODUCTION_PROPERTIES.Current_Job_Data_Path, or TOPO_QC_PROPERTIES.job_reviewer_db extended properties, the values for the properties will be updated to point to the target path.

Syntax

CopyJobFiles(job_id, source_path, target_path, {archive_source}, {delete_source}, {create_job_folder}, {database_path})
ParameterErklärungDatentyp
job_id

The Job ID of the Workflow Manager job that will be updated.

Long
source_path

The path to the folder containing the files to be copied.

Folder
target_path

The path to the location where the files will be copied.

Folder
archive_source
(optional)

Specifies whether the files in the source path will be zipped before copying to the target location.

  • ARCHIVEA .zip file with the contents of the source directory will be created and copied to the target location.
  • NO_ARCHIVEThe contents of the source directory will be copied directly to the target location. This is the default.
Boolean
delete_source
(optional)

Specifies whether the files in the source path will be deleted after the files are copied to the target location.

  • DELETE_SOURCEThe source directory and all its contents will be deleted after the files are copied.
  • NO_DELETE_SOURCEThe source directory will not be deleted after the files are copied. This is the default.
Boolean
create_job_folder
(optional)

Specifies whether a folder will be created in the target path for containing the copied files.

  • CREATE_JOB_FOLDERA folder will be created in the target path with the name of the chosen job. Files are copied from the source path to this new folder.
  • NO_CREATE_JOB_FOLDERA folder will not be created, and files from the source path will be copied directly to the target path. This is the default.
Boolean
database_path
(optional)

The Workflow Manager database connection file (.jtc) that contains the job information. If no connection file is specified, the current default Workflow Manager database will be used.

File

Abgeleitete Ausgabe

NameErklärungDatentyp
updated_job_id

The Job ID of the updated Workflow Manager job.

Long

Codebeispiel

CopyJobFiles example (stand-alone script)

This sample script copies files from a shared server machine to a local machine or copies files from a local machine back to a shared server machine.

# Name: CopyJobFiles_sample.py
# Description: Sample script for running the Copy Job Files tool to copy files from a shared server machine to a location
# on a local machine or to copy files from a local machine back to a shared server machine

# Import System Modules
import arcpy

# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
arcpy.CheckOutExtension('JTX')

# Setting the environment
arcpy.env.overwriteOutput = True

# Setting Local Variables
job_id = 2031
source_path = r'\\server1\data\TopoMapping\TestData\ProJobArtifacts\TDS7_JOB_2029'
target_path = r'C:\data\Workflows'
archive_source = 'NO_ARCHIVE'
delete_source = 'NO_DELETE_SOURCE'
create_job_folder = 'CREATE_JOB_FOLDER'
database_path = r'C:\Data\Workflows\Testing.jtc'

# Calling the Copy Job Files tool to copy files from a shared server machine to a location on a local machine
arcpy.topographic.CopyJobFiles(job_id, source_path, target_path, archive_source, delete_source, create_job_folder, database_path)

# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))

# Check In Extensions
arcpy.CheckInExtension('Foundation')
arcpy.CheckInExtension('JTX')

Umgebungen

Dieses Werkzeug verwendet keine Geoverarbeitungsumgebungen.

Lizenzinformationen

  • Basic: Nein
  • Standard: Erfordert Production Mapping and Workflow Manager
  • Advanced: Erfordert Production Mapping and Workflow Manager

Verwandte Themen