Manage rules in Jitterbit App Builder
Introduction
Rules are managed on the Rules page. To open it, select App Workbench > Rules:
From here, you can do the following:
View rules
When you open the Rules page, the All Rules tab is selected by default. This shows all rules for the current app and the selected app data source. The other tabs are as follows:
- By Table: View or create rules based on the selected data source's tables.
- With Reach: View rules based on the reach rules for the selected data source's tables.
The next two tabs emphasize the close relationship between rules and events:
- All Events: Show all events for the current app.
- Background Events: Show all background events for the current app.
Tip
When you have a large number of rules in your app, use the search bar to search for rules, click the Apply Filter icon to filter the contents of the table, or click a Name, Target, Type, or Changed On column heading to sort the table by that column.
Create a rule
To create a rule, click the + Rule button in the Rules section. This opens the Rule Builder page:
To continue, follow these steps:
- In the Name field, enter a name for your rule.
- (Optional) In the Technical Help field, enter a description for the rule. This text is only visible to app developers.
-
Click the Purpose menu, then select one of the purpose options. Depending on your choice, additional settings are shown. The available options are shown in the following table:
Category Purpose Source Data Source Target Data Source Target Target Layer Action Chart Type Delivery Method Basic Business object CRUD Validation Visibility Reporting Calendar Chart Gantt Map Network graph Report Pivot Edge Case API call Notification Default List Migration Reach Subquery Webhook XP validation XP CRUD -
Click the Create button.
- Use the visual rule builder to add the tables and columns needed by your rule.
- When done, click the Validate button to check the rule.
Edit a rule
To edit a rule, follow these steps:
- Click the Edit icon adjacent to the rule you want to edit. The Rule Builder page opens.
- Edit the rule. The layout and controls are the same as when creating a rule. Changes to the rule are effective immediately.
- (Optional) Click the Validate button to check the rule before closing the page.
Visual rule builder
When you create or edit a rule, the Rule Builder page divides into two regions: one where you set the rule's name and purpose; the other, comprising a set of tabs, where you define the rule itself. The default tab is the Tables tab (also known as the Visual Rule Builder).
The Tables tab is a canvas where you interact with graphical representations of the tables, columns, joins, and other rules that form the rule you're working on. Depending on the rule's purpose, a table may automatically be added to the canvas.
You can interact with the images on the canvas in the following ways:
- Click and hold a table's label to move it around the canvas.
- Use the viewport controls and to zoom the canvas view in or out.
- Drag and drop columns from one table to another to create joins. These appear in the Joins tab.
- Click the + Tables button to add tables to the rule.
- Click the + Column button to add a column to the rule.
- Click the Remove icon remove a table from the rule.
- Click the table's title bar to open a popup page where you can do the following:
- Set the order of the table in the query.
- Select a different table.
- Set the alias used to reference the table in queries.
- Select all columns.
- Edit the table on the Table Definition page.
- See the results of the query on the table.
The remaining tabs have the following functions:
- Columns tab: A list of columns used by the rule.
- Where tab: A list of SQL
where
clauses used by the rule. - Joins: A list of table joins used by the rule.
- SQL: The SQL statement forming the rule.
- Results: The result of running the SQL statement. Click the Save to CSV icon to download the results as a
.csv
file.
Delete a rule
To delete a rule, click the Delete icon adjacent to the rule you want to delete, then click the Proceed button to confirm.
Rule purpose
What a rule can do and how it's configured depends on its purpose. When you create a rule, you must select one of the following purposes. This section describes each.
API call
Call an API endpoint. Select this rule to limit the target results to REST API endpoints only.
Business object
Any number of rule events or subqueries, primarily used to build an app's UI layer. Source and List are two common examples of business objects:
-
Source: Shows all rows and columns from a table in the data layer. References one table and should not include any filters. Source objects are often used when you need to create an expression or function on the underlying data to present it on the application UI layer.
-
List: Translates the primary key ID value to a user-friendly title column value. List objects can be used when you want to display data to the end user that may not be available on the table. List objects often present information in the form of a dropdown menu that a user can select from.
Calendar
Business logic for a calendar on the UI layer. Attributes are defined at the rule level via the following Usage Type values:
- Color
- Description
- End
- Sort
- Start
Chart
Business logic for a chart on the UI layer. Attributes are defined at the rule level via the following Usage Type values:
- Category
- Color
- Flag
- JSON Options Object
- Sort
- Value
CRUD
Update, delete, or insert data. The selected action defines how the rule impacts target table records.
CRUD rules execute in the business logic layer, and cause all the actions and validations on the table or object you are modifying to execute. (Use an XP CRUD rule when you want to use CRUD between two different data sources.)
Further reading
Default
Use a default rule to improve the user experience by setting default values in fields in the data, business, or UI layers. A common example is defaulting a date field for a new record added to today's date.
Gantt
Business logic for a Gantt chart on the UI layer. Attributes are defined at the rule level via the following Usage Type values:
- Color
- Dependency
- End
- JSON Options Object
- Parent Task
- Sort
- Start
- Task
- Task Group
List
Populate selected lists on the UI layer. List rules do not have any associated actions or validations. Attributes are defined at the rule level via the following Usage Type values:
- Key
- Title
- Subtitle
Map
Business logic for a map on the UI layer. Attributes are defined at the rule level via the following Usage Type values:
- Category
- Color
- JSON Options Object
- Value
Migration
A migration rule runs when a release is installed on a new server. Their primary use is for moving apps from development to QA, and from QA to production environments. Rules are added to the change management steps run when publishing an LP to a new environment. When a migration rule is executed, App Builder takes a snapshot of the rule and embeds it into the changeset. The migration rule is deleted after execution.
Network graph
Business logic for a network graph in the UI layer.
Notification
Send a message to a user. Messages can be sent via email, push notifications, SMS (text messages), or in-app App Builder alerts. Notifications support file attachments of any file type.
Pivot
Display a pivot (flattened data set) table. Pivot rules summarize related data that span across multiple rows, and present it in a single row. This output helps draw attention to useful information.
Reach
Use a reach rule to restrict a user's access to data on pages without restricting access to the pages themselves.
Report
Use to configure business logic without any associated events. This rule type is intended for different report requirements in the UI layer (for example, for a chart, grid panel, or pivot).
Subquery
Subquery rules are rules that can reside within other business rules. Subqueries on their own are not exposed to the application UI layer, and do not support business logic events. They are typically used to adjust data, perform more complex logic, or for calculations on data.
Tip
When designing subqueries, keep the logic as flat and as simple as possible.
Further reading
Validation
Validation rules protect data integrity. For example, you can use them to enforce business logic on manual input. If a CRUD rule is defined, validations also run when that CRUD rule is executed. Validation messages shown to users are configurable, and can use dynamic substitution to improve the user experience.
Further reading
Visibility
Determine the state of a control in the UI layer: which controls are hidden, mandatory, or available for editing. Visibility rules simplify page design and improve the user experience. (This rule can only be configured for a form panel.)
Webhook
Allows a separate system to invoke a custom App Builder callback event. A webhook is a user-defined HTTP callback that is typically triggered by an event. If a webhook is being used in the form of an email or text message, depending on the user response, App Builder responds accordingly by invoking the specified event.
XP CRUD
Execute a CRUD rule across data sources. XP type rules are designed to allow logic to run across different data sources.
XP validation
Execute a validation rule across data sources. XP type rules are designed to allow logic to run across different data sources.
Additional settings
When you select a rule purpose, one or more of the following additional settings are shown.
Action
Action options are as follows:
- Cram: Similar to insert, but won't fail if a primary key already exists. A new record is created only if the PK does not already exist in the data source. Duplicate key records are skipped.
- Delete: Delete an existing record in the target table.
- Insert: Create a new record in the target table.
- Update: Modify an existing record in the target table.
Chart Type
For the chart rule purpose, the following chart types are available:
- 3D Bar
- 3D Column
- 3D Donut
- 3D Pie
- Area
- Bar
- Bubble
- Column
- Funnel
- Line
- Marimekko
- Mixed
- Percentage Area
- Pie
- Pyramid
- Semi Circle Donut
- Spline
- Stacked Area
- Stacked Bar
- Stacked Column
Delivery Method
Delivery methods for a notification rule are as follows:
- App Builder Alert
- Push Notification
- Text Message
Source Data Source
The data source that triggers the rule.
Target Data Source
The target data source is the data source where the target is.
Target
The target is that which is affected by the rule.
Target Layer
The target layer options are as follows:
- Data Layer: Select to choose a target on the data layer.
- Logic Layer: Select to choose a target on the logic layer.