Class: BPMFileUploader

BPMFileUploader

The BPM File Uploader control allows the user to select a file from their computer. This control is best used with the BPM File List control, or File Viewer control. A BPMFileUploader control provides the following configuration properties in Process Designer:

Formula

Doc Title Formula: Formula/expression used to calculate section title string

Appearance

Color Style: Color-based styling for this control (default, primary, success, warning, danger)
{Default | Primary | Info | Success | Warning | Danger}
string
Shape Style: Rounded, flat or default square control shape
{Default | Rounded | Flat}
string
Size Style: Size-based styling for this control (default, large, small, extra-small)
{Default | Large | Small | Extra-Small}
string
Outline: Outline-only means the control only shows its color-based style when hovered over boolean
Icon: Icon name, for example: calendar, clock-o, camera, cloud-upload, bell, info, file-text, etc... Check http://fontawesome.io/icons for a comprehensive list. (Note that the "fa-" prefix is optional) string
Hide Browse Button: When true, the Browse Button is not displayed, when false it is displayed boolean
Hide File Name: When true, the File Name is not displayed, when false it is displayed boolean

Content Management

Associate with Process Instance: True when the documents to be uploaded will be associated with the current process instance, False otherwise. boolean
Hide in portal: Prevent the BPM document from displaying in portal boolean
Upload Properties: Specifies the matching properties to be uploaded with this document NameValuePair[]

Behavior

Max File Size (MB): Maximum allowed file size for uploads decimal
Auto Upload: Upload selected files automatically. If not selected, use the startUpload() method instead boolean
File Types Allowed: Pick a valid file type from the dropdown, or specify custom to specify your own file type. When empty all file types are valid. FileType[]

Events

On Load:
Description: Triggers whenever the view is loaded.
Example:
me.setAssociatedWithProcessInstance(true)
On File Added:
Description: Triggers when a file is added to the control
Example:
${DocInfoDlg}.show()
Context Variables file {object}
Properties status
name
lastModifiedDate
size
type
On File Selected:
Description: Triggers when selecting a file in the control.
Example:
${DocInfoDlg}.show()
Context Variables file {object}
Properties status
name
lastModifiedDate
size
accepted
On File Removed:
Description: Triggers when a file is removed from the control.
Example:
return confirm("Are you sure you want to remove this?")
Context Variables file {object}
Properties status
name
lastModifiedDate
accepted
xhr
On Upload Complete:
Description: Triggers when files have been uploaded successfully.
Example:
${BPMFileList1}.refresh()
Context Variables file {object} message {string}
Properties status
name
lastModifiedDate
accepted
xhr
On Upload Error:
Description: Triggers when there is an error uploading the files
Example:
console.error("Error occurred: " + error)
Context Variables file {object} message {string} xhr {object}
Properties status
name
lastModifiedDate
accepted
xhr
Article(s)

new BPMFileUploader()

This constructor is never used explicitly.

Extends

  • com.ibm.bpm.coach.CoachView

Methods

getSelectedFile(){File}

Returns currently selected file
Returns:
Type Description
File

getType(){string}

Get descriptive string representing the type of control
Returns:
Type Description
string

isAssociatedWithProcessInstance(){boolean}

Indicates whether the BPM Attachments are associated with a process instance or not
Returns:
Type Description
boolean

openFileSelectionDialog()

Programmatically opens the file selection dialog. For security reasons, this only works as aresult of a user interaction such as a mouse click on another button on the Coach UI

processQueue()

Start uploading the document currently selected

setAssociatedWithProcessInstance(flag)

Sets whether the BPM attachments uploaded are associated with a process instance or not
Name Type Description
flag boolean | String (true/false) or a specific process instance id to use one that is differentfrom the current process instance associated with the Coach UI

setDocumentTitle(file, title)

Sets the title associated with the currently-selected file (this will becomes the BPM attachment title)
Name Type Description
file File object
title String

setLabel(label)

Sets the label for the Browse button
Name Type Description
label String

uploadFile(file)

Start uploading a file
Name Type Description
file File File object to upload