Workflow Manager custom steps
Cette rubrique s'applique uniquement à ArcGIS for Desktop Standard et ArcGIS for Desktop Advanced.
ArcGIS Workflow Manager pour Desktop provides several custom steps. The source code for each of these are provided as part of the developer kit. The following table outlines the process steps and what they can do.
Steps library
The Steps library contains steps that can be executed in both the desktop and server environments. The steps and their arguments and return codes are outlined below.
- Check AOI:JTXSteps.CheckAOIReturn codes:
Checks to see if an Area of Interest (AOI) exists for the current job.
- 1 = If job has an AOI
- 2 = If job does not have an AOI
- CleanUp: JTXSteps.CleanUpReturn codes:
Cleans up the job, based on the arguments.
Enable the Administration - System Settings to allow users delete versions owned by other users. This will prompt for a user name and password.
Remarque :When deleting a version owned by a different user, you must specify the SDE user's credentials.
Version Cleanup: /version|v (optional) MXD Cleanup: /mxd|m (optional) Attachment Cleanup: /attachments|a (optional)
- 0 = Success
- CloseJob:JTXSteps.CloseJobReturn codes:
Closes a job as a step, as opposed to it being a manual process once the workflow is completed.
No Argument
- 0 = Success
- CreateJob:JTXSteps.CreateJobReturn codes:
Creates a child job, based on the arguments.
Job Type ID: Job Type Name: /jobtypename:<job type name> (required) Assign to Group: /assigngroup:<group to assign to> (optional) Assign to User: /assignuser:<user to assign to> (optional) Job Type ID: /jobtypeid:<job type ID> (deprecated)
- 0 = Success
- CreatePDFJTXSteps.CreatePDFReturn codes:
Creates a PDF document of the job's basemap and attaches it to the job.
Initial Directory: /initdir:<initial directory> (optional) Do not Attach File To Job: /noattach (optional) Resolution (dpi): /resolution:<dpi> (optional) Attach File To Job: /attach (deprecated)
- 0 = Success
- CreateVersionJTXSteps.CreateVersionReturn codes:
Creates the version for the job. The protection level of the version is specified by one of the following arguments: Version Access Scope:
/scope
- 0 = Success
- ExecuteGPToolJTXSteps.ExecuteGPToolReturn codes:
Executes a GP tool without displaying the GP dialog box.
Toolbox Path (explicit full path to the tbx file combined with toolbox name): /toolboxpath:<toolboxpath> (required) Display Name of the Tool in the toolbox: /tool:<tool> (required) Parameter to override on the tool (can be specified multiple times): /param:<ParamName>:<ParamValue> (optional) Flag to attach the log to the job once the tool has completed: /attach:(optional)
- 0 = Success
- 1 = Failure
- ExecuteSQLJTXSteps.ExecuteSQLReturn codes:
Executes a SQL statement.
Database to Send SQL: /database:<jtxsystem|data> (required)SQL Command: /sql:<sql command>
- 0 = Success
- ExecuteURLJTXSteps.ExecuteURL
Executes a URL without displaying a browser to show the response.
For example, you can execute a geoprocessing service or any other web service as a workflow step.
URL to execute: /url:<url> (required) Request Timeout: /timeout:<timeout in seconds> (optional) Proxy Server: /proxy:<proxy> (optional) Flag to add a comment to the job with the response: /addjobcomment(optional) Post Data: /postdata:<data to post> (optional)
- ExecuteWorkflowJTXSteps.ExecuteWorkflowReturn codes:
Executes another workflow associated with a job type.
Job Type Name: /jobtype:<job type name> (required)Flag to not use AOI: /donotuseaoi (optional)Flag to not use version: /donotuseversion (optional)Flag to not copy activities to the parent job's history: /donotcopyactivities (optional)
- 0 = Success
- ReturnValueJTXSteps.ReturnValue
Retrieves the value of the extended property or token passed that is the return code for the next path in the workflow.
Return value: /value:<Extended properties field> (required):
- ReassignJobJTXSeteps.ReassignJobReturn codes:
Reassigns the job.
Assign Type: /assignType:<user|group> (required) Assign To: /assignTo:<user or group name> (required)
- 0 = Success
- SendNotificationJTXSteps.SendNotificationReturn codes:
Sends a notification of the type specified by the first arguments; notification type.
/notifType:<type> (required)
- 0 = Success
- SetVersionJTXSteps.SetVersionReturn codes:
Set the job's version to a named version, for example, QC version to validate edits that were posted and a QC version. If there is no step argument, the job version will be reset to the original version.
Version to use as job version: /version:<versionName> (optional)
- 0 = Success
- UpdateExtentFeatureClassJTXSteps.UpdateExtentFeatureClassReturn codes:
Update a feature class with job information to provide visual status.
Feature Class to Update (must be in data geodatabase): /fclass:<fully qualified feature class name> (required) Job ID Field (field to put job ID in): /jobfield:<field name> (optional) Date Field (field to put date/time): /datefield:<field name> (optional)
- 0 = Success
- VersionExistsJTXSteps.VersionExistsReturn codes:
Checks to see if the job already has a geodatabase version.
No Argument
- 1 = Version Exists
- 2 = Version Doesn't Exist
- 3 = No data workspace selected
DesktopSteps library
The DesktopSteps library contains steps that can be executed only from the desktop because of the pop-up user interfaces. The steps and their arguments and return codes are outlined below.
- CopyFileJTXDesktopSteps.CopyFileReturn codes:
Copies a file from one location to another.
Source File: /src:<source file path> (optional) Destination File: /dest:<destination file path> (optional) File Title: /title:<file title> (optional)
- 0 = Success
- CreatJobAdvancedJTXDesktopSteps.CreateJobAdvancedReturn codes:
Creates a job and allows you to define parent/child relationship with dependencies on the job.
Job Type Name: /jobtypename:<job type name>(required) Assign To Group: /assigngroup:<group to assign to>(optional) Assign To User: /assignuser:<username to assign to> (optional) Dependency will be created and current job held at this step: /dependThisStep (optional) Dependency will be created and current job held at the next step in the workflow: /dependNextStep (optional) Dependency status (current job held until new job reaches this status): /dependStatus:<Status Type Name> (optional) Use the current job's AOI as the new job's AOI: /useparentaoi (optional) Create new jobs based on the overlap between the current job's AOI and this feature class: /aoiOverlapFeatureClassName:<fully qualified feature class name >(optional) Default number of jobs to create: /numberJobs:<number of jobs to create> (optional) A version will be created for the new job(s) based on this selection: /createVersionSetting:<the version to use as the parent version> (optional) A version will be assigned to the new job(s) based on this selection: /assignVersionSetting:<the existing version the job will be assigned to>(optional) New job(s) extended properties value will be set to: one of the current job's extended properties values (specified by JTX Token) or to the given string value: /setExtendedProps: <ChildJobFullyQualifiedExtendedPropertiesTableName.FieldName= [JOBEX:ParentJobFullyQualifiedExtendedPropertiesTableName.FieldName]> (optional) Due date of the new job: /dueDate:<due date of the new job>(optional) Job duration: /jobDuration:<duration of the new job >(optional) New Job will be created as a child of the existing job: /child:(optional)
- 0 = Success
- 1 = Failure
- DefineAOIJTXDesktopSteps.DefineAOIReturn codes:
Shows a tool to allow the user to define an area of interest.
No Argument
- 1 = Success
- 0 = Failure
- EditExtendedPropertiesJTXDesktopSteps.EditExtendedProperties
Display the job's extended properties as a pop-up form to allow the user to enter the required properties.
No Argument
- LaunchArcMapJTXDesktopSteps.LaunchArcMapReturn codes:
When executed, ArcMap will launch. The layers will be resourced to the job version and the map will be zoomed to the job's AOI and click the Add Data button for the user to allow adding additional data to the map. Please see the section below for details regarding the arguments for this step.
- 0 = Success
- LaunchGPToolJTXDesktopSteps.LaunchGPToolReturn codes:
Executes geoprocessing tools from within your workflows.
Toolbox Path (explicit path to the tbx file): /toolboxpath:<toolboxpath> (optional) Toolbox Name (if in system toolboxes): /toolbox:<toolbox> (optional) Display Name of the Tool in the toolbox: /tool:<tool> Parameter to override on the tool (can be specified multiple times): /param:<ParamName>:<ParamValue> (optional) Flag to attach the log to the job once the tool has completed: /attach (optional) License enumeration code for any additional license that should be used in the execution of the tool: /license:<enum value> (optional)
- 1 = Success
- SelectDataWorkspaceJTXDesktopSteps.SelectDataWorkspaceReturn codes:
Shows a form that allows you to pick the data workspace for your job from a list of already configured data workspace.
No Argument
- 0 = Success
The Launch ArcMap Step
The expected behavior of the Launch ArcMap step with no arguments is detailed in the following table.
Job type map document defined? |
Launch ArcMap with data workspace and version |
Launch ArcMap with data workspace and no version |
Launch ArcMap with no data workspace |
---|---|---|---|
Yes |
ArcMap is launched using the map document defined. Layers are resourced to the job's version based on the Feature Class's short name. The map is zoomed to the Area of Interest. Remarque : The short name is the feature class name not fully qualified: Streets instead of NIS.Streets, for example. Also note that no matter how the basemap was originally defined, any short name matches should be resourced. |
This works the same as the scenario when a version exists, except the default version for the data workspace is used for the resourcing of layers. |
No changes are made to the layer sources. The map is zoomed to AOI. |
No |
ArcMap opens with a blank document. In this case, since no map exists, there are no layers to resource. Once layers are added to the map, the Add Data button on the Workflow Manager toolbar will take the user directly to the version defined for the job or the default version for the Data Workspace selected. |
This works the same as the scenario when a version exists. |
ArcMap opens with a blank document. The Add Data button on the Workflow Manager toolbar is disabled. If an AOI exists for the job, the Zoom To AOI tool can be used. |
Argument Descriptions
The Launch ArcMap step has many optional parameters available, allowing you to customize its execution for your needs without writing code.
Descriptive name |
Argument example |
Behavior |
---|---|---|
Zoom to AOI |
or
|
With the default behavior, the map will be panned to the job's AOI and zoomed by a factor of 1 to the shape's geometry. Optionally, you can choose to not pan or zoom the map using the /nozoomaoi option. Or you can zoom to the AOI with a greater zoom factor using the /aoifactor: argument. |
Repoint MXD |
|
The default behavior, when /norepoint is not used, changes all the layers in the map to the current data workspace and optionally, the job's version. |
Change Only MXD Versions |
|
If you choose to use the /changeversiononly option, then the version of the layers in the job type's map document will be changed. The data user and connection information will be left as they were originally configured. |
Preserve basemap layer versions |
|
The default behavior, when the /nochangebasemaplayerversion argument is not used, preserves the connection information for layers in a basemap layer. For example, you can add layers from a database that you want to use as reference layers in your map. By default, when the launch ArcMap step is executed, these layers will get repointed to the current job's version. By checking this argument, it will not repoint the data source for layers in this group. Since basemap layers are relatively static and do not change frequently, their display can be computed once and reused many times. See Working with basemap layers for more information. |
Save MXDs |
|
The default behavior, when the /nosavemxd argument is not used, will save the job's map document in the Workflow Manager database. If your map documents are large, you may need to adjust the MAXBLOBSIZE SDE configuration setting. If you choose to use the /nosavemxd option, then the job's map document will not be saved. This option also allows you to switch jobs in ArcMap without clearing out the map document. |
Clip Data Frame to AOI |
|
The default behavior, when the /cliptoaoi argument is not used, will show all the data in the map document that can be viewed. When the /cliptoaoi option is used, the data frame in the job's map document will be clipped to the shape of the AOI. Remarque : This does not create a definition query on the layers. All features in the layers in the map are still accessible through their respective tables. |
Wait for ArcMap to close (suspend Workflow Manager) |
|
The default Workflow Manager application behavior, when the /nowait argument is not used, is to hide while the ArcMap process is running. This means that the user cannot interact with the Workflow Manager application while working in ArcMap. When the /nowait option is used, ArcMap will be launched in a separate process, allowing the user to interact with the Workflow Manager application while ArcMap is running. Remarque : This option was added because the Launch process asynchronously option for workflow steps is not available for Custom Step Objects. |
Use existing ArcMap Session |
|
The default behavior, when the /useexisting argument is not configured, is to open a new ArcMap session during the execution of the step. With the /useexisting option, if an ArcMap session is open when the step is executed, Workflow Manager will open the job's map document in that existing session. If there is not an ArcMap session open, then Workflow Manager will open a new one. |
Store MXDs in shared location |
|
With the default behavior, no alternative location is configured, and the job's map documents will be stored in the Workflow Manager database. If your map documents are large, you may need to adjust the MAXBLOBSIZE SDE configuration setting. If you choose to store the map documents in an alternative location, Workflow Manager will not save the map documents in the database, but will save them to that location for future use. |
Use Alternative MXD |
|
With the default behavior, the step will use the job type's default map document as the basemap document to use when Launch ArcMap. If you choose to use this option, Workflow Manager will load the map document or template configured for the argument. |
Run ArcMap Command |
|
Once ArcMap has finished loading, the button represented by the ProgID entered will be programmatically pushed. |
Load Task Assistant workflow |
|
With this argument configured, once ArcMap is opened, Workflow Manager will open the task assistant workflow configured. The workflow name passed in is the alias of the TAM workflow stored in the Workflow Manager system. Multiple workflows can be passed in by adding additional /taworkflow: entries or by selecting the desired workflows in the argument editor. |
Store Task Assistant History in Job History |
|
With this argument configured, the task assistant workflow will be added to the job history by default. You can still choose to attach this as a text file using Workflow Manager tools. |