You are here:
Template Chains and Rules in Template Builder
Visualize how a Tableau Next app template uses chains and rules to make runtime decisions based on configuration options and the subscriber org.
The template builder renders chain and rule JSON files as visual representations of their definitions and dependencies. Use the representations to understand what a template does during app creation and updates. The representations are read only, so you can't edit chains or rules in the template builder.
Template Chains
A chain defines the order in which the template creates, updates, or deletes an app's
assets. Each node represents a task, such as DashboardUpsert or
WorkspaceUpsert, and identifies its dependencies and
runAs identity. At runtime, a chain can exclude an asset from the app
creation process based on configuration responses. The asset remains in the template but
isn't created in the subscriber org.
The order of tasks in a chain matters. For example, a chain creates a workspace before it creates a dashboard that depends on the workspace. Every generated template includes default chains for creating and updating the app.
The Chains page shows the template’s create and update chains. View each chain as a graphical list of tasks and dependencies or as raw JSON.
To modify a chain, download the template, edit the chain JSON file, and upload the updated template.
Template Rules
Rule files tell the server-side transformation engine how to modify asset JSON files at run time based on a user's configuration responses. The engine uses find-and-replace logic to transform static, tokenized JSON into assets configured for the subscriber org. For example, a rule can replace a token in a dashboard JSON file with a value from a configuration response before creating the dashboard in the subscriber org.
Generated templates don't include default rules. To create or modify rules, download the template, edit the rule JSON files, and upload the updated template. After you upload the template, its rules appear on the Rules page.
View rules by the asset type that they apply to or by the rule file that defines them (1). The Macros tab shows reusable rule definitions in the template (2), and the Constants tab shows fixed values that rules can reuse (3).
For more information about chain files, rule files, and macros, see the App Template Framework developer guide.
