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
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[]
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 Selected:
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 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 BPMFileUploader()

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");

getColorStyle(){string}

Gets color style of the upload button. NOTE: This always returns the color as set, to avoid ambiguity always set the color using "D"|"P"|"I"|"S"|"W"|"E"
Returns:
Type Description
string

getFileName(){string}

Get name of file currently in process designer
Returns:
Type Description
string

getShapeStyle(){string}

Gets shape style of the upload button. NOTE: This always returns the shape style as set, to avoid ambiguity always set the shape style using "D"|"R"|"F"
Returns:
Type Description
string

getSizeStyle(){string}

Gets size style of the upload button. NOTE: This always returns the size style as set, to avoid ambiguity always set the size style using "D"|"S"|"L"|"X"
Returns:
Type Description
string

getText(){string}

Get text of the upload button
Returns:
Type Description
string

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

setColorStyle(style)

Sets color style of the upload button. NOTE: to avoid ambiguity always set the color using "D"|"P"|"I"|"S"|"W"|"E"
Name Type Description
style string "DEFAULT"|"DEF"|"D"=Default | "PRIMARY"|"PRI"|"P"=Primary | "INFO"|INF"|"I"=Info | "SUCCESS"|"S"=Success | "WARNING"|"WARN"|"W"=Warning | "DANGER"|ERROR|ERR"|"G"|"E"=Danger

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

setIcon(icon)

Sets icon to display on the upload button
Name Type Description
icon string visit http://fontawesome.io/icons/ for icon options

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);

setOutline(outline)

Sets outline style of the upload button
Name Type Description
outline boolean {true | false}

setShapeStyle(style)

Sets shape style of the upload button. NOTE: to avoid ambiguity always set the shape style using "D"|"R"|"F
Name Type Description
style string "Default"|"D"=Default | "ROUNDED"|ROUND"|"R"=Rounded | "FLAT"|"F"=Flat

setSizeStyle(style)

Sets size style of the upload button. NOTE: to avoid ambiguity always set the size style using "D"|"S"|"L"|"X"
Name Type Description
style string "DEFAULT"|"DEF"|"NORMAL"|"D"=Default | "SMALL"|"S"=Small | "LARGE"|"L"=Large | "EXTRA-SMALL"|"X-SMALL"|"XS"|"X"=X-small

setText(text)

Set text of button
Name Type Description
text string Text to be set on the button

setUploadProperties(propNames, propVals)

Set upload property names and values. Length of parameter lists must be equal
Name Type Description
propNames Array.<string> Property names
propVals Array.<ANY> Values for each property name
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