Joget Workflow v6 Beta 3 Released

Check out the latest Joget Workflow v6 Beta for many new features and improvements in user experience (UX), app maintainability and performance.

Skip to end of metadata
Go to start of metadata

AssignmentManager

  • URL : /jw/js/json/util.js
  • Auto included in all userview pages.
  • Used to deal with assignment of a logged in user.

completeAssignment(baseUrl, activityId, redirect)

Description

Completes an assignment with a specific process instance id & activity instance id

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • activityId - activity instance id of the assignment to be completed
    • redirect - a URL to redirect to after the assignment is completed (optional)

Sample code  

completeAssignmentWithVariable(baseUrl, activityId, variableData, redirect)

Description

Completes an assignment with a specific process instance id & activity instance id with option to set workflow variables

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • activityId - activity instance id of the assignment to be completed
    • variableData - variables to be set. All variable name must prefix with "var_"
    • redirect - a URL to redirect to after the assignment is completed (optional)

Sample code  

getCurrentUsername(baseUrl, callback)

Description

Gets the current logged in username in Joget Workflow

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • callback - a callback function after a successful call

Sample code  

login(baseUrl, username, password, callback)

Description

Gets the current logged in username in Joget Workflow

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • username - username for user to login
    • password - password for user to login
    • callback - a callback function after a successful call (optional)

Sample code  

loginWithHash(baseUrl, username, hash, callback)

Description

Gets the current logged in username in Joget Workflow

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • username - username for user to login
    • hash - hashed password for user to login.  (refer to Hashed Password)
    • callback - a callback function after a successful call (optional)

Sample code  

logout(baseUrl)

Description

Gets the current logged in username in Joget Workflow

Parameters

Sample code  

withdrawAssignment(baseUrl, activityId)

Description

Withdraws an assignment with a specific activity instance id

Deprecated since v3, the concept of accept & withdraw assignment is removed. 

Parameters

    • baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
    • activityId - activity instance id of the assignment to be withdrawn

Sample code  

ConnectionManager

  • URL : /jw/js/json/util.js
  • Auto included in all userview pages.
  • Convenient method to do AJAX call.

ajaxJsonp(url, callback, params)

Description

Initiates Ajax call with JSONP

Parameters

    • url - URL to initiate Ajax call
    • callback - a callback function after a successful call (optional)
    • params - parameters for the call (optional)

Sample code 

get(url, callback, params, xss)

Description

Initiates Ajax GET to a specific URL

Parameters

    • url - URL for GET action
    • callback - a callback function after a successful call (optional)
    • params - parameters for the call (optional)
    • xss - use when the URL is cross-domain (optional)

Sample code 

post(url, callback, params)

Description

Initiates Ajax POST to a specific URL

Parameters

    • url - URL for GET action
    • callback - a callback function after a successful call (optional)
    • params - parameters for the call (optional)

Sample code 

FormUtil

  • URL : /jw/js/json/formUtil.js
  • Auto included in page using form.
  • Convenient method to interact with form field.

getField(fieldId)

Description

Used to gets the field object of a form field

Parameters

    • fieldId - id of a form field

Sample code 

getFieldsAsUrlQueryString(fields)

Description

Used to generates the fields value as url query parameter string

Parameters

    • fields - an array contains objects with "field", "param" and "defaultValue" attributes.
      - field : id of a form field
      - param : paremeter name to be used
      - defaultValue : value to be used when the field return empty value (Optional)

Sample code 

getGridCells(cellFieldId)

Description

Used to gets the cell objects of every rows of a grid field

Parameters

    • cellFieldId - Grid Field Id and the cell id separated by a dot ".". Eg. gridId.cellId

Sample code 

getGridCellValues(cellFieldId)

Description

Used to gets the cell values of every rows of a grid field and return it in an array.

Parameters

    • cellFieldId - Grid Field Id and the cell id separated by a dot ".". Eg. gridId.cellId

Sample code 

getValue(fieldId)

Description

Used to gets the value of a form field. 

Parameters

    • fieldId - id of a form field

Sample code 

getValues(fieldId)

Description

Used to gets the values of a form field. Values will return in an array. 

Parameters

    • fieldId - id of a form field

Sample code 

JPopup

  • URL : /jw/js/json/ui_ext.js
  • Auto included in all userview pages.
  • Convenient method to create/show/hide a popup dialog to display a page.

create(id, title, width, height)

Description

Used to creates a popup dialog element.

Parameters

    • id - an unique identifier of the popup dialog
    • title - a title to display for on the top of popup dialog (Optional)
    • width - width of the popup dialog box (Optional)
    • height - height of the popup dialog box (Optional) 

Sample code 

hide(id)

Used to hides a created and shown popup dialog element.

Parameters

    • id - an unique identifier of the popup dialog

Sample code 

show(id, url, params, title, width, height, action)

Description

Used to creates a popup dialog element.

Parameters

    • id - an unique identifier of the popup dialog
    • url - an URL of a page to show in popup dialog
    • params - a JSON object to pass parameter and its value (Optional) 
    • title - a title to display for on the top of popup dialog (Optional)
    • width - width of the popup dialog box (Optional)
    • height - height of the popup dialog box (Optional) 
    • action - Get/Post. Default to Post (Optional) 

Sample code 

UI

  • URL : /jw/js/json/ui.js
  • Auto included in all userview pages.
  • Convenient method to retrieve value for UI usages.

adjustPopUpDialog(dialogbox)

Description

Used by system to align the popup dialog to the center of the screen.

Parameters

    • dialogbox - the popup dialog object

Sample code 

escapeHTML(content)

Description

Used to escapes HTML syntax in a value

Parameters

    • content - content to be escapes

Sample code 

getPopUpHeight(height)

Description

Used by the system to calculate the height of a popup dialog for current screen size to support mobile device.

Parameters

    • height - Max height of the popup dialog. Default to "90%".

Sample code 

getPopUpWidth(width)

Description

Used by the system to calculate the width of a popup dialog for current screen size to support mobile device.

Parameters

    • width - Max width of the popup dialog. Default to "90%".

Sample code 

userviewThemeParams()

Description

Used by system to gets the query parameters string that contains the meta of current userview theme in used.

Sample code 

UrlUtil

  • URL : /jw/js/json/util.js
  • Auto included in all userview pages.
  • Convenient method to deal with URL.

constructUrlQueryString(params)

Description

Used to generate a query string based on a parameters object

Parameters

    • params - an object contains all parameter as attribute name and its values in array

Sample code 

encodeUrlParam(url)

Description

Used to encodes the URL parameters in a URL.

Parameters

    • url - URL with parameters to be encode. Note: it use "&" and "=" as separator.

Sample code 

getUrlParams(url)

Description

Used to gets an object contains all parameter as attribute name and its value in an URL. 

Parameters

    • url - URL to be parses to retrieve all parameters and its value in array.

Sample code 

mergeRequestQueryString(queryString1, queryString2)

Description

Used to merge 2 URL query parameters strings into one query string.

Parameters

    • queryString1 - first query parameters string
    • queryString2 - second query parameters string. If a parameter is exist in both query strings, the value in second query string will override the first one.

Sample code 

  • No labels