Copy Folder Trigger
The Copy Folder Trigger copies the parent folder of the asset in workflow to a location designated by a parameter passed to the trigger. It also realigns structured data asset choosers for assets contained in the folder being copied so that the user does not have to go in and realign the asset choosers manually.
Example: There exists a page 'p1' in folder 'a' that has a page chooser that points to a page 'p2' residing in folder 'a/b' (a child folder of 'a'). If folder 'a' is put into workflow and the CopyFolder trigger is invoked, the page chooser in the copied 'p1' page will point to the page 'p2' in the new 'a/b' folder rather than the page 'p2' contained in the original 'a/b' folder.
Implementation
Declaration
Usage
Parameters
destPath
The destPath parameter is used to determine where the parent folder should publish to. If more than one location is required, these can be delimited by commas (",") within the same parameter.
basePath
The basePath parameter is used when the folder to be copied should be copied into a sub-folder of the folder designated by the destPath parameter. By default, this parameter is given the value of the path of the parent folder of the folder being copied. This default ensures that any folders copied with the trigger will be created as a direct descendant of the destination folder.
Setting this parameter to a value that is higher in the folder hierarchy than the parent of the folder being copied makes it possible to use the CopyFolder trigger to copy folders at any level deep below the folder corresponding to basePath into an analogous folder found in the destination folder.
For example, say there exists a folder '/base' (a direct child of the system base folder) which contains a folder 'a' which contains a folder 'b'; and the destPath has been specified as '/dest' (also a direct child of the system base folder). Assume the basePath has been set to '/base'. Starting a workflow that uses the CopyFolder trigger on an asset inside folder 'b' would cause the folder 'b' to be copied into the folder with path '/dest/a' (resulting in a folder with path '/dest/a/b') because folder 'a' was below the folder designated as the basePath folder. Note that folder '/dest/a' has to exist before folder 'b' can be copied into it. The trigger will not create a sub-tree of folders for you. The idea is that one would first use the CopyFolder trigger to copy folder 'a' to all destPaths, and then folder 'b' would be created so that it could be copied after 'a' had been copied. If the goal is to simply copy an entire folder tree to another location, then this would not be necessary; a single folder copy would do the job. If, however, the goal is to incrementally copy folders and subfolders inside a particular 'base' folder to another specified location, you would use this parameter.
includeAssetInWorkflow
This parameter indicates whether or not the asset originally put into workflow will be copied to the new location. It defaults to false.
It does not make sense to set this parameter to true if the asset is in a create workflow and has not been merged (using the merge workflow trigger) because the asset is still a working copy and cannot be copied to a new location.
Required Intermediate Step
The Copy Folder Trigger requires an intermediate transition step assigned to a default user that cannot be touched by any regular users. This intermediate step prevents users from clicking through the workflow before the Copy Folder Trigger has finished its copy. The intermediate step requires one action that moves to the next desired step after the copy is complete.
Example:
Adding a Workflow Trigger
The Cascade Server workflow builder utilizes centrally managed triggers. For a trigger to be available in a workflow created by the Workflow Builder, the trigger must first be defined and assigned a name in the system-wide trigger base. Defining triggers in this way allows the Java files that contain each trigger’s functionality to be referenced later in the workflow definition.
If a new custom trigger has been written or Cascade Server has been upgraded without including the default database, the new triggers will need to be added before they become available in the Workflow Builder.
To add a workflow trigger:
- In the Administration area, select ‘Workflow Definitions’.
- Click ‘Manage Workflow Triggers’.
- All currently available triggers in the default database are shown, along with the ‘Add a Trigger’ field.
- Type in the name of the new trigger and click ‘Submit’.
- The new trigger will now appear on the list of available triggers and will be available for use within the Workflow Builder.


