Business Rules

Description

The Business Rules module allows you to set up business logic as a set of business rules. These rules can be called from ETL and can also call ETL chains, allowing them to integrate seamlessly with the rest of the Ambience modules.

Module Interfaces

Interface Description Required Privilege
Business Rules Allows Business Rules access mod-business-rules
Business Rules Designer Allows Business Rules Designer access mod-business-rules-designer

Add

To add a Business Rules record, start by clicking on the “Add” button on the upper right corner of the page.

The “Add Business Rules” dialog box will appear.

Field Description Mandatory Input Type Constraints Default Value
Name Unique name assigned to the Business Rules record. Y Text field Any text (case-sensitive) Empty string
Chainset Select the ETL chainset to be used. N Drop-down list Select from list Not selected
Enabled If selected, enables the Business Rule record. Y Checkbox True (selected) or false (unselected) Selected

In the dialog box, key in an unique name for the new Business Rules record in the “Name” field. It is case-sensitive. Select the desired ETL chainset from the drop-down list in the “Chainset” field. The “Enabled” field is selected by default. Do note that ETL can only access enabled record.

Click on the “Save” button to create the new Business Rules record. Clicking on the “Cancel” button aborts the action.

Do note that if an option is selected from the drop-down list for the “Workgroup” field at the top of the page, any Business Rules record added to the management page will have the selected workgroup added to it. For example, if “Workgroup A” is selected, a new business rule “New-BR” is added. The “New-BR” will have “Workgroup A” added to its properties.

Refresh

After performing actions on the browser/tab, the list is reloaded to display the business rules. The manual “Refresh” button is available and is particularly useful if there are others making changes on the same page.

The “Refresh” button is found on the upper right corner of the page. Clicking on it reloads the list.

Upload

To upload a record, start by clicking on the “Upload” button on the upper right corner of the page.

The “Upload” dialog box appears on the page.

Single File

Browse to the location of the file (<filename>.business-rules.json) to be uploaded and set the “Name” field. By default, the “Name” field uses the name of the upload file. You can change it to an appropriate name if desired. If the file to be uploaded is to replace an existing record, select the “Overwrite” field. Do note that the “Name” field must be unique, or an error message will appear.

Field Description Mandatory Input Type Constraints Default Value
File Browse to select file to be uploaded. Y “Choose File” button Any text Empty
Name Unique name assigned to the file to be uploaded.
When a file is specified in the above field, this field will automatically takes in the file name of the specified file.
Y Text field Any text Empty string
Overwrite If selected, overwrites existing record. N Checkbox Select or not selected Not selected

Click on the “OK” button to upload the selected file. Click on the “Cancel” button to abort the action. A message will appear after the file has been successfully uploaded.

Each Business Rules record has an ID. If ID of the record to be uploaded already exist, a new ID will be given to the newly uploaded record.

If the name of the record to be uploaded already exist or the file is not provided, the relevant error message will appear.

To overwrite the existing record, select the “Overwrite” field in the dialog box, then click on the “OK” button. A message will appear, informing that the overwrite uploading is successfully.

You can arrange/sort the list of records in ascending or descending order by clicking on the name of the desired field. By default, the list is sorted by the “Name” field in ascending order.

Zip File

Browse to the location of the zip file to be uploaded. The name of the records will be extracted from the zip file. Click on the “OK” button to upload the record. The “Upload Results” dialog box will display the results of the uploading.

The result in black is uploaded successfully while those in red indicates upload failures with their relevant messages. Click on the “Close” button to close the dialog box.

Edit

To modify an existing record properties, click on the “Edit” icon under the “Actions” column corresponding the desired record.

The “Edit Business Rules” dialog box will appear.

Edit as desired and click on the “Save” button to save the changes.

You can enable or disable a Business Rules record. ETL can only access enabled records.

Do note that if you are not the owner of the record, the icon will not appear.

Open Editor

To open the Business Rules record, simply click on the name of the desired record under the “Name” column. The Designer page will be displayed.

In this Designer page, you can edit, add, delete rules and their flows that connects between the rules.

For more information on the Designer, see Designer.

More Actions

This feature allows user to perform actions on multiple Business Rules records at the same time.

When the “More Actions” button located at the upper right corner of the page is clicked, a list of available actions are displayed.

If no record is selected prior clicking the button, there will be fewer actions available. To select a record, select the checkbox next to the name of the record.

Option Description
Select All Selects all records in the list.
Select None Unselects all records.
Invert Selection Inverts the current selection.
That is, any records selected will be unselected and vice versa.
Set Roles Selects the roles to be assigned to the records.
Set Workgroups Selects the workgroups to be associated with the records.
Download Downloads multiple records as a zip file.
If only one record is selected, the selected record will be downloaded as a JSON file.
Set Enabled True When selected, sets the selected records to enable.
Set Enabled False When selected, sets the selected records to disable.

Set Roles

To set the roles for the selected records, click on the “More Actions” button and select the “Set Roles” option. The “Set Roles” dialog box will appear.

Select the roles to have access to the record by selecting the checkboxes. Alternatively, you can search for the desired role by keying in the keyword in the search function at the top of the dialog box. You can also choose to select all, select none or invert selection by clicking on their respective icons on the right of the search function.

Click on the “OK” button to save the changes or click on the “Cancel” button to abort the action.

Set Workgroups

To set the workgroups to be associated with the selected records, click on the “More Actions” button and select the “Set Workgroups” option. The “Set Workgroups” dialog box will appear.

Select the workgroups to be associated with the record by selecting the checkboxes. Alternatively, you can search for the desired workgroup by keying in the keyword in the search function at the top of the dialog box. You can also choose to select all, select none or invert selection by clicking on their respective icons on the right of the search function.

Click on the “OK” button to save the changes or click on the “Cancel” button to abort the action.

Download

This function allows you to download an existing Business Rules record or multiple records in zip file.

To download, select the desired records. Click on the “More Actions” button and select the “Download” option.

If only one record is selected, the downloaded record has a filename of <filename>.business-rules.json.

If more than one record are selected prior, the “Download” dialog box will appear.

Key in the desired name for the zip file and click on the “OK” button. The selected records will be downloaded as a zip file with the filename provided earlier. The individual record in the zip file will have the filename format as mentioned above.

Set Enable / Disable

To enable or disable the records, click on the “More Actions” button and select the “Set Enable True” or “Set Enable False” option respectively.

The selected records will be enabled or disabled as selected.

An enabled record is represented with a green tick under the “Enabled” column, while a disabled record is represented with a red cross.

Delete

Deleting a Business Rules record removes it from the list.

To delete an existing record from Ambience, click on the “Delete” icon under the “Actions” column corresponding the desired record.

If you are not the owner of the record, the icon will not appear.

There is an option to undo the deletion. A notification with an “Undo” button appears right after clicking on the “Delete” icon.

Upon clicking on the “Undo” button, the deleted record is restored and is added back to the list. Do note that the notification will disappear after a few seconds.

Workgroup

The “Workgroup” field at the top left corner of the page allows you to filter the Business Rules records associated with the selected workgroup.

Simply select the desired workgroup from the drop-down list and the record associated with the selected workgroup will be displayed.

Do note that if no workgroup is created in the Workgroups module, the “Workgroup” field at the top left of the page will not appear.

Search

The search bar appears on the upper left corner of the page.

This provides an easy way to search through the list. It is case-insensitive and displays records that have the entered search value in any of the values of the fields below:

  • Name
  • Chainset
  • Owner
  • Workgroups
  • Roles
  • Last Modified

Alternatively, you can click on the any owner, workgroup, or roles under the “Owner”, “Workgroups” or “Roles” columns respectively to aid the search for the records in the page.

In the example above, Business Rules that are associated with workgroup “GroupA” and role “Administrator” is shown.

These two search methods can be combined together, with each criteria separated by a comma.