Bosch IoT Insights

Creating a conditional action

Prerequisites

You are assigned to the Power User role or higher.

Proceed as follows

  1. Click the Add Conditional Action button.
    → The configuration page is displayed.

    images/confluence/download/attachments/1624716888/services_conditional_action_create_2021_03_22.png
  2. In the General Information pane, enter a name for the conditional action in the Name field.

  3. Use the Active checkbox to specify whether the conditional action is active or inactive.

  4. In the Description field, enter a description for the conditional action.

  5. In the Retention Time of resulting Log Entries in days field, define the time in days of how long the log entries remain in the conditional actions log.

  6. Activate the Discard payload in activity log (only if action was successful) checkbox to remove the payload in the activity log if the action was successful.

  7. In the Actions pane, activate one or more checkboxes of the actions that shall be executed with the conditional action.

    • REST-Request
      A REST request action can address all available URIs. Depending on the environment onto which you have booked your service instance of Bosch IoT Insights, there can be whitelabeling, proxy, and firewall restrictions.

      images/confluence/download/attachments/1624716888/services_conditional_action_rest_request_2021_03_22.png


      1. In the Resource pane, select an HTTP method in the HTTP-Method drop-down list.

      2. In the Resource Uri field, enter the URI.

      3. In the Headers pane, click the Add Authentication button and enter a username and password to create a basic authentication header.

      4. If you want to add another authentication or header information, click the Add Header button in the Headers pane and enter the header name and a value.

        Steps c and d depend on which header information your target system needs.

      5. In the Body pane, define the HTTP body.

        • Raw Data: Create a Freemarker template that modifies the processed data document in a defined manner, refer to Freemarker Language Reference.

        • Form Data: Follows the HTTP Standard structure which provides key-value pairs.

        • Document: Sends the matched document to the HTTP endpoint.

      6. In the Number field of the Retry Count pane, specify the number of retries the REST request will be repeated until a success HTTP status is responded.

      7. Click the Test button to test the action.

    • E-Mail
      If the conditional action is triggered, an e-mail will be sent to notify the listed users.

      images/confluence/download/attachments/1624716888/services_conditional_action_email_2021_07_01.png


      1. In the Email Recipient field, enter the e-mail address of the user you want to notify.

      2. To add another recipient, press Enter and enter the email address.

        To remove a user from the list, click the x at the end of the email address.

      3. In the Subject field in the Subject pane, enter text that will be displayed in the subject line.

      4. In the Message field, enter the message to be sent.

        You can also provide a placeholder that then shows the value for which the conditional action was triggered. The placeholder expressions are surrounded by ${}. E.g.: ${payload.prop1}.

      5. Click the Test button to test the action.

    • SMS
      If the conditional action is triggered, an SMS will be sent to notify the listed users.

      images/confluence/download/attachments/1624716888/services_conditional_action_sms_2021_07_01.png
      1. In the SMS Recipient field of the SMS pane, enter the phone number of the user you want to notify.

        The format should be as follows: +49 711 564656767

      2. To add another recipient, press Enter and enter the phone number.

        To remove a user from the list, click the x at the end of the phone number.

      3. In the Message field, enter the message to be sent.

      4. Click the Test button to test the action.

    • Tagging / Labeling
      If the conditional action is triggered, a tag or label will be added to the document.

      images/confluence/download/attachments/1624716888/services_conditional_action_tagging_labeling_2021_03_22.png


      1. In the Key and Value fields, enter a key-value pair.

      2. Click the Add Tag / Label button to add another row.

  8. In the Condition pane, define the condition of the conditional action.

    1. In the Choose a condition type drop-down list, select ProcessedData.

    2. In the Collection drop-down list, select the collection.

    3. In the code block below, enter the condition.

      Conditions are defined as MongoDB Find Query.