AddExistingAssetToWorkspace

Use this node to add an existing asset to a workspace created by this template. Generally used to add assets not created from the template to the app. These assets become part of the app and behave as if they were originally created from the template. They can be upgraded and are deleted when the app is deleted.

Asset Type Name for Rules 

Not supported

Example Definition in chain.json 

1{
2  "name": "add_existing_assets",
3  "label": "Adds existing assets to workspace",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "upsert_workspace1": {
9        "graphNodeType": {"name": "WorkspaceUpsert"},
10        "parameters": {
11          "name": "myworkspace",
12          "label": "My Workspace",
13          "file": "workspaces/workspace1.json"
14        },
15        "sources": [],
16        "runAs": "CurrentUser"
17      },
18      "add_existing_sdm_to_workspace": {
19        "graphNodeType": {
20          "name": "AddExistingAssetToWorkspace"
21        },
22        "parameters": {
23          "workspace": "myworkspace",
24          "assets": [
25            {
26              "apiName": "${Variables.mysdm}",
27              "templateAssetName": "ExistingSDM",
28              "assetType": "SemanticModel",
29              "usageType": "Referenced"
30            }
31          ]
32        },
33        "sources": [
34          "upsert_workspace1"
35        ],
36        "runAs": "CurrentUser"
37      }
38    }
39  }
40}

Parameters 

ParameterDefinition
workspace(Required) The name of a workspace node defined earlier in the same chain. The existing asset is added to this workspace.
assets(Required) An array of asset objects to add to the workspace. Each object contains apiName, templateAssetName, assetType, and usageType.
assets[].apiName(Required) The API name of the existing asset to add. Usually references a variable (e.g. ${Variables.mysdm}).
assets[].templateAssetName(Required) A template-specific name used to track this asset within the app.
assets[].assetType(Required) The type of the asset. Supported values include SemanticModel.
assets[].usageType(Required) How the asset is used in the workspace. Supported values include Referenced.
condition(Optional) An EL expression, evaluated at runtime, that determines whether to add this asset or not.

Set runAs to CurrentUser so that the assets are added to the workspace with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

App Context ValueDefinition
App.<AssetType>.<templateAssetName>.IdThe ID of the asset added to the workspace.
App.<AssetType>.<templateAssetName>.NameThe developer name of the asset added to the workspace.

On Failure 

If this task fails, it returns a FAIL_TERMINAL status. The chain stops and no downstream nodes run.

See Also