- 1. Overview
- 2. Process Functions
- 3. Task Functions
- 4. Dynaform and Field Functions
- 5. Case Functions
- 6. Case Routing Functions
- 7. Case Notes Functions
- 8. User Functions
- 9. Group Functions
- 10. Email Functions
- 11. Document Functions
- 12. Unique ID Functions
- 13. Date Functions
- 14. String Functions
- 15. Database Functions
- 16. Grid Functions
Task Functions
PMFTaskList()
PMFTaskList()
returns the list of tasks the specified user has initiated.
Parameters:
- string userId: The unique ID of a user.
Return value:
An array of tasks, with the following structure:
Where:
- string guid: The unique ID of a task.
- string name: The name of a task.
- string processId: The unique ID of the process.
- int initialTask: Set to 1 if the task is an initial task. Otherwise, set to 0.
Example:
Get the unique ID of the task whose name is "Verify Data" and place it in the @@taskId variable:
foreach ($aTasks as $aTask) {
if ($aTask['name'] === 'Verify Data')
@@taskId = $aTask['guid'];
}
PMFTasksListByProcessId()
PMFTasksListByProcessId()
retrieves the UID and the names of all the tasks in a Process.
Parameters:
- string processUID: (Required) The unique ID of the process, which can be found in the following ways:
- Use the
@@PROCESS
system variable to get the unique ID of the current process. - Use the PMFProcessList() function or processList() web service.
- Query the wf_<WORKSPACE>.PROCESS.PRO_UID field in the database or use a query like:
SELECT PRO_UID FROM PROCESS WHERE PRO_TITLE = 'Expense Report Process'
- Use the
- string Language: (Required) The language used to display the name of the task. If not included, it will be English ('en') by default.
Return Value:
An array of associative arrays. Each one of these arrays contains the UID and the name of each task in the process. The array has the following structure:
Example:
In this case, the return value stored in @@ArrayTasks
will show the following information:
PMFGetTaskName()
PMFGetTaskName()
retrieves the name of a task using the unique ID of the task and given language.
Parameters:
- string taskId: The unique ID of the task, which can be found in the following ways:
- Use the
@@TASK
system variable to get the unique ID of the current task. - Use the PMFTaskList() function or taskList() web service.
- Query the wf_<WORKSPACE>.TASK.TAS_UID field in the database with executeQuery().
- Use the
- string Language: Optional parameter. The language in which the task name will be retrieved. If not specified then the default system language is used.
Note: Please take into account that returned values directly depend on the current data stored in the wf_<WORKSPACE>.TASK table, and more specifically records related to task titles (TAS_TITLE)
.
Return value:
- string: The function returns the name of the task.
Example:
The returned value stored in @@taskName
will be "Recibir Factura"
.
PMFGetTaskUID()
PMFGetTaskUID()
retrieves the unique ID of a task using the task name and, if required, the unique ID of the process.
Parameters:
- string taskName: The name of the task. Remember that task names are case sensitive and can contain spaces.
- string processUID: (Optional) The unique ID of the process, where the task is found. If not included or set to null, then assumes that the task is located in the current process. The process UID can be found in the following ways:
- Use the
@@PROCESS
system variable to get the unique ID of the current process. - Use the PMFProcessList() function or processList() web service.
- Query the wf_<WORKSPACE>.PROCESS.PRO_UID field in the database or use a query like:
SELECT PRO_UID FROM PROCESS WHERE PRO_TITLE = 'Receive Invoice'
- Use the
- string taskUID: The unique ID of the task, which can be found in the following ways:
- Use the
@@TASK
system variable to get the unique ID of the current task. - Use the PMFTaskList() function or taskList() web service.
- Query the wf_<WORKSPACE>.TASK.TAS_UID field in the database or get the starting task of the current process with the following query:
- Use the
-
string userGroupUID: The unique ID of a group, which can be found in the following ways:
- Use the PMFGroupList() or WSGroupList() functions or the groupList() web service.
- Query the wf_<WORKSPACE>.GROUPWF.GRP_UID field in the database.
- Use the query:
SELECT GRP_TITLE, GRP_UID FROM GROUPWF
- string taskUID: The unique ID of the task a user or group will be removed from, which can be found in the following ways:
- Use the
@@TASK
system variable to get the unique ID of the current task. - Use the PMFTaskList() function or taskList() web service.
- Query the wf_<WORKSPACE>.TASK.TAS_UID field in the database or get the starting task of the current process with the following query:
executeQuery("SELECT TAS_UID FROM TASK WHERE PRO_UID='" . @@PROCESS . "' AND TAS_START='TRUE'");
- Use the
-
string userGroupUID: The unique ID of a user or group that will be removed from the list of assignees, which can be found in the following ways:
- Use the PMFGroupList() or WSGroupList() functions or the groupList() web service.
- Query the wf_<WORKSPACE>.GROUPWF.GRP_UID field in the database.
- Use the query:
SELECT GRP_TITLE, GRP_UID FROM GROUPWF
Return value:
The function returns the unique ID of the task (which is a string of 32 hexadecimal numbers). If not found, then it returns false
.
Example:
The returned value stored in @@taskUID
will be '52043657456d5f00ed2e468062806376'
.
PMFAddUserGroupToTask()
PMFAddUserGroupToTask()
adds a user or group to the list of users assigned to a task. Note that if the user or group is already assigned then it cannot be assigned again. This function defines internally if the sent UID is from a user or a group.
Parameters:
Return Value:
Returns 1 if the user/group was assigned successfully; otherwise, returns 0 if an error occurred.
PMFRemoveUserGroupFromTask()
PMFRemoveUserGroupFromTask()
removes a user or group from the list of users assigned to a task. This function defines internally if the sent UID is from a user or a group.
Parameters:
Return Value:
Returns 1 if the user/group was assigned successfully; otherwise, returns 0 if an error occurred.