Document Explorer
The Document Explorer view displays and supports various actions in the folder structure of a process instance.  Depending on the structure of the process folders, this can include showing documents in the BPM content store and any other referenced ECM folders and documents. The Document Explorer view gives users the ability to search, create, delete and rename folders, when authorized.  The view also allows users to upload, view, checkout and remove documents when authorized.

Content management advanced
Instance ID: Specify the instance ID for which you want to display a list of associated documents and folders. If the "Folder ID" property is configured, the "Instance ID" property is ignored. If no folder ID or instance ID is specified, the folder ID is derived from the human service context. For client-side human services, the tw.system.processInstance.id and tw.system.processInstance.caseFolderId properties are used for the context. For heritage human services, the tw.system.currentProcessInstance.id and tw.system.currentProcessInstance.caseFolderId properties are used for the context. String
Server name: If a folder ID is configured, specify the name of the external ECM server. The server name can be typed into the field. You can also use a variable that represents the server name and add the variable to this field. For an external ECM server name, check the Process App Settings page for the external ECM systems available.If you are working with the internal ECM content repositories - BPM managed store, BPM content store, or BPM document store - constants are available for them; for example, ECMServerNames.IBM_BPM_MANAGED_STORE. String
Repository name: The name of the repository that represents the repository configured with the server set using the 'Server name' configuration. This is optional, and would be used in the context of a Case Configuration, when Case is configured with more than one Target Object store, and 'Server name' is set to a predefined constant of IBM_TargetObjectStore. The repository name would help in resolving IBM_TargetObjectStore to the proper Target Object store. From a Case perspective you can set this configuration to the tosName variable. String
Folder path or ID: Specify the folder ID for which you want to display a list of associated documents and folders. If this property is configured, the instance ID is ignored. If the "Folder ID" property is not configured, the folder ID is derived from the associated "Instance ID" property. If an instance ID is not specified, the folder ID is derived from the human service context. For client-side human services, the tw.system.processInstance.id and tw.system.processInstance.caseFolderId properties are used for the context. For heritage human services, the tw.system.currentProcessInstance.id and tw.system.currentProcessInstance.caseFolderId properties are used for the context. String
Display parent case folder: Display the contents of the parent case instance. This option is only valid for process instances in a case solution that are created through Case Builder. When this option is selected, the Server Name, Instance ID and Folder ID fields are ignored. Boolean
Root folder name: The display name of the root folder to replace the folder name from the ECM content repository. String

Appearance
Table style: The style of the table.
Color style: The color style for the table display.
Width: The width in pixels (px), percent (%), or em units (em). For example: 500px, 20%, 40em. If "px", "%", or "em" is not appended to the numeric value, the value defaults to "px". String
Height: The height in pixels (px), percent (%), or em units (em). For example: 500px, 20%, 40em. If "px", "%", or "em" is not appended to the numeric value, the value defaults to "px". String
Columns: The columns to display in the list. ExplorerColumn[]
View Style: The style of the view (Default, Modern).
Show column headers: Select this option to enable viewing the column headers for the 'Default' View style. In the 'Modern' View style, this option gets automatically enabled at runtime. Boolean

Behavior
Show footer: Show the table footer. Boolean
Show table stats: Show table statistics. For example, "Showing 1 to 5 of 59 entries". Boolean
Show pager: Display the pager. Boolean
Initial page size: The initial maximum number of entries shown for each page. Integer
Confirm on deletion: Show a confirmation dialog box before files are deleted. Boolean
Collapsible: Indicates whether the section can be collapsed. Boolean
Initially collapsed: Indicates whether the section is collapsed when the view opens. Boolean
Refresh trigger: Indicates whether the contents of the control can be refreshed. Bind this property to a private variable.When the value of the bound variable changes to "true", the view is refreshed. After the view is refreshed, the value of the variable returns to "false". Boolean
ECM get related folders service: Gets the folder info for the ECM servers listed in the Process Application Settings page. String
Instance status: Determines whether the Document Explorer is editable or read-only. ACTIVE instances are editable. Instances with different status values (COMPLETED, FAILED, TERMINATED, and SUSPENDED) are read-only. String
Hide Document Explorer: Hide the Document Explorer control, for example, for a business process definition (BPD). Boolean
View clicked document: Select this option to enable the default viewer for documents when you click their name. Boolean
Enable on custom view event: Enable the execution of a custom script in the 'on custom view' event when the View menu action is selected. Boolean
Use document viewer: Select this option to open documents in an in-line document viewer when the View menu action is selected. When this option is clear, documents open in a new window. Boolean
ECM get default target repository name service: Gets the default target repository name represented by the predefined ECM constant IBM_TargetObjectStore. String
Disable drag and drop: Select this option to disable the addition of documents by using drag and drop. Boolean
Document classes: A set of document classes that are displayed when adding new documents. When not set, document classes are retrieved from the server. The names entered here are displayed to the user, and the values correspond to the symbolic name of each document class. If the name is not provided, the original name for the class will be used. LabelIdPair[]
Custom folder class: The custom folder class to apply when adding subfolders. When used with a case folder, the folder class must be a subclass of CmAcmCaseSubfolder. String
Custom actions: Provide the ID, label, and icon for displaying the custom actions when the user clicks the overflow menu on a table row. Add the JavaScript code for the action to perform to the On custom action click event. CustomMenus[]
Disable folder addition: Select this option to disable the addition of folders. Boolean

Content management
Last updated doc ID: The ID of the document on which a create or update operation was performed. ECMID
Default ECM document properties: Specifies the matching properties to upload with this document. ECMDefaultProperty[]
Add BPM properties: By default, properties are not added to new BPM documents. Enabling this configuration option adds the properties defined in the "Upload BPM properties" configuration option. If you want to control when the properties are added to the document, bind this configuration option to a variable. Boolean
Upload BPM properties: Adds the properties specified in the "Upload BPM properties" table to a BPM document (when the "Add BPM properties" option is selected). NameValuePair[]
Hide in portal: Prevent the BPM document from being displayed in the portal. Boolean

Events
On load:
Description: The logic that is called when the control is loaded. This event is only fired one time for each page load.
Example:
me.getRecordCount();
On document clicked:
Description: This event is fired when a file is clicked. Additional parameters: doc
Example:
console.log(doc.fileName)
Context Variables doc {object} Type Description
Properties id String The identifier of the document
fileName String The file name of the document
mimeType String The MIME type of the document
versionLabel String The version number of the document
url String The url of the document that can be used to download the document content
On folder clicked:
Description: This event is fired when a folder is clicked. Additional parameters: folder
Example:
console.log("Folder clicked: "+folder.name)
Context Variables folder {object} Type Description
Properties id String The identifier of the folder
name String The name of the folder
isReference Boolean Returns True if folder has a reference else False
parentFolderId String The identifier of the parent folder
parentFolderServer String The external ECM server name of the parent folder
server String The name of the external ECM server
On delete:
Description: This event is fired after a file or folder is deleted. Additional parameters: record
Example:
console.log("Object is deleted: "+record.name)
Context Variables record {object} Type Description
Properties id String The identifier of the instance to be deleted
name String The name of the instance to be deleted
isReference Boolean Returns True if folder has a reference else False
isFolder Boolean Returns True if it is a folder else False
isLocal Boolean Returns True if it is a local else False
server String The external ECM server name of the instance to be deleted
On refresh:
Description: This event is fired when the document explorer table has been built.
Example:
console.log("Explorer refreshed")
On error:
Description: This event is fired when an error occurs during the execution of operations in the document explorer. Additional parameters: message
Example:
console.log("There has been an error with the operation : "+error.action)
Context Variables error {object}
On folder rename:
Description: This event is fired when a folder is renamed. Additional parameters: folder
Example:
console.log("Folder Renamed: "+folder.name);
Context Variables folder {object} Type Description
Properties id String The identifier of the folder to be renamed
name String The new name of the folder
oldName String The name of the folder to be renamed
isReference Boolean Returns True if folder has a reference else False
server String The external ECM server name of the folder
On remove from folder:
Description: This event is fired when an ECM folder or document reference is removed from a BPM folder. Additional parameters: record
Example:
console.log("Object removed from BPM : "+record.name)
Context Variables record {object}
Properties id String The identifier of the instance to be removed
name String The name of the instance to be removed
isReference Boolean Returns True if folder has a reference else False
isFolder Boolean Returns True if it is a folder else False
isLocal Boolean Returns True if it is a local else False
server String The external ECM server name of the instance to be removed
parentFolderServer String The external ECM server name of the parent folder
On document upload complete:
Description: This event is triggered when a document is uploaded. Additional parameters: documentId
Example:
console.log("Uploaded document ID : "+documentId)
Context Variables documentId {string}
On reference created:
Description: This event is fired when a reference for an external folder or document is created. Additional parameter: reference
Example:
console.log("Reference created : "+reference.referenceName)
Context Variables reference {object} Type Description
Properties id String The identifier of the instance where the reference is created
parentFolderId String The identifier of the parent folder
referenceName String The reference name of the instance
referenceServerName String The reference server name of the instance
type String The type of the instance
On custom view:
Description: Enables customization for viewing documents in a custom document viewer using a custom script. This event is enabled when 'Enable on custom view event' and 'View Clicked document' configuration option is selected. This event is fired when a document is clicked or the View menu option on the document is clicked. Additional parameter: doc
Example:

Example1:
console.log(doc.fileName);

Example2:
// This would open the document in Navigator viewer only for Case Client.
var docObject = {};
if(doc.id.includes("idd_")){
docObject.id = doc.id.split("_")[1];
}
docObject.caseAction = "documentClicked";
this.context.broadcastMessage(docObject);

Example3:
// This would open the document in native browser for browser supported mime types
window.open(doc.url, '_blank');
Context Variables doc {object} Type Description
Properties id String The identifier of the document
fileName String The file name of the document
mimeType String The MIME type of the document
versionLabel String The version number of the document
url String The url of the document that can be used to download the document content
On custom action click:
Description: Activated when the user clicks a custom action from the overflow menu. You can use it to add custom logic for executing the action triggered by the user's click. Data passed in includes the menu ID defined in the Custom actions configuration option and the metadata for the selected case instance. Also, "data" is passed in as an additional parameter.
Example:

if(data.menuId == "customId"){
// custom action logic
}
Context Variables data {object} Type Description
Properties menuId String The identifier of the menu action
rowData Object The table row where the context menu is triggered.
view Object Represents the current view.
Extends:
com.ibm.bpm.coach.CoachView
Methods:

Inherited addClass(name, [replaced])
Add/replace CSS class(es) for this control
NameTypeDefaultDescription
name{string}CSS class name(s) to add to the control. Separate class names by a space if more than one class.
replaced{string}CSS class name(s) to be replaced by the first argument. Separate class names by a space if more than one class.
Example
Button.addClass("green");

createCustomMenus(data, view)
Creates and configures custom and standard action menu items for the selected document or folder.
This method evaluates the item's type and permissions, then dynamically builds a list of applicable menu options.
When an action is selected, a custom event is triggered for further handling.
NameTypeDefaultDescription
data{Object}The menu creation context.
data.cellObj The cell object representing the selected row.
data.customActions List of available custom and standard actions.
view{Object}The instance of the current Document Explorer view.

createFolder(parentFolderId, newFolderName, serverName)
Creates a new folder in the specified folder path and server.
NameTypeDefaultDescription
parentFolderId{string}The ID of the parent folder.
newFolderName{string}The name of the folder to be created.
serverName{string}The name of the target server.

getActionIcon(menuAction, cellData, [iconInfo]) Returns: {string}
Determines the icon to be displayed for a given menu action.
If an icon is explicitly defined in the custom actions, it is used; otherwise, a default is selected based on the action type and whether the item is a reference.
NameTypeDefaultDescription
menuAction{Object}The custom or standard action definition.
cellData{Object}The metadata for the selected item (e.g., folder or document).
iconInfo{string}Optional default icon to use if no icon is defined in the action.

getActionLabel(menuAction, labelInfo) Returns: {string}
Determines the display label for a given menu action.
If a label is explicitly defined in the menu action, it is used;
otherwise, a localized label is generated using the provided label key.
NameTypeDefaultDescription
menuAction{Object}The custom or standard action definition.
labelInfo{string}The localization key used to fetch a fallback label if one is not defined in the action.

Inherited getData() Returns: {Object}
Retrieve bound data associated this view/control. Only works for views/controls with bound data.
Example
var dec1 = MyDecimal.getData();

getFolderId() Returns: {string}
Returns the value of the 'Folder ID' option that is currently configured in the view.

getInstanceId() Returns: {string}
Returns the process instance ID that is currently configured in the view.

getRecordCount() Returns: {integer}
Returns the number of records that are currently displayed in the list.

getRefresh() Returns: {boolean}
Returns the value of the 'Refresh trigger' option.

getServerName() Returns: {string}
Returns the server name that is currently configured in the view.

getTitle() Returns: {string}
Returns the title of Document Explorer.

getType() Returns: {string}
Returns the descriptive string that represents the control type.

handleStandardActions(data)
Executes predefined standard actions based on the selected menu option.
This method is invoked when a user selects a standard action from the custom actions menu.
It routes the action to the appropriate internal handler.
NameTypeDefaultDescription
data{Object}The action context data.
data.menuId The identifier for the selected standard action.
data.rowData The data of the selected item.

Inherited hide(collapseFlag)
Hide this view/control
NameTypeDefaultDescription
collapseFlag{boolean}Set to true to collapse the view (equivalent to a view setting of "NONE")
Example
MyView.hide();

Inherited isBound() Returns: {boolean}
Indicates bound status of control.

Inherited isEnabled() Returns: {boolean}
Checks if the view is enabled or not
Example
var enabled = MyView.isEnabled();

Inherited isLabelVisible() Returns: {boolean}
Checks if control label is visible
Example
var labelVisible = MyView.isLabelVisible();

Inherited isValid() Returns: {boolean}
Returns the valid status as last set by the setValid() method.
Example
var valid = MyView.isValid();

Inherited isVisible() Returns: {boolean}
Checks whether or not view is visible
Example
var visible = MyView.isVisible();

Inherited propagateUpValueChange(event) Returns: {boolean}
Propagates value change of control up through parent views
NameTypeDefaultDescription
event{Event}Value change event (usually an onchange event)
Example
MyView.propagateUp(event);

Inherited recalculate()
Only for formula-enabled views!
Explicitly triggers the re-evaluation of the formula
for this view (if a formula has been specified). If the view is not formula-enabled, recalculate() does nothing.
Example
Text1.recalculate();
//If the formula for Text1 is: new Date().toString(), Text1 is updated to the current date/time

refresh(isNewRoot)
Refreshes the Document Explorer list.
NameTypeDefaultDescription
isNewRoot{boolean}Reloads content from the root folder (when 'true'). If 'false', content is reloaded from the current folder.

Inherited setEnabled(enabled, required)
Enable/disable this view/control
NameTypeDefaultDescription
enabled{boolean}Enabled/read-only flag (true to enable view, false to disable/make read-only)
required{boolean}Enable/disable required field flag for control
Example
MyView.setEnabled(false); //Make MyView read-only

setFolderId(folderId, startRefresh)
Sets the root folder ID for Document Explorer.
NameTypeDefaultDescription
folderId{string}The folder ID.
startRefresh{boolean}Enables a refresh to start (when 'true').

setInstanceId(instanceId, startRefresh)
Sets the process instance ID for Document Explorer.
NameTypeDefaultDescription
instanceId{string}The process instance ID.
startRefresh{boolean}Enables a refresh to start (when 'true').

Inherited setLabelVisible(visible)
Show/hide the label of this view/control
NameTypeDefaultDescription
visible{boolean}Label visibility flag (true to show view label, false to hide)
Example
MyView.setLabelVisible(false);

setRefresh(refresh)
Sets the value of the 'Refresh trigger' option. If the value is 'true', the Document Explorer content is refreshed and the trigger value is reset to 'false'.
NameTypeDefaultDescription
refresh{boolean}Refreshes the content of Document Explorer (when 'true').

setServerName(serverName, startRefresh)
Sets the server name for Document Explorer.
NameTypeDefaultDescription
serverName{string}The server name.
startRefresh{boolean}Enables a refresh to start (when 'true').

setTitle(title)
Sets the title of Document Explorer.
NameTypeDefaultDescription
title{string}The new title.

Inherited setValid(valid, errorText)
Flag this view/control as valid or invalid
NameTypeDefaultDescription
valid{boolean}Valid/invalid flag (true to set view valid, false to make it invalid - which typically shows the view with "invalid" styling and indicator)
errorText{string}Validation error text to show on the invalid-styled view
Example
MyView.setValid(false, "Please fix your data entry"); //Make MyView invalid

Inherited setViewData(data, createPseudoBinding)
Set/update bound data associated this view/control. Only works for views/controls with bound data.

Note: Should only be used with simple type bindings, or complex type bindings with simple type properties.
Should not be used with bindings that have properties that are lists or compext types. For complex types, set bindings using
the binding.set pattern detailed in the Knowlege Center section Binding Data and Configuration Options
NameTypeDefaultDescription
data{Object}Value of bound data. The type of this parameter must match the type of the bound data.
createPseudoBinding{boolean}If set to true, creates a pseudo binding if there is no current binding.
Example
MyView.setViewData("TEST"); //Updates bound data to the string 'TEST'

Inherited setVisible(visible, collapse)
Show/hide this view/control
NameTypeDefaultDescription
visible{boolean}Visibility flag (true to show view, false to hide)
collapse{boolean}Set to true to collapse the control space when visible is set to false.
Examples
MyView.setVisible(false, false); //Equivalent to MyView.hide()
MyView.setVisible(false, true); // Sets visibility to "None"

Inherited show()
Show this view/control
Example
MyView.show();

Inherited triggerFormulaUpdates([phase])
Broadcasts the expression trigger for the specified view
NameTypeDefaultDescription
phase{int}bpmext.ui.PHASE_NORMALThe phase we are currently in
Example
MyView.triggerFormulaUpdates();