Class: BPMFileDropzone

BPMFileDropzone

The BPM File Dropzone control allows the user to drag and drop a file from their computer or select a file manually, and will store it in the IBM BPM document store. A BPMFileDropzone control provides the following configuration properties in Process Designer:

Appearance

Show Border: Show border around file upload area. boolean
Square Border Corners: Make the border corners square, instead of rounded boolean
Show Thumbnails: Show tumbnails of files in dropzone boolean

Content Management

Associate with Process Instance: Set to true when the documents to be uploaded should be associated with the current process instance, false otherwise. boolean
Upload Properties: Specifies the matching properties to be uploaded with this document NameValuePair[]

Behavior

Auto Upload: Automatically upload dropped files boolean
Auto-Remove Uploaded Files: Remove uploaded files from dropzone boolean
Max File Size (MB): Maximum allowed file size for uploads decimal
File Types Allowed: Select a valid pre-configured file type, or specify custom to specify your own file type. When empty all file types are valid. FileType[]
Type File types allowed for upload. If Custom is selected, allowed file extensions may be specified
{Custom | Excel Files 2003 thru 2007 type xls | Excel Files 2010 and up type xlsx | Word Files 2003 thru 2007 type doc | Word Files 2010 and up type docx | Text Files | Image Files types png, jpg, etc | Video Files types avi, mpeg, mp4, etc | Audio Files types mp3, wav, etc | HTML Files types htm, html}
string
Extension Allowed file extensions. To be used with the Custom type string

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)
BPM File Dropzone

new BPMFileDropzone()

This constructor is never used explicitly.

Extends

Members

Methods

Add/replace CSS class(es) for this control
Name Type Description
name string CSS class name(s) to add to the control. Separate class names by a space if more than one class.
replaced string optional 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");

getSelectedFile(){File}

Returns currently selected file
Returns:
Type Description
File

getType(){string}

Get descriptive string representing the type of control
Returns:
Type Description
string
Hide this view/control
Name Type Description
collapseFlag boolean Set to true to collapse the view (equivalent to a view setting of "NONE")
Example
MyView.hide();

isAssociatedWithProcessInstance(){boolean}

Indicates whether the BPM Attachments are associated with a process instance or not
Returns:
Type Description
boolean
Indicates bound status of control.
Returns:
Type Description
boolean . True if the control is bound to coach data.
Checks if the view is enabled or not
Returns:
Type Description
boolean Enabled status
Example
var enabled = MyView.isEnabled();
Checks if control label is visible
Returns:
Type Description
boolean Label visibility status
Example
var labelVisible = MyView.isLabelVisible();
Checks whether or not view is visible
Returns:
Type Description
boolean Visibility status
Example
var visible = MyView.isVisible();

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
Propagates value change of control up through parent views
Name Type Description
event Event Value change event (usually an onchange event)
Example
MyView.propagateUp(event);

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
Enable/disable this view/control
Name Type Description
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

setLabel(label)

Sets the label for the Browse button
Name Type Description
label String
Show/hide the label of this view/control
Name Type Description
visible boolean Label visibility flag (true to show view label, false to hide)
Example
MyView.setLabelVisible(false);
Show/hide this view/control
Name Type Description
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"
Show this view/control
Example
MyView.show();

startUpload()

Start uploading the document currently selected
Broadcasts the expression trigger for the specified view
Name Type Default Description
phase int bpmext.ui.PHASE_NORMAL optional The phase we are currently in
Example
MyView.triggerFormulaUpdates();

uploadFile(file)

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