com.bea.wli.worklist.api.taskplan
Interface TaskPlanRegistry


public interface TaskPlanRegistry

A registry of task plans known to the worklist system. All task plans have a globally unique identifier (within any given WLI server). Note that we assume that TaskPlan, and TaskPlanRegistry may be available on the server system classpath, and thus shared between all applications in the server. We also assume this may not be the case, and all applications may load their own version of these classes.

For any given WLS server instance, any number of Worklist system instances may be active at any given time. Each instance of the Worklist system refers to a single instance of TaskPlanRegistry. There may be one or more actual instances of a task plan registry in a server, depending on the implementation. Thus, all that can be said for certain is that each instance of Worklist system sees only one instance of TaskPlanRegistry, and that all clients of that Worklist system instance will see the same task plans.

All task plans are deployed as part of a host application. Task plans are visible to any client using the same instance of the Worklist system being used by the host application.

Note that host applications themselves can be versioned and multiple versions of a host app may be deployed in a single server at the same time. Task plan developers/deployers should ensure that any new version of a host application contains task plans with appropriate versions. If the task plans within the new version of an application have not changed, there is no need to change the version of the task plans within the application. However, if the task plans have changed in the new version of the application, the version numbers of the task plans must change to reflect this.

At runtime, task plan references given by name and version are resolved to server-wide unique identifiers that include the name and version of the host application. Thus, if two versions of an application contain the same version of a task plan, at runtime, the resolved unique id for the task plan will contain the id of either one of the host application versions. If the resolved-to version of the application is undeployed, the registry will automatically begin resolving task plans from the undeployed app using the latest remaining version of the application (if any).


Method Summary
 void deregisterTaskPlan(TaskPlanId taskPlanId)
           
 String[] getHostApplicationNames()
          Get a list of names representing all the applications that are known to host one or more task plans.
 float getLatestTaskPlanVersion(TaskPlanPath path, float minVersion)
          Get the latest version of the task plan that is equal to or greater than the given minimum version.
 com.bea.wli.path.FolderPath[] getRootFolders()
          Return an array of FolderPaths representing the top-level folders in the correlation hierarchy formed from the paths of all registered task plans.
 com.bea.wli.path.FolderPath[] getSubFolders(com.bea.wli.path.FolderPath folder)
          Get the folders contained in the folder given by folder.
 TaskPlan getTaskPlan(TaskPlanId id)
          Get a task plan given its id.
 TaskPlan getTaskPlan(TaskPlanPath path)
          Get the latest version of the task plan with the given path.
 TaskPlanId[] getTaskPlanIds(String appName)
          Get all the task plans that were deployed within/from the given host application.
 TaskPlanId[] getTaskPlanIds(String appName, String version)
          Get all the task plan that were deployed within the given host application and version.
 TaskPlan[] getTaskPlansInFolder(com.bea.wli.path.FolderPath folder)
          Get all registered task plans that exist in the given folder.
 void registerTaskPlan(TaskPlan taskPlan)
           
 

Method Detail

getTaskPlanIds

TaskPlanId[] getTaskPlanIds(String appName)
                            throws RemoteException
Get all the task plans that were deployed within/from the given host application.

Parameters:
appName - The name of the application to search for task plans. If this name contains version information for the application, the specific version indicated will be searched. Otherwise, the most recent version of the application deployed to the server is searched. To retrieve all task plans from all applications visible to this registry, pass appName as null. Note, the visible applications are the ones that have deployed a task plan into this registry (and this is not necessarily all apps in the server).
Returns:
A list of task plan ids representing the latest version of all the task plans visible from the given application.
Throws:
RemoteException

getTaskPlanIds

TaskPlanId[] getTaskPlanIds(String appName,
                            String version)
                            throws RemoteException
Get all the task plan that were deployed within the given host application and version.

Parameters:
appName - The name of the application to search for task plans. If this name contains version information for the application, the specific version indicated will be searched. Otherwise, the most recent version of the application deployed to the server is searched. To retrieve all task plans for all applications call getTaskPlanIds(String appName) instead, and pass appName as null. In this case, the version parameter is ignored and assumed to be null.
version - The specific version of the application to search for task plans. If appName is null, version is ignored and assumed to be null.
Returns:
A list of task plan ids representing the latest version of all the task plans visible from the given application.
Throws:
RemoteException

getTaskPlan

TaskPlan getTaskPlan(TaskPlanId id)
                     throws UnknownObjectException,
                            RemoteException
Get a task plan given its id. If the id does not contain any version information (version == 0f), the latest version is returned. If the id does contain version information (version > 0f), the specific version of the task plan is returned.

If the id contains a hostApplicationId, and this id is not the same as the current host application id, this method passes through to the task type registry for the indicated host application.

You can retrieve a task plan given the name of the task plan.

   TaskPlanPath taskPlanPath =
     new TaskPlanPath("/MyTaskPlans/MyFirstTaskPlan");

   InitialContext jndiContext = new InitialContext();
   TaskPlanRegistry registry =
     WorklistContextFactory.getRemoteWorklistContext(jndiContext);
   TaskPlan myTaskPlan = registry.getTaskPlan(taskPlanPath);
 

You can retrieve a task plan of a specific version by doing this:

   TaskPlanPath taskPlanPath =
     new TaskPlanPath("/MyTaskPlans/MyFirstTaskPlan");

   InitialContext jndiContext = new InitialContext();
   TaskPlanRegistry registry =
     WorklistContextFactory.getRemoteWorklistContext(jndiContext);

   // We'll find the latest version. If you know the version you want,
   // you can skip this step
   float taskPlanVersion = registry.
     getLatestTaskPlanVersion(taskPlanPath, 0f);

   // Construct a fully qualified ID by which to fetch the task plan
   ID id = new TaskPlan.ID(taskPlanPath, taskPlanVersion);

   // Get it by ID
   TaskPlan myTaskPlan = registry.getTaskPlan(id);
 

Parameters:
id - The id (contains path and version information) of the task plan to retrieve.
Returns:
The task plan matching the id given.
Throws:
UnknownObjectException - If no task plan with the given id or name could be found.
RemoteException

getLatestTaskPlanVersion

float getLatestTaskPlanVersion(TaskPlanPath path,
                               float minVersion)
                               throws UnknownObjectException,
                                      RemoteException
Get the latest version of the task plan that is equal to or greater than the given minimum version.

Parameters:
path - The TaskPlanPath of the task plan for which this method will search.
minVersion - The minimum version to consider in the search. Pass as 0 to bypass any minimum version checking and retrieve the latest known version.
Returns:
The latest version of the given task plan meeting the minVersion criterion.
Throws:
UnknownObjectException - If a task plan with the given path meeting the minVersion criteria could not be found.
RemoteException

getTaskPlan

TaskPlan getTaskPlan(TaskPlanPath path)
                     throws UnknownObjectException,
                            RemoteException
Get the latest version of the task plan with the given path. This is equivalent to the following code:

   InitialContext jndiContext = new InitialContext();
   TaskPlanRegistry registry =
     WorklistContextFactory.getRemoteWorklistContext(jndiContext);

   TaskPlanPath taskPlanPath = "/MyTaskPlans/MyFirstTaskPlan");
   float version = registry.getLatestTaskPlanVersion(taskPlanPath, 0f);
   TaskPlan.ID id = new TaskPlan.ID(taskPlanPath, version);

   TaskPlan myTaskPlan = registry.getTaskPlan(id);
 

Parameters:
path - The TaskPlanPath of the task plan.
Returns:
The task plan matching the path given.
Throws:
UnknownObjectException - If no task plan with the given path could be found.
RemoteException

getHostApplicationNames

String[] getHostApplicationNames()
                                 throws RemoteException
Get a list of names representing all the applications that are known to host one or more task plans.

Returns:
The names for all applications that have registered at least one task plan.
Throws:
RemoteException - If any communication error occurs.

getTaskPlansInFolder

TaskPlan[] getTaskPlansInFolder(com.bea.wli.path.FolderPath folder)
                                throws RemoteException
Get all registered task plans that exist in the given folder. The union of all paths from all registered task plans form a logical file system that can contain only task plans. This method effectively allows you to read task plans back out of that file system given a location within it.

Parameters:
folder - The FolderPath of the folder from which to search for task types.
Returns:
The task plans that exist in the given folder. If no task plans exist in this folder, or the folder does not exist, an empty array is returned.
Throws:
RemoteException - If any communication error occurs.

getRootFolders

com.bea.wli.path.FolderPath[] getRootFolders()
                                             throws RemoteException
Return an array of FolderPaths representing the top-level folders in the correlation hierarchy formed from the paths of all registered task plans.

Returns:
The top-level folders across all registered task plans.
Throws:
RemoteException

getSubFolders

com.bea.wli.path.FolderPath[] getSubFolders(com.bea.wli.path.FolderPath folder)
                                            throws RemoteException
Get the folders contained in the folder given by folder.

Parameters:
folder - The FolderPath for the folder to search for subfolders.
Returns:
An array of FolderPaths representing the absolute path to the sub folders contained in the given folder. The array element values are suitable for direct use in a subsequent call to getTaskPlansInFolder() or getSubFolders().
Throws:
RemoteException - If any communication error occurs.

registerTaskPlan

void registerTaskPlan(TaskPlan taskPlan)
                      throws RemoteException
Throws:
RemoteException

deregisterTaskPlan

void deregisterTaskPlan(TaskPlanId taskPlanId)
                        throws RemoteException
Throws:
RemoteException