目前还没有官方翻译。

[en] To learn more about triggers in general, see section Understanding Triggers.

[en] Cloud trigger allows you to integrate your on-premise Control Center with existing business systems that run in private clouds or in dedicated data centers. If an existing business system (e.g., SAP S/4HANA or Oracle NetSuite) produces an output, a cloud-hosted API enables you to send HTTP requests to the cloud trigger.

[en] The cloud trigger allows you to locally print labels whose content originates from the cloud information systems. Because the cloud trigger that runs on the local Automation server uses standard methods for accessing the cloud-based services, you can deploy local printing in a secure and time efficient way.

[en] The cloud trigger enables a secure and transparent way to integrate your local label printing using applications that communicate over the open Internet.

[en] Compared to the HTTP server trigger, the cloud trigger does not require you to open any inbound ports on your firewall. The cloud trigger uses a dedicated NiceLabel API that runs in the cloud. This is why the trigger only requires open outbound port 443, or ports 9350-9354. In most cases, these ports are already open.

[en] Deploying Cloud Trigger with your on-premise Control Center

[en] Configuring cloud trigger in Automation Builder

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

[en] 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.

注意

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

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

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

  2. [en] Set the trigger Communication settings:

    • [en] 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.

      [en] 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:

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

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

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

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

      [en] 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).

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

      [en] HTTP Response Code

      [en] Description

      200

      [en] All actions executed successfully.

      400

      [en] No configuration available.

      500

      [en] There were errors during action execution.

      注意

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

    • [en] 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.

      注意

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

    • [en] 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).

      [en] 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.

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

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

      提示

      [en] 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.

[en] Other tab

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

  • [en] 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.

[en] 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.

  • [en] 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.

    例 26. 示例

    [en] 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.


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

    • [en] specified in the command file (using the SET command)

    • [en] not defined on the label

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

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

[en] Options in Scripting section specify scripting possibilities.

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

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

  • [en] 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.

  • [en] 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.

    注意

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

    注意

    [en] 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.

[en] Security tab
  • [en] 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.

[en] Starting trigger

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

注意

[en] 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 NiceLabel Cloud automatically distributes the traffic load among them.

[en] Setting up Cloud Trigger Access for the External integrator

注意

[en] To set up the integrator's access to the cloud trigger, you must have the Manage cloud integration privilege on the cloud Control Center. See the Control Center user guide for details about managing the user privileges.

  1. [en] Go to Integrations > Cloud Integrations .

  2. [en] Click +Add. This opens the Add New Integrator Access page.

  3. [en] Type the Name of the integrator you are currently adding.

    UUID-48984233-2f5c-3b15-04d2-a284439f7360.png
  4. [en] Copy the Key.

  5. [en] Click Save.

注意

[en] For more details, read the Cloud Triggers section of your Control Center user guide.

[en] Calling the cloud trigger (On-premise deployment)

[en] 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.

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

[en] https://<YourServerName>/epm/api/trigger/<MyCloudTriggerID>

注意

[en] 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.

[en] 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.

[en] All calls must include the header named Integrator-Key.

注意

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

例 27. 示例

[en] Integrator-Key: 9d59d7d444da412b8acfb488a01bb632