ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS for Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

WorkflowExecutionStepError

  • Résumé
  • Discussion
  • Exemple de code

Résumé

The WorkflowExecutionStepError exception is raised when a workflow step encounters an execution error.

Discussion

The WorkflowExecutionStepError exception is raised if the workflow step cannot be executed. For example, trying to execute an unsupported step such as DefineAOI, EditExtendedProperties, LaunchArcMap, LaunchGP, OpenMap, and SelectDataWorkspace will raise the error.

Exemple de code

The WorkflowExecutionStepError exception is used below to handle any errors that result from trying to execute a step in the workflow.

import arcpy, sys, traceback

#Define the callback response function. In this case it will prompt the user using the console to respond.
def callback(question, responses):

    # Print out the expected responses
    for resp in responses:
        print "[%i] %s" + (resp[1], resp[0])
		
    # Prompt the user to respond
    val = int(input("%s - %s: " % (question[1], question[0])))
	
    # Return their response. Currently only returning the value, but could also return a note (for questions) and the name of the response
    return (val, "", "")

#Establish a connection to a Workflow database
conn = arcpy.wmx.Connect(r'c:\test\Workflow.jtc')

#Get a Job for Execution
job = conn.getJob(77601)

try:
	#Execute the current Step in the Job - a LaunchArcmap step without Proceed to Next enabled
	result = job.executeStep(callback=callback)
	
	#A LaunchArcmap step will not finish automatically it will be complete after the user indicates it is.
    if not(result.finished): 
        t = input("Please press any key and hit enter when finished step") 
		
		#Finish the step and Mark as Complete
        result.finishStep(callback=callback) 
        job.markStepAsComplete(callback=callback)
    
	#Run the next step in the workflow
        result = job.executeStep(callback=callback) 
	
    print "Executing a 2nd step returned %i" + result.returnCode
    
	#Mark the step as complete
	job.markStepAsComplete(callback=callback) 
	
except wmx.WorkflowExecutionStepError as e:
    print "Step failed to execute:"
    print "-"*60
    traceback.print_exc()

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog des initiés
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Confidentialité | Légal