Run Prints from VertiGIS Studio Workflows
VertiGIS Studio Workflow is a licensed product. You can find out about licensing here.
VertiGIS Studio Workflow has a Run Print activity that allows you to run VertiGIS Studio print templates from workflows. This allows you to integrate print creation with the other business processes that you automate using Workflow.
The Run Print activity takes the URL of the print template's ArcGIS item as input. When the Run Print activity executes, it passes the URL to VertiGIS Studio Printing to generate the print. The output of the Run Print activity, href
, is the URL of the generated print. To allow the user to download the print, you use the href
output to display a hyperlink that points to the print.
The Run Print activity has three additional inputs that you can use to configure the print—Extent, Scale and Parameters. The Parameters input is used to pass other types of values to the print template.
When you configure a workflow to run a print template, the print template does not need to be hosted by an application. Instead, the workflow is hosted and the workflow controls when the print template runs.
Main Steps to Run a Print from a Workflow
-
In the Print Template: If you want the print template to take inputs, configure print parameters.
-
In the Workflow:
- Add a Run Print activity to the workflow and configure it to run the desired print template, with the desired parameters.
- Add a Display Form activity to the workflow and configure it to display a link to the generated print.
-
In a Host Application: Configure the application to host the workflow.
See Run Workflows in ArcGIS Web AppBuilder or Run Workflows in the Geocortex Viewer for HTML5.
Pass Values from a Workflow to a Print Template
If you want to pass values from a workflow to a print template that is run using a Run Print activity, you must configure the workflow to pass the values to the print template, and configure the print template to receive the values. The way that you configure the workflow and print template depends on the types of values you want to pass:
-
Title: To pass a title from a workflow to a print template:
-
In the Print Template: Configure a print parameter called Title. This parameter is automatically included in a print template created using one of the pre-created templates.
Configuring a print template to take inputs from a workflow is exactly the same as configuring the print template to take inputs from host applications. This follows from the fact that you can run any print template from any supported type of host application and from workflows, without modifying the print template.
-
In the Workflow: Specify the values in the Run Print activity's Parameters input, as described in Configure a Workflow to Run a Print Template.
-
-
Notes: To pass notes from a workflow to a print template:
-
In the Print Template: Configure a print parameter called Notes. This parameter is automatically included in a print template created using one of the pre-created templates.
-
In the Workflow: Specify the values in the Run Print activity's Parameters input, as described in Configure a Workflow to Run a Print Template.
-
-
Other Values: To pass other types of values from a workflow to a print template:
-
In the Print Template: Configure a print template parameter for each value that is passed to the print template. For instructions, see Configure a Print Template to Take Other Values from a Workflow.
-
In the Workflow: Specify the values in the Run Print activity's Parameters input, as described in Configure a Workflow to Run a Print Template.
-
Configure a Print Template to Take Other Values from a Workflow
To configure a print template to take other values as inputs:
This procedure assumes that you have already created the print template.
See Configure a Print Template to Take Text Inputs from the User for instructions on how to configure parameters in your print template.
Configure a Workflow to Run a Print Template
To configure a workflow to run a print template:
Step 1: Add a Run Print activity to the workflow
-
In Workflow Designer, open the workflow that you want to run the print template.
-
Drag a Run Print activity to the desired location in the flowchart and connect it.
-
Url: Configure the Run Print activity's Url input:
-
In Print Designer, open the print template that you want to run.
-
Click Info to open the Info panel.
-
Copy the URL for the template's ArcGIS item.
-
In Workflow Designer, select the Run Print activity on the design surface to show the activity's properties.
-
Paste the URL into the Url box.
-
-
Extent: This property is optional. If you want, you can specify an extent you wish to use in your print.
-
Scale: This property is optional. If you want, you can specify the scale to zoom to with the map centered on the extent in the viewer or that provided in the Extent property.
-
Parameters: If the print template expects additional inputs to be passed to it, specify a collection of additional inputs in Parameters.
The way that you specify the collection depends on how the collection was created in the workflow. You can specify the collection using syntax similar to this:
={ parameter1: "string literal", parameter2: 123456, parameter3: $form1.state.textBox1.value, parameter4: $distance1.distance }
The names of the parameters that you specify in the Parameters input must match the names of the parameters configured in the template, including capitalization. For example, if the parameters are called RequestedBy, Maximum, and PrintTitle, then you could set the Parameters input to
={ RequestedBy: "Admin", Maximum: 20, PrintTitle: $form1.state.textBox1.value }
.
Step 2: Add a Display Form activity to the workflow
-
In Workflow Designer, drag a Display Form activity to the flowchart and connect it.
-
Double-click the Display Form activity to edit it.
-
Select Form Title in the form preview to show the Header element's properties and type a Title for the form.
-
Add a Text element to the form.
-
Expand the Text element's Events and add a load event.
The load subworkflow opens.
-
Drag a Set Form Element Property activity to the design surface and connect it.
-
Select the Set Form Element Property activity on the design surface.
-
Set the Property Name input to:
description
-
Set the Property Value input to:
=`[Open Print](${$runPrint1.href})`
If the Run Print activity's ID is not
runPrint1
in your workflow, replacerunPrint1
in the expression with the actual ID.The Property Value defines an Open Print hyperlink that points to the print. Here's how:
-
The equals sign (
=
) at the beginning means that this is an expression. -
The expression uses Markdown to create the hyperlink. Markdown notation for hyperlinks is
[Link Text](URL)
. In this case, the Link Text isOpen Print
and the URL is the output of the Run Print activity,$runPrint1.href
. -
The backticks (
``
) mean that the expression is represented as a template literal . Template literals combine string literals with run-time values, like activity outputs. The notation for activity outputs in template literals is${activity_output}
. In this case, the activity output is$runPrint1.href
, so it is represented as${$runPrint1.href}
.
-
-
Either leave the Markdown input blank or set it to
true
.The Markdown input indicates whether Markdown has been used in the Property Value input. In this case, Markdown is used to create the hyperlink, so the Markdown input must evaluate to
true
. The Markdown input istrue
by default.
Step 3: Test the workflow
-
Press Ctrl+S to save the workflow.
-
Run the workflow in the Sandbox.
To run a workflow in the Sandbox, click Info in the sidebar, click Run in Sandbox, select the environment, and then click Run Workflow. You can press F12 at any time to see the verbose log.
The Run Print activity will generate the print and the Display Form activity will display the link that the user clicks to open the print.
-
If you haven't yet configured a host application to host the workflow, follow the instructions for the desired host application: Run Workflows in ArcGIS Web AppBuilder or Run Workflows in the Geocortex Viewer for HTML5.
-
Run the workflow in the host application.