Skip to content

Action Rules: Empowering Business Automation in BizzStream Aero

Welcome to the exciting world of action rules in BizzStream Aero! These powerful rules provide an extensive range of automation options, enabling you to streamline your business processes effectively. Let's explore how you can add and configure action rules, the available rule types, and their capabilities.

How to Add and Configure Action Rules

To add an action rule to an action in your workflow, follow these simple steps:

  1. Open the desired action by double-clicking it in the workflow.
  2. If required, scroll down to access the Rules section.
  3. Click the Add Button button next to Rules.
  4. The rule configuration pane will open.
  5. Select the desired Type of action rule.
  6. Enter a readable Label for the action rule. This label will be displayed in the logs.
  7. Enter a Description for the action rule.
  8. Configure the properties of the selected rule type.
  9. Click Save to finalize the rule configuration.
  10. Finally, click Save in the action properties pane to apply the changes.

You can delete an action rule by clicking the Delete Button button, visible when you have an action rule.

For editing an existing action rule, simply click on the Right Chevron icon next to the rule you wish to modify.

Configure action rule

Execute Conditions

For each rule in an action you can configure conditions on whether it should be executed or not. There may be scenarios in which an additional script should be run, or a notification should be displayed to the user. You can configure these conditions using BizzStream Expressions in the Execute condition field.

Example

In an order process orders with a total value higher than € 5000,- a confirmation dialog should always be displayed to verify there are no errors in the order. For orders with a lower total value this rule does not have to be executed. In that case you can configure an Execute condition in the confirmation dialog rule that would look like this: F["totalValue"] > 5000.

Rule Properties and Available Action Rules

Save Document

This rule is instrumental in saving new documents or changes in a document to the database. Be mindful that changes made by other rules before the Save Document rule within the same user action may be overwritten. For instance, if a user action consists of a Set Field Value rule followed by a Save Document rule, the changes made by the Set Field Value rule will be overwritten during the Save Document rule's execution.

This rule does not have any additional properties to configure.

Delete Document

Use this rule to delete the current document from the database. However, keep in mind that only Show Notification, Go to URL, and Execute Script rules can be executed after a Delete Document rule. Other rules assume that the document still exists in the database.

This rule does not have any additional properties to configure.

Show Notification

The Show Notification rule is all about delivering information to users. It displays a notification with four possible types: Information (blue), Success (green), Warning (orange), and Error (red).

Field Required Purpose
Type Yes This determines whether the notification will be displayed as Information, Success, Warning, or Error.
Title Yes The title of the notification dialog. This field can contain BizzStream expressions. The notification title is only shown in the desktop interface.
Content Yes The text of the notification. This field can contain BizzStream expressions.

Send Push Notification

With the Send Push Notification rule, you can send push notifications to users' mobile devices. To receive a push notification, the user must be logged in on a mobile device with the BizzStream app installed.

Field Required Purpose
Content Yes The content of the push notification. This field can contain BizzStream expressions. A push notification may not exceed 256 characters.
Recipients (Access Groups) Yes The access groups to which the push notification will be sent. Members of the selected access groups will receive the notification.

Set Field Value

Use the Set Field Value rule to set the value of one or more fields in a document. Additionally, you can set the system field status if statuses have been defined in the document definition.

Note: The Set Field Value rule updates the document in the database immediately.

Field Required Purpose
Expression Yes A BizzStream expression to set values for one or more fields. Example: SETVALUES([F["field1"],"value1"],[F[“field2”],”value2”])
Recipients (Access Groups) Yes The access groups to which the push notification will be sent. Members of the selected access groups will receive the notification.

Execute Script

The Execute Script rule allows you to run a script written in the script editor. Scripts can use BizzStream expressions and document data. By default, scripts run synchronously, meaning that BizzStream will wait for the script to complete before executing the next rule in the action. A script's maximum execution time per document is 3 minutes. If the script exceeds this limit, it will end with an error 'Connection has timed out,' as indicated in the logs.

Asynchronous Execution

By enabling the Execute Asynchronously option, the script runs asynchronously. BizzStream won't wait for the result and will continue to execute the next rule in the user action. Asynchronous execution improves user performance, but there are some limitations to consider:

  • Notifications and Go to URL statements cannot be used.
  • Consecutive rules should not depend on the asynchronous script's outcome since the output might not be available when these rules execute.
  • The console output may not always appear in the logs, and the log may not always be marked "success" or "error." Instead, it can be "Script is executing asynchronously," which doesn't signify an error.
  • A notification may appear if the asynchronously executed script updates the document being edited by the user, asking to reload the document due to changes made by another user.

Note:

  • When the Execute Script rule is executed, a log is created, including the elapsed time field, indicating the total processing time of the script.
Field Required Purpose
Script Yes Select a script written in the script editor.
Execute Asynchronously No Determines whether the script should be executed asynchronously.

Render PDF

The Render PDF rule generates a PDF based on a template and displays it in a popup in a web browser. On mobile devices, the PDF is downloaded, allowing users to open it with a compatible app.

Field Required Purpose
Template Yes Determines which template to use for generating the PDF file.

Save PDF

With the Save PDF rule, you can generate a PDF based on a template and save it as an attachment header field.

Field Required Purpose
Template Yes Determines which template to use for generating the PDF file.
Save To Yes Determines which attachment field the PDF should be stored in.
Render Language Yes Stores the PDF in either the current user's language, English, or Dutch.
Operation Yes Determines whether existing attachments in the field should be overwritten by the newly created PDF or added as an additional file.

Note:

  • Attachment fields may have limitations in terms of the maximum number of files or file size they can contain, which may restrict the number of new files that can be appended.

REST Call

The REST Call rule enables you to make a REST call to an external system. When executed, BizzStream sends the document as it is stored in the database, including any changes made by other rules that haven't been saved with a Save Document rule.

When the Save Response option is enabled, BizzStream will attempt to update fields in the document with values from the response of the external system. Fields in the response that are also defined in the document definition will be assigned the response's values. Fields in the response that are not defined in the document definition will be ignored.

Note:

  • BizzStream does not consider user permissions when updating the document. Thus, fields to which the user does not have edit permissions may also be updated if included in the REST call response.

Internal and External IDs

Documents may contain reference fields that point to other documents. External systems often don't recognize BizzStream's internal IDs. To address this, when a document is sent via a REST call, BizzStream tries to replace internal IDs with external IDs if:

  • The referenced document definitions include an externalId field.
  • The externalId field in the referenced document contains a value.

Conversely, when BizzStream receives a response from an external system with external IDs, it automatically converts them back to internal IDs.

Showing Notifications

External systems can trigger BizzStream to display notifications to users. By including specific fields in the notification, the external system can show notifications to BizzStream users or visitors. These notifications appear with the same style as notifications displayed by the Show Notification rule.

For instance, if the REST call response includes the following header:

{
     errorText: "Oops, something went wrong"
}
and this footer:
{
    _errorText: "We could not process this stuff.",
    _infoText: "But the call was processed."
}
BizzStream displays three notifications:

  • Error: "Oops, something went wrong."
  • Error: "We could not process this stuff."
  • Info: "But the call was processed."

Note: Notifications will only be shown when the REST call is part of a user action.

Send Email

The Send Email rule enables you to send emails based on a template. It provides various properties to configure the email content, recipients, attachments, and more.

Properties

Property Required Description
Subject Yes Contains the subject line of the e-mail. BizzStream expressions can be used.
Content Yes The template that is used to render the content of the e-mail. Only templates of the type HTML can be selected.
From No This is the e-mail address from which the recipient perceives the e-mail to be sent. When you enter an e-mail address here, ensure that it is validated beforehand. Contact your consultant in case of email validation requests.
It's possible to use Bizzstream Expressions to populate this field. For instance, {{F["email"]}} will give the result of having the From address filled with the e-mail address in the email field.
Attach Templates No You can select one or more templates. When the rule is executed, these templates are added to the e-mail as PDF attachment.
Attachments No You can select one or more attachment header fields. When the rule is executed, the attachments in the selected fields will be added as attachments to the e-mail.
Recipients (Access Groups) No This is where you can select one or more Access Groups. E-mails will be sent to the users that are members of these Access Groups in the document on which the rule is executed.
Recipients False A comma-separated list of e-mail addresses of recipients. This field can be used to send mails to people who are not members of an access group. BizzStream Expressions can be used in the field. For instance, user@bizzstream.com, {{F["emailSupplier]}}, invoice@company.com will result in e-mails to user@bizzstream.com, invoice@company.com, and the e-mail address in the emailSupplier field.
Default Language No If there are translation keys in the e-mail, BizzStream resolves these in the language of the user/visitor. If the recipient is not a user or visitor, BizzStream sends the mail in the default language. If no default language has been set, the default language is English.

Recipients

The Send Email rule sends emails to:

  • Users and visitors who are members of the access groups selected in the Recipients (Access Groups) selection box.
  • E-mail addresses listed in the Recipients text field.

Before sending the emails, BizzStream validates whether the provided e-mail addresses have a valid format (i.e., have a local-part, an @ symbol, and a case-insensitive domain). If there are no valid e-mail addresses, BizzStream creates an error log and continues executing the next rule in the action. This means that the absence of recipients won't terminate the action.

Limits

The Send Email rule is subject to some limitations, which you can find more about here.

Note:

  • For sending emails, the maximum size of a single attachment is 7 MB.
  • For sending emails, the maximum size of all attachments combined is 10 MB.

Go To URL

The Go To URL rule is all about navigation. It opens a URL, which can be either a relative URL within the BizzStream environment or an absolute URL to an external website. Optionally, the URL can be opened in a new tab.

Field Required Purpose
URL Yes The URL to navigate to. This can be both a relative URL (/menu/orders/) as well as an absolute URL (https://www.bizzstream.com). It is also possible that the URL contains BizzStream expressions (/menu/orders/F[“_id”]).
Open in new tab Yes This option determines whether the URL will be opened in a new tab or in the same tab.

Tip: Set up the menu to open Google Maps with a pre-configured route. See Enabling Navigation with Google Maps in Map Control for more information.

Confirm Dialog

The Confirm Dialog rule allows users to provide input that determines whether consecutive rules or all rules following this one will be executed. It presents a dialog with a question that users can answer with either Yes or No.

Field Required Purpose
Message Yes This is the question that will be presented to the user.
Terminate when Declined No If this is checked, the entire action will be terminated instead of just the following rule. If unchecked, only the rule after the confirm dialog rule will be skipped.

Terminate

The Terminate rule allows you to halt the execution of an action on a particular document and prevent a status transition under certain circumstances. If the action containing the Terminate rule is a scheduled or bulk action, the action will continue to process the next document. If the action that triggers the rule is a user action, an error notification will be displayed to the user, unless the Silent option is enabled.

Field Required Purpose
Condition Yes Determines when the action will be terminated. BizzStream Expressions should be used to set a condition.
Reason Yes A message that will be displayed if the action is terminated.
Silent No If checked, no notification will be shown if the terminate action is run.

Export documents

When the export documents rule is executed, an interface is opened that allows the user to export documents to a CSV or XLSX file. In that interface the user can indicate whether they want to include:

  • Field labels in the exported file
  • Fields that are not in the layout
Field Required Purpose
Allow export of fields that are not part of the layout No This will include fields that are not visible in the layout, but are in the document in the database. Permissions are taken into account when including those fields.

Import documents

When the import documents rule is executed, an interface is opened that allows the user to import documents from a CSV or XLSX file. The import process inserts new documents or updates existing ones.

This rule does not have any additional properties to configure.

When the documents are imported, BizzStream will attempt to convert the labels of statuses and references to their respective names and IDs.

Emit event

The Emit event rule allows you to emit an event to BizzStream's event framework. The rule has two important properties:

Field Required Purpose
Event Type Yes The type of the event. This name is used for event listeners and methods to listen to this specific type.
Event Info Yes A JSON object that contains the info of the event. This object may contain BizzStream expressions. For instance, the value { code: {{F["code"]}} } will result in an object containing the code field from the document that is being processed.

Example

  • Create a new user action by dragging it into the workflow and connect it to Any status or any other status block.
  • The user action created should have a label and name. In this example: 'Save'.
  • Add a new action rule. Under Type select Emit Event. Now enter an Event Type and add Event Information.
  • This is an example of what it could look like:
Emit Event