Class: Service

Service

A service layer javascript class used to make calls to LiveCycle Server over REST endpoints.

Methods

abandon(taskId, successHandler, faultHandler)

Deletes a task created from or saved from the startpoint class.
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails.. If not specified, the default fault handler will invoke.

claim(taskId, lockTask, successHandler, faultHandler)

Claims a task available in the shared queue.
Parameters:
Name Type Argument Description
taskId Number Task ID.
lockTask Boolean When true, the task will be locked
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails.. If not specified, the default fault handler will invoke.

complete(taskId, routeName, successHandler, faultHandler)

Complete a task and task is passed to next step as per process design.
Parameters:
Name Type Argument Description
taskId Number Task ID
routeName String Name of the route selected to complete the task
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

consult(taskId, userOid, successHandler, faultHandler)

Consults a task with another user
Parameters:
Name Type Argument Description
taskId Number Task ID.
userOid String Oid of the user with whom the task will be consulted.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

cqLogOut(successHandler, faultHandler)

Logs out from AEM
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

deleteAttachment(taskId, attachmentId, successHandler, faultHandler)

Deletes an attachment of a task
Parameters:
Name Type Argument Description
taskId Number Task ID.
attachmentId Number Attachment ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

findTasksJson(searchFilterJson, successHandler, faultHandler)

Searches and returns a list of all tasks satisfying all conditions of a search template.
Output:
  • result : List of task objects.
Parameters:
Name Type Argument Description
searchFilterJson String A set of criteria for filtering tasks, task attributes to be shown, and attributes to sort the result.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

forward(taskId, userOid, successHandler, faultHandler)

Forward a task to another user
Parameters:
Name Type Argument Description
taskId Number Task ID.
userOid String Oid of the user to whom the task will be forwarded
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

forwardTaskOfDirectReport(taskId, userOid, directReportOid, successHandler, faultHandler)

Forwards a task of a direct/indirect report to another user. The user specified by directReportOid must be a direct/indirect report of the user calling this API for the call to be successful.
Parameters:
Name Type Argument Description
taskId Number Task ID.
userOid String Oid of the user to whom the task will be forwarded
directReportOid String Oid of the direct/indirect report who currently owns the task
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllAttachments(taskId, successHandler, faultHandler)

Fetches all attachments and notes for a task. Output of this call is:
  • result.newOrUpdatedAttachments: List of attachment objects.
  • result.unchangedAttachmentIds : List of attachment IDs sent from the clients that are unchanged.
  • result.removedAttachmentIds : List of attachment IDs sent from the clients that are no longer present on the server.
Parameters:
Name Type Argument Description
taskId Number Task ID.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllProcesses(successHandler, faultHandler)

Return a list of all the processes.
Output:
  • result : List of process objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllQueues(successHandler, faultHandler)

Get list of all the queues (own, shared, and group queues) accessible to a logged in user.
Output:
  • result : List of queue objects.
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllSearchTemplates(successHandler, faultHandler)

Returns a list of all search templates.
Output:
  • result : List of search template objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllStartpoints(successHandler, faultHandler)

Fetches a list of all startpoints present on the server under all categories.
Output:
  • result : List of startpoint objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAllTasks(localTasks, successHandler, faultHandler)

Fetches all the tasks that are created and forwarded or consulted, saved, assigned, and assigned and saved for a logged in user.
Output:
  • result.newOrUpdatedTasks : List of task objects
  • result.unchangedTaskIds : List of task IDs sent from the clients that are unchanged.
  • result.removedTaskIds : List of task IDs sent from the clients that are no longer present on the server.
Parameters:
Name Type Argument Description
localTasks Map Task ID vs update time map of tasks present on client.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAssignmentsForTask(taskId, successHandler, faultHandler)

Gets a list of all the assignments for a task. For example, if a user forwards or consults a task with another user, it is an assignment for a task.
Output:
  • result : List of assignment objects for a task
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getAttachment(taskId, attachmentId, successHandler, faultHandler)

Returns the url of the attachment of a task, if available
Output:
  • result.url : Url of specific attachment.
Parameters:
Name Type Argument Description
taskId Number Task ID
attachmentId Number Attachment ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getCurrentUserImageUrl(successHandler, faultHandler)

Gets the URL for the image of the logged in user
Output:
  • result : Image url for logged in user.
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getDirectChildCategories(name, id, description, oid, parentOid, successHandler, faultHandler)

Fetches a list of all direct children for a category.
Output:
  • result : List of category objects
Parameters:
Name Type Argument Description
name String Name of the category
id String Category ID
description String Description of the category
oid Number Category Oid
parentOid Number Parent category Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getGrantedUsers(successHandler, faultHandler)

Returns a list of all the users who have access to the queue of logged in users.
Output:
  • result : List of user objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getImageURL(imageTicket) → {String}

Creates and returns the url of the image for tasks and startpoints.
Parameters:
Name Type Description
imageTicket String
Returns:
URL of the image
Type
String

getLocalizationData(successHandler, faultHandler)

Returns browser locale
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getNewHtmlFormData(taskId, successHandler, faultHandler)

Returns data for new HTML form
Output:
  • result : Data of new HTML form.
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getOutOfOfficeSettings(userOid, successHandler, faultHandler)

Gets out of office settings of a user
Output:
  • result : Object containing out of office settings of a user.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getParticipatedProcesses(successHandler, faultHandler)

Returns a list of all process names participated by the logged in user.
Output:
  • result : List of process objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getPendingTasksForProcessInstance(processInstanceId, successHandler, faultHandler)

Gets a list of pending tasks for a process instance
Output:
  • result : List of task objects.
Parameters:
Name Type Argument Description
processInstanceId Number Process instance ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getProcessInstance(processInstanceId, serviceName, successHandler, faultHandler)

Fetches details of a process instance
Output:
  • result : Object containing details of process instance
Parameters:
Name Type Argument Description
processInstanceId Number Process instance ID
serviceName String Name of the service for process instance
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getProcessInstances(processName, successHandler, faultHandler)

Fetches all process instances for a process
Output:
  • result : List of process instance objects
Parameters:
Name Type Argument Description
processName String Name of the process
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getProperties(paths, successHandler, faultHandler)

Returns all Workspace properties for a user
Output:
  • properties : Map of property name and its corresponding value for all Workspace properties at a specified path for a user
Parameters:
Name Type Argument Description
paths String Properties path
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getRootEndpointCategories(successHandler, faultHandler)

Fetches a list of all the root categories present on the server
Output:
  • result : List of category objects
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getTask(taskId, successHandler, faultHandler)

Fetches a specific task
Output:
  • result : Task object corresponding to specified task ID
Parameters:
Name Type Argument Description
taskId Number Task ID.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getTaskOfDirectReport(taskId, directReportOid, successHandler, faultHandler)

Returns tasks of a specified direct/indirect report of the logged in Manager. The user specified by directReportOid must be a direct/indirect report of the user calling this API for the call to be successful.
Output:
  • result : Task object.
Parameters:
Name Type Argument Description
taskId Number Task ID.
directReportOid String Oid of the direct/indirect report
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getTasksForDirectReports(managerOid, successHandler, faultHandler)

Returns a list of objects. Each object contains:
  • userName : Name of the direct report
  • userOid : Oid of the direct report
  • userTasks : List of task objects of the direct report
Parameters:
Name Type Argument Description
managerOid String Oid of the Manager.
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getTasksForProcessInstance(processInstanceId, successHandler, faultHandler)

Gets a list of all the tasks for a process instance
Output:
  • result : List of task objects
Parameters:
Name Type Argument Description
processInstanceId Number Process instance ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getTemplate(searchTemplateId, successHandler, faultHandler)

Returns the content for a search template
Output:
  • result.template : Content for a search template as XML string
Parameters:
Name Type Argument Description
searchTemplateId Number Search template ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getUserImageUrl(principalOid, successHandler, faultHandler)

Gets the image url for the specified user.
Output:
  • result : Image url for the specified user
Parameters:
Name Type Argument Description
principalOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getUsers(commonNameFilter, successHandler, faultHandler)

Searches users. it returns a list of all the users if nothing specified, else returns users with the specified name.
Output:
  • result : List of user objects
Parameters:
Name Type Argument Description
commonNameFilter String Name of the user
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getUsersForAccessibleQueues(userOid, successHandler, faultHandler)

Returns a list of all the users whose queue is accessible to a user.
Output:
  • result : List of user objects.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

getUsersInGroup(groupOid, commonNameFilter, successHandler, faultHandler)

Searches users in a group. It returns a list of all the users if nothing specified, else returns users with specified name in a group.
Output:
  • result : List of user objects.
Parameters:
Name Type Argument Description
groupOid String Group Oid
commonNameFilter String Name of the user
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

grantQueueAccess(userOid, successHandler, faultHandler)

Grants access of a logged in user's queue to the specified user. It is basically sharing own queue with another user.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

initialize(assertionId, renewAssertion, serverUrl, clientId, successHandler, faultHandler)

Renews assertion, if necessary. Authenticates a user. Sets session parameters for server-client information. Returns user information, polling interval, build information, and session timeout in seconds.
Output:
  • result : Object containing user information, polling interval, build information and session timeout in seconds.
Parameters:
Name Type Argument Description
assertionId String LC UM SAML assertion id
renewAssertion Booelan true to renew assertion, false otherwise.
serverUrl String Url of the LiveCycle server
clientId String Client ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

invokeStartpoint(startpointId, successHandler, faultHandler)

Invokes a Startpoint, creates a new task corresponding to a starpoint, and returns the created task.
Output:
  • result : Task object created.
Parameters:
Name Type Argument Description
startpointId Number Startpoint ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

lock(taskId, successHandler, faultHandler)

Locks a task so that it can not be claimed by another user, if shared.
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

prepareForSubmit(taskId, successHandler, faultHandler)

Sets the task ID in a session variable (along with expiry time) which is retrieved during the actual submit. It is called before submitting the form via DocumentSubmitServlet.
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

reject(taskId, successHandler, faultHandler)

Returns a task to the previous owner of task
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

rejectTaskOfDirectReport(taskId, directReportOid, successHandler, faultHandler)

Returns a task of a direct/indirect report to the previous user. The user specified by directReportOid must be a direct/indirect report of the user calling this API for the call to be successful.
Parameters:
Name Type Argument Description
taskId Number Task ID
directReportOid String Oid of direct/indirect report who currently owns this task
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

removeProperty(name, successHandler, faultHandler)

Removes a Workspace property for a user
Parameters:
Name Type Argument Description
name String Name of the property
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

removeQueueAccess(userOid, successHandler, faultHandler)

Removes a user from the list of users whose queue is accessible to a logged in user.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

renderTask(taskId, taskItemIndex, params, successHandler, faultHandler)

Renders a task and returns information needed to render form like form url, form type, and data url, if needed
Output:
  • result : Object of information needed to render form like form url, form type, and data url, if needed
Parameters:
Name Type Argument Description
taskId Number Task ID
taskItemIndex Number For tasks in ES2 onwards, the value is 0
params Object Client parameters for rendering the task
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

requestQueueAccess(userOid, successHandler, faultHandler)

Makes access request for a queue of the specified user for a logged in user. If the user approves the request, her queue is shared with the logged in user.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

revokeQueueAccess(userOid, successHandler, faultHandler)

Removes a user from the list of users who have access to the queue of the logged in user.
Parameters:
Name Type Argument Description
userOid String User Oid
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

save(taskId, data, successHandler, faultHandler)

Saves a task on server
Parameters:
Name Type Argument Description
taskId Number Task ID
data String XML data string containing form data
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

saveOutOfOfficeSettingsJson(outOfOfficeInfoJson, successHandler, faultHandler)

Saves out of office settings of a user
Parameters:
Name Type Argument Description
outOfOfficeInfoJson String Out of office settings user wants to save on the server
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

setProperty(name, value, successHandler, faultHandler)

Sets a Workspace property for a user
Parameters:
Name Type Argument Description
name String Name of the property
value String Value of property
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

setVisibility(taskId, visible, successHandler, faultHandler)

Sets visibility of a task. If the visibility is set to false, the task will not be visible to user.
Parameters:
Name Type Argument Description
taskId Number Task ID.
visible Boolean false for the task to be invisible in future, true otherwise
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

share(taskId, userOid, successHandler, faultHandler)

Shares a task with another user. Another user can claim the task and become owner of the task.
Parameters:
Name Type Argument Description
taskId Number Task ID
userOid String Oid of user with whom the task will be shared
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

submitWithData(taskId, dataString, successHandler, faultHandler)

Submits the form data (passed as string) associated with a task using TaskManager's submit API. It is used for Flex forms which do not call TaskManager's submit API.
Parameters:
Name Type Argument Description
taskId Number Task ID
dataString String XML data string containing form data
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

submitWithPriorData(taskId, key, successHandler, faultHandler)

Returns the result of TaskManager's submit API using the result key
Parameters:
Name Type Argument Description
taskId Number Task ID
key String Submit key returned from the server after submitting form data
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

umLogOut(successHandler, faultHandler)

Logs out from LiveCycle UM
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

umReLogin(successHandler, faultHandler)

Logs in to LiveCycle UM
Parameters:
Name Type Argument Description
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

unlock(taskId, successHandler, faultHandler)

Unlocks a task
Parameters:
Name Type Argument Description
taskId Number Task ID
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.

uploadNote(data, successHandler, faultHandler)

Uploads a note on the server for a task
Parameters:
Name Type Argument Description
data String Note's data to be saved on the server
successHandler function Function to be executed when the call succeeds
faultHandler function <optional>
Function to be executed when the call fails. If not specified, the default fault handler will invoke.