Publish Workflow Service (Workflow Manager)

Summary

Uploads and shares a workflow service and a map service of job locations for an ArcGIS Workflow Manager (Classic) repository.

Usage

  • This tool saves draft service definitions to the Output Service Draft Location parameter value for each service.

  • The Input Database Path (.jtc) parameter uses the workflow connection in your ArcGIS Pro project if a workflow connection file (.jtc) is not defined.

  • ArcGIS Server and the ArcGIS Workflow Manager (Classic) Server extension are required.

Parameters

LabelExplanationData Type
Service Name

The name of the workflow service that will be uploaded and shared.

String
AOI Service Name

The name of the map service that will be uploaded and shared.

String
Server

The ArcGIS Server connection file (.ags) that contains the information needed to connect to ArcGIS Server or the URL to the ArcGIS Enterprise portal federated server.

ServerConnection
Output Service Draft Location

The folder where service definitions will be saved.

Folder
Input Database Path (.jtc)
(Optional)

The workflow connection file (.jtc) that contains the information needed to connect to the Workflow Manager (Classic) repository.

The workflow connection in your ArcGIS Pro project will be used if a workflow connection file is not defined.

File
Server Folder
(Optional)

The folder to which the services will be published on ArcGIS Server.

If a folder is not specified, the services will be published to the root folder of ArcGIS Server.

String
Description
(Optional)

A description of the services that will be published.

String

Derived Output

LabelExplanationData Type
Output Workflow Service Path (*.sddraft)

The path to the workflow service definition draft.

File
Output Map Service Path (*.sddraft)

The path to the map service definition draft.

File

arcpy.wmx.PublishWorkflowService(service_name, aoi_service_name, server, out_service_draft_location, {input_database_path}, {server_folder}, {description})
NameExplanationData Type
service_name

The name of the workflow service that will be uploaded and shared.

String
aoi_service_name

The name of the map service that will be uploaded and shared.

String
server

The ArcGIS Server connection file (.ags) that contains the information needed to connect to ArcGIS Server or the URL to the ArcGIS Enterprise portal federated server.

ServerConnection
out_service_draft_location

The folder where service definitions will be saved.

Folder
input_database_path
(Optional)

The workflow connection file (.jtc) that contains the information needed to connect to the Workflow Manager (Classic) repository.

The workflow connection in your ArcGIS Pro project will be used if a workflow connection file is not defined.

File
server_folder
(Optional)

The folder to which the services will be published on ArcGIS Server.

If a folder is not specified, the services will be published to the root folder of ArcGIS Server.

String
description
(Optional)

A description of the services that will be published.

String

Derived Output

NameExplanationData Type
output_workflow_service_draft_path

The path to the workflow service definition draft.

File
output_map_service_draft_path

The path to the map service definition draft.

File

Code sample

PublishWorkflowService example (stand-alone script)

The following stand-alone script demonstrates how to use the PublishWorkflowService tool to upload and share a workflow service and map service of job locations for an ArcGIS Workflow Manager (Classic) repository.

# Name: PublishWorkflowService_sample.py
# Description: The following script Uploads and shares a workflow service and a map 
#  service of job locations for an ArcGIS Workflow Manager (Classic) repository using a 
#  connection to an ArcGIS Server with the Workflow Manager (Classic) Server extension.

# Import system modules
import arcpy

# Check out extensions
arcpy.CheckOutExtension('jtx')

# Set local variables
service_name = 'Example Workflow Service'
aoi_service_name = 'Example Map Service'
server = 'myServerConnection.ags'
out_service_draft_location = r'C:\Project\DraftOutput'
input_database_path = r'C:\Project\wmxrepository.jtc'
server_folder = 'My Folder'
description = 'My Description'

# Call the PublishWorkflowService tool to upload and share a workflow service and a 
#  map service of job locations for the specified Workflow Manager (Classic) repository.
arcpy.wmx.PublishWorkflowService(service_name, aoi_service_name, server,\
                                 out_service_draft_location, input_database_path,\
                                 server_folder, description)

# Get all messages, warnings, and errors and print the results
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('jtx')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Requires Workflow Manager
  • Advanced: Requires Workflow Manager

Related topics