Cancel Remaining Tasks (Topographic Production)

Resumen

Prevents the remaining tasks in a job from starting or being created. The active task and its task group job will still complete.

Sugerencia:

It is recommended that current Workflow Manager (Classic) users begin new projects using the services-driven version of ArcGIS Workflow Manager for ArcGIS Pro.

Uso

  • A task group, or parent job, is composed of a series of tasks, or child jobs.

  • This tool can be run while a task or task group is running if there is no longer a need to complete the remaining tasks.

  • This tool is intended for use with the topographic mapping production management workflows and requires a properly configured ArcGIS Workflow Manager (Classic) repository.

  • The TOPO_TASK_PROPERTIES table is used to determine which tasks remain for a job, and the table is updated to indicate that the remaining tasks no longer need to be run.

  • Use the ID of the parent task group as the Job ID parameter value, not the child task job.

Parámetros

EtiquetaExplicaciónTipo de datos
Job ID

The job ID of the parent ArcGIS Workflow Manager (Classic) task group job that contains the task list derived from the Set Task List tool.

Long
Input Database Path
(Opcional)

The ArcGIS Workflow Manager (Classic) database connection file that contains the job information. If a connection is not specified, the current default ArcGIS Workflow Manager (Classic) database will be used.

File

Salida derivada

EtiquetaExplicaciónTipo de datos
Updated Job ID

Returns the Job ID parameter value.

Long

arcpy.topographic.CancelRemainingTasks(job_id, {database_path})
NombreExplicaciónTipo de datos
job_id

The job ID of the parent ArcGIS Workflow Manager (Classic) task group job that contains the task list derived from the Set Task List tool.

Long
database_path
(Opcional)

The ArcGIS Workflow Manager (Classic) database connection file that contains the job information. If a connection is not specified, the current default ArcGIS Workflow Manager (Classic) database will be used.

File

Salida derivada

NombreExplicaciónTipo de datos
updated_job_id

Returns the job_id parameter value.

Long

Muestra de código

CancelRemainingTasks example (stand-alone script)

The following stand-alone script demonstrates how to use the CancelRemainingTasks function in Python.

# Name: CancelRemainingTasks_sample.py
# Description: This script attempts to run a child job. If there is an exception
# and the child job fails to run a step, the Cancel Remaining Tasks tool is
# called to cancel the remaining tasks for parent job.

# Import System Modules
import arcpy

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


# Setting Local Variables
job_id = 15
workflow_database = r'C:\Data\Workflows\Testing.jtc'

#Connect to the workflow database
connection = arcpy.wmx.Connect(workflow_database)

#Get a Job for Execution
job = connection.getJob(job_id)

# Execute the job
try:

	result = job.executeStep()

#Raised when a step in the workflow encounters an execution error
except wmx.WorkflowExecutionStepError as e:
    print ("Step failed to execute, canceling remaining tasks.")

    # get the id of the parent job
    parent_id = job.parent

    # If an exeception happens, call the Cancel Remaining Tasks tool to cancel
    # all the remaining tasks for the parent job.
    arcpy.topographic.CancelRemainingTasks(parent_id, workflow_database)


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

Entornos

Esta herramienta no utiliza ningún entorno de geoprocesamiento.

Información de licenciamiento

  • Basic: No
  • Standard: Requiere Production Mapping and Workflow Manager
  • Advanced: Requiere Production Mapping and Workflow Manager

Temas relacionados