| Table of Contents |
|---|
ConnectionManager.post(url, callback, params)
Description
Ajax POST to a specific URL
Parameters
- url - URL to POST
- callback - a callback function after a successful POST (optional)
- params - parameters for the POST (optional)
Sample Code
| Code Block |
|---|
var callback = {
success : function(response){
//do something
}
ConnectionManager.post('http://localhost/test', callback, 'id=2')
|
ConnectionManager.ajaxJsonp(url, callback, params)
Description
Initiate 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
| Code Block |
|---|
var callback = {
success : function(response){
//do something
}
}
ConnectionManager.ajaxJsonp('http://localhost/test', callback, 'id=4')
|
ConnectionManager.get(url, callback, params, xss)
Description
Ajax GET to a specific URL
Parameters
- url - URL to GET
- callback - a callback function after a successful GET (optional)
- params - parameters for the GET (optional)
- xss - use when the URL is cross-domain (optional)
Sample Code
| Code Block |
|---|
var callback = {
success : function(response){
//do something
}
}
ConnectionManager.get('http://localhost/test', callback, 'id=6')
|
AssignmentManager.getCurrentUsername(baseUrl, callback)
Description
Get the current logged in username in Joget Workflow
Parameters
- baseUrl - base URL of Joget Workflow, eg. 'http://localhost/jw'
- callback - a callback function after a successful call (optional)
Sample Code
| Code Block |
|---|
var callback = {
success : function(response){
//response.username
}
}
AssignmentManager.getCurrentUsername('http://localhost/jw', callback);
|
AssignmentManager.login(baseUrl, username, password, callback)
Description
Login / Single Sign On (SSO) to Joget Workflow with username & password
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 login (optional)
Sample Code
| Code Block |
|---|
var callback = {
success : function(response){
//do something
}
}
AssignmentManager.login('http://localhost/jw', 'admin', 'admin', callback);
|
AssignmentManager.login(baseUrl, username, hash, callback)
Description
Login / Single Sign On (SSO) to Joget Workflow with username & hashed password
Parameters
- baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
- username - username for user to login
- hash - hashed password (refer to Hashed Password)
- callback - a callback function after a successful login (optional)
Sample Code
| Code Block |
|---|
var callback = {
success : function(response){
//do something
}
}
AssignmentManager.login('http://localhost/jw', 'admin', '14ACD782DCFEB2BCDE2B271CCD559477', callback);
|
AssignmentManager.logout(baseUrl)
Description
Logout the user in Joget Workflow
Parameters
- baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
Sample Code
| Code Block |
|---|
AssignmentManager.logout('http://localhost/jw');
|
AssignmentManager.withdrawAssignment(baseUrl, activityId)
Description
Withdraw an assignment with a specific activity instance id
Parameters
- baseUrl - base URL of Joget Workflow, e.g., 'http://localhost/jw'
- activityId - activity instance id of the assignment to be withdrawn
Sample Code
| Code Block |
|---|
AssignmentManager.withdrawAssignment('http://localhost/jw', '1_1_activity');
|
AssignmentManager.completeAssignment(baseUrl, activityId, redirect)
Description
Complete 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
| Code Block |
|---|
AssignmentManager.completeAssignment('http://localhost/jw', '1_1_activity', 'http://localhost/completed.jsp');
|
AssignmentManager.completeAssignmentWithVariable(baseUrl, activityId, variableData, redirect)
Description
Complete 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
- variableData - Joget Workflow variable data to be updated for the assignment
- redirect - a URL to redirect to after the assignment is completed (optional)
Sample Code
| Code Block |
|---|
AssignmentManager.completeAssignmentWithVariable('http://localhost/jw', '1_1_activity', 'status=new&id=123', 'http://localhost/completed.jsp');
|
UrlUtil.encodeUrlParam(url)
Description
Encoding URL with parameters
Parameters
- url - URL to be encoded
Sample Code
| Code Block |
|---|
UrlUtil.encodeUrlParam('http://localhost/test?id=123#4#5678&status=abc efg');
|
getUrlParam(paramName)
Description
Get the value of a URL parameter
Parameters
- paramName - name of the parameter to get
Sample Code
If the current URL is
| Code Block |
|---|
getUrlParam('id')
|
will return 123, while
| Code Block |
|---|
getUrlParam('page')
|
will return 2