Tasks are prioritized teamspace activities that may be scheduled by any teamspace member. Tasks remain open until marked complete by either the assignee or another member of the teamspace with appropriate rights, and may be reopened at any point after completion.
The Collaboration API contains elements that developers can use to create, access, and manage tasks from within FileNet P8 applications. Key task elements are:
A task comprises the following basic information:
A task is opened when the above information is added to a TaskInfo object and passed to a FolderContainer object.
Tasks are created and maintained within a _tasks folder, a subfolder of a teamspace's _internal folder. The _tasks folder implements the FolderContainer interface (an extension of the Container interface) and is based on the containment capabilities of a Content Engine Folder object.
The tasks folder is accessed through any of the following ContainerManager methods:
Collaboration.COLLABORATION_TASKS_CONTAINER_DEFID
. Collaboration.TYPE_TASK
; the id must be a GUID of a CollaborationTask Content Engine object.A new Task object is created when a TaskInfo object is passed to the FolderContainer object's addSubContainer method, as described in the code below.
The following code describes how a Task object might be created in a known object store and teamspace. For information on teamspace objects, see Teamspaces; for information on creating and managing object stores, see the Content Java API topic, Working With Object Stores.
// pass basic task data to a new TaskInfo object
TaskInfo taskInfo = new TaskInfo(assigneeID, taskTitle, taskDescription);
ContainerManager containerManager = teamSpace.getContainerManager();
FolderContainer taskContainer = (FolderContainer)
containerManager.getContainerByDefinitionID (Collaboration.COLLABORATION_TASK_CONTAINER_DEFID);
Task taskObject = taskContainer.addSubContainer(taskInfo);
For information on how tasks are created and managed within the FileNet P8 TCM application, see Overview of Tasks.