Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleUnderstanding the pipeline

For the example to work, the pipeline triggered by the Task should lead to an error. We shall route the error output to an error view. We shall then use the error view to manipulate the Status header of the error document. Once this is done, the parent Task sends the updated error output back to ServiceNow, and we should see the updated status code in the ServiceNow Administration interface.

We need to perform the following tasks:

  1. Create a pipeline that accepts CSV data, generates an error, and manipulates the error data to update the status code.

  2. Create a Triggered Task that can trigger the Pipeline created in Step 1.

  3. Configure ServiceNow to send and receive CSV data from the Triggered Task created in Step 2.

Let us look at each of these tasks in some detail:

Create a pipeline to accept CSV and manipulate error document data

This Pipeline is structured as shown in the screenshot above. Let us now look at its constituents:

Snap Name

Snap Type

Task Description

Settings (Click to expand screenshot)

Parse Data

CSV Parser

Parses streaming data from the parent Triggered Task.

Enter Faulty Mappings

Mapper

Creates problematic mappings to trigger an error in the downstream Snap.

Image RemovedImage Added

Change Status Codes

Mapper

Manipulates (or changes) the status code in the input document containing the error view from the Enter Faulty Mappings (Mapper) Snap.

In this example, we choose to update the status code to 603.

Update Headers

CSV Formatter

Adds the updated status code into the binary header of the output CSV document to be sent to ServiceNow.

Create a Triggered Task that sends CSV data into the TriggeredTask_CSVFormatter_Example Pipeline

To create a Triggered Task:

  1. Click the Create Task icon at the SnapLogic Designer toolbar. This displays the Create Task popup. Configure the Task as shown below:

    Your Task is now configured. You now need to configure your ServiceNow account to send CSV data to this Task.

Configure ServiceNow to send and receive CSV data from the Triggered Task

Note

This step can only work if you have a ServiceNow account.

To configure ServiceNow to send and receive CSV data from the Triggered Task created in Step 2:

  1. Log into your ServiceNow account and open the pane on the left of the page.

  2. Search for the string outbound in the Filter field displayed in the top-left section of the page. From the filtered list of options displayed, click REST Messages under the System Web Services section.


    This displays the REST Messages page.

  3. Click New to create a new REST message and configure the message as shown below:

  4. Click Submit to save your changes. This creates the REST call. You must now configure the call with the data you want to send. To do so, click the REST call. This displays the details of the REST call. 

  5. Scroll down to the HTTP Methods section and click the Default Get method created automatically for the call. This displays the call's details:

  6. You need to send a POST call to the Task so that you can provide the content that must be processed as a result of the call. To do so, click the HTTP Method field and, from the drop-down list displayed, select POST. Once you make this selection, the Content field appears at the bottom of the page. 

  7. Enter the content you want to use for the call:


  8. Click Test. This triggers the SnapLogic URL endpoint (This is the Task we created earlier in this example.) and displays the output of the Pipeline in the HTTP Status field: 603, as configured using the Mapper Snap, above.

You can similarly use the CSV Formatter Snap to update binary header values associated with any input document.

...