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 Geocortex print templates from workflows. This allows you to integrate print creation with the other business processes that you automate using VertiGIS Studio 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

  1. In the Print Template: If you want the print template to take inputs, configure print parameters.

    See Pass Values from a Workflow to a Print Template.

  2. In the Workflow:

    1. Add a Run Print activity to the workflow and configure it to run the desired print template, with the desired parameters.
    2. Add a Display Form activity to the workflow and configure it to display a link to the generated print.

    See Configure a Workflow to Run a Print Template.

  3. 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:

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

  1. In Workflow Designer, open the workflow that you want to run the print template.

  2. Drag a Run Print activity to the desired location in the flowchart and connect it.

  3. Url: Configure the Run Print activity's Url input:

    1. In Print Designer, open the print template that you want to run.

    2. Click Info to open the Info panel.

    3. Copy the URL for the template's ArcGIS item.

    4. In Workflow Designer, select the Run Print activity on the design surface to show the activity's properties.

    5. Paste the URL into the Url box.

  4. Extent: This property is optional. If you want, you can specify an extent you wish to use in your print.

  5. 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.

  6. 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

  1. In Workflow Designer, drag a Display Form activity to the flowchart and connect it.

  2. Double-click the Display Form activity to edit it.

  3. Select Form Title in the form preview to show the Header element's properties and type a Title for the form.

  4. Add a Text element to the form.

  5. Expand the Text element's Events and add a load event.

    The load subworkflow opens.

  6. Drag a Set Form Element Property activity to the design surface and connect it.

  7. Select the Set Form Element Property activity on the design surface.

  8. Set the Property Name input to: description

  9. Set the Property Value input to: =`[Open Print](${$runPrint1.href})`

    If the Run Print activity's ID is not runPrint1 in your workflow, replace runPrint1 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 is Open 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}.

  10. 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 is true by default.

Step 3: Test the workflow

  1. Press Ctrl+S to save the workflow.

  2. 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.

  3. 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.

  4. Run the workflow in the host application.