You are viewing a plain text version of this content. The canonical link for it is here.
Posted to agila-dev@incubator.apache.org by Glenn J Gonzales <gg...@exist.com> on 2005/01/20 13:07:58 UTC

[PATCH] ActorResolver.java for user/group-actor resolution, notification, task services

I'm submitting a number of patches which includes an actor resolver 
interface that is used to resolve actors to users and/or groups. This 
also includes a patch for the notification and task services that uses 
the resolver, and one for a utility class that starts up the Agila 
engine and sets up the services according to a configuration file.

-- The actor resolver handles the mapping of actors to users and actors 
to groups. I've written a simple implementation that uses a property file.

-- Added the following to TaskService:

    /**
     * Finds out if the task can be performed by the user.
     *
     * @param userID
     * @return true if the task is not locked to another user, or if the 
task has already been
     * assigned to the given user; false otherwise.
     */
    boolean isTaskDoable(TaskID taskID, UserID userID);

This allows the application to query the service if the user can still 
do the task, for example, in the situation where the task has been 
submitted to a group (the actor resolved to a group, so the members of 
the group are able to view it in their task lists), and one of them 
starts the task, and then another tries to do the task again.

-- Added the following to NotificationService:

    /**
     * Create a notification for the actor parameter. Actor may denote a 
single user or a group.
     * If group, notifications will be sent to each member in the group.
     *
     * @param actor
     * @param message
     * @return
     */
    NotificationID[] notify(Actor actor, String message);

Currently the node creates a notification through: 
NotificationService.notify(UserID userId, String message) but where to 
get the user id? The only entity that the node has access to (and which 
makes sense) is the actor, hence this method.

-- Also added the following to TaskService for the same reason:

    /**
     * Assigns a new task to the actor parameter. An actor may resolve 
to an individual user
     * or a group of users.
     *
     * @param tokenId
     * @param message
     * @param actor
     * @param due
     * @return
     */
    TaskID assignTask(TokenID tokenId, String message, Actor actor, Date 
due);

I also overloaded assignTask() to take a group id (changed 
assignTaskToTeam()).


Cheers,
Glenn