Deploying Cloud Trigger with your on-premise Control Center

This topic only applies toCloud Enterprisecustomers, who have theirLoftware Control Centerlocally installed.

Configuring cloud trigger in Automation Builder

This section describes how to configure the cloud trigger in Automation that runs on your local server.

Open your Automation Builder. Make sure the Automation Builder is paired with your Control Center. To check, go to File > Options >Control Centerand see if the URL address of your Control Center is there.

[Note] Note

"Paired" Automation Builder and Control Center also means that both applications use the same license key.

The Configuration Items tab opens. Click Cloud Trigger to create a new configuration for the cloud trigger.

General tab
  1. Set Name and Description to make your cloud trigger easy to find among other triggers.

  2. Set the trigger Communication settings:

    • Define the Unique identifier. After you deploy the trigger, this unique identifier registers the trigger on your Control Center. Use only alphanumeric characters. Special characters are not permitted.

      If you are running the cloud trigger configuration on multiple computers, you must make sure each computer automatically uses its own unique identifier. To prevent unwanted duplications, insert internal variables as part of the Unique identifier. You can use two internal variables for this purpose:

      • ComputerName: The name of the computer on which the configuration is running.

      • SystemUserName: The Windows user name of the currently logged-in user.

      To insert internal variables to the Unique identifier, click Insert data source and select your internal variables.

      UUID-7905238a-2b2d-69c4-9856-247bdcb0320c.png
    • Wait for trigger execution to finish: The HTTP protocol requires a receiver (in this case Loftware Automation) to send a numeric response back to the sender indicating the status of the received message. By default, Loftware Automation responds with code 200. This indicates Automation successfully received the data, but gives no information about the success of trigger actions.

      This option specifies that a trigger doesn't send a response immediately after receiving the data, but waits until all actions execute. Then, it sends the response code indicating a successful action execution. With this option enabled, you can send back a custom response type and data (e.g., the response to a HTTP request is label preview in PDF format).

      With cloud trigger, the relevant built-in Automation standard HTTP response codes are:

      HTTP Response Code

      Description

      200

      All actions executed successfully.

      400

      No configuration available.

      500

      There were errors during action execution.

      [Note] Note

      To send feedback to Automation about the print process, enable synchronous print mode. For more information, see section Synchronous Print Mode.

    • Response type: Specifies the type of your response message. Frequently used Internet media types (also known as MIME types, or Content-types) are predefined in the drop down box. If your media type is not available in the list, type it yourself. Automation sends the response data outbound as feedback, formatted in the defined media type. Variable enables variable media types. If enabled, select or create a variable that contains media type.

      [Note] Note

      If you don't specify the Content-Type, Loftware Automation uses application/octet-stream as a default.

    • Response data: Defines the content of your response message. Examples of what you can send back as an HTTP response are custom error messages, label previews, generated PDF files, print stream (spool) files, XML files with details from the print engine plus the label preview (encoded as a Base64 string).

      If your output consists of binary-only content (such as label preview or print stream), make sure you select a supported media type, e.g. image/jpeg or application/octet-stream.

    • Additional headers: Allow you to define custom MIME headers for the HTTP response message.

      Response header syntax and examples are available in the HTTP Request action section.

      [Tip] Tip

      With Response data and Additional headers, you can use fixed content, mix of fixed and variable content, or variable content alone. To insert variable content, click the button with an arrow to the right of the data area and insert your variable from the list. You can also create a new variable that contains the data you want to use. For more information, see section Using Compound Values.

Other tab

Options in the Feedback from the Print Engine section specify communication parameters that allow you to receive print engine feedback.

  • Supervised printing: Activates synchronous printing mode. Use it whenever you want to send the print job status back to the third party application. For more information, see section Synchronous Print Mode.

Options in the Data Processing section specify if you want to trim the data so that it fits into a variable, or ignore the missing label variables. By default, reports errors and breaks the printing process if you try to save values that are too long in label variables, or try to set values for non-existing label variables.

  • Ignore excessive variable contents: truncates data values that exceed the length of the variable as defined in the label designer to make them fit. This option is in effect if you are setting variable values in filters, from command files, and when you are setting values of trigger variables to label variables of the same name.

    Example 27. Example

    Label variable accepts 5 characters at maximum. With this option enabled, any value longer than 5 characters is truncated to the first 5 characters. If the value is 1234567 ignores digits 6 and 7.


  • Ignore missing label variables: When printing with command files (such as JOB file), the printing process ignores all variables that are:

    • specified in the command file (using the SET command)

    • not defined on the label

    Similar happens if you define assignment area in a filter to extract all name-value pairs, but your label contains fewer variables.

    When setting values of non-existing label variables, reports an error. If this option is enabled, the printing continues.

Options in Scripting section specify scripting possibilities.

  • Scripting language: Selects scripting language for the trigger. All Execute script actions that you use within a single trigger use the selected scripting language.

Options in the Save Received Data section specify the available commands for data that the trigger receives.

  • Save data received by the trigger to file: Enable this option to save the data received by the trigger. The option Variable enables variable file name. Select a variable that contains path and file name.

  • On error save data received by the trigger to file: Enable this option to save the data into the trigger only if an error occurs during the action execution. You might want to enable this option to keep the data that caused the issue ready for troubleshooting.

    [Note] Note

    Make sure you enable the Supervised printing support. If not, cannot detect errors during the execution. For more information, see section Synchronous Print Mode.

    [Note] Note

    saves the received data into a temporary file. This temporary file is deleted right after the trigger execution completes. The internal variable DataFileName points to that file name. For more information, see Internal Variables.

Security tab
  • Lock and encrypt trigger: Enables trigger protection. If you enable it, the trigger becomes locked and you cannot edit it any longer. This encrypts the actions. Only users with password can unlock the trigger and modify it.

Starting trigger

Deploy and start the trigger in Automation Manager. The cloud trigger now monitors for the incoming requests.

[Note] Note

If your configuration requires increased availability and scalability, you can deploy multiple identical cloud triggers. To do this, install multiple instances of Automation, and deploy the cloud triggers on them. If the deployed cloud triggers share the same Unique identifier, the built-in load balancer in Loftware Cloud automatically distributes the traffic load among them.

Calling the cloud trigger (On-premise deployment)

This step makes sure that the outputs of the external business systems successfully execute cloud triggers that run locally. This is the purpose of the CloudTrigger operation. In the URL of the call, specify the trigger name you are calling.

To call the trigger with your unique identifier MyCloudTrigger, call this URL:

https://<YourServerName>/epm/api/trigger/<MyCloudTriggerID>

[Note] Note

The URL might start with "http" or "https" – depending on how you set up your Control Center during the installation. See the Control Center installation guide, sections Setting up website and storage for details.

For each event (output) in the external business system, call the URL as shown in the example. Each call executes the cloud trigger that runs on the local Automation server.

All calls must include the header named Integrator-Key.

[Note] Note

You can get the Integrator Key in your Control Center. See the Cloud Integrations topic, "Setting up Developer Portal accounts" topic.

Example 28. Example

Integrator-Key: 9d59d7d444da412b8acfb488a01bb632