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/22 06:42:48 UTC

[PATCH] user service

Here's a patch for the UserService, along with a file properties 
implementation. Also included is a file properties implementation of the 
ActorResolver patch I submitted earlier. These are sample 
implementations to show the intent of the changes. I can submit the 
memory and dao implementations if necessary.

What's changed is that the user service methods are now only getXXX 
methods, because (as Geir mentioned before), the service is only 
involved with providing user info to the bpm system and not in managing 
it, although an implementation could decide to do that also. Not all of 
the methods are necessary (as for example, if you have a system that has 
only users and no grouping, or vice versa), but are provided for 
flexibility.  I also added the GroupInfo class, extended from Info, to 
provide the group data. The UserInfo was also changed to extend Info.

in UserService.java:
    /**
     * Get the group info given a group principal name.
     *
     * @param principalName
     * @return the GroupInfo of the group associated with 
<code>principalName</code>
     */
    public GroupInfo getGroupFromPrincipal(String principalName);

    /**
     * Get all group infos from this service.
     *
     * @return a list of GroupInfo of all groups in this service.
     */
    public List listAllGroupInfo();

    /**
     * Get the users that belong to a given group.
     *
     * @param groupId
     * @return array of UserInfo of users belonging to group with id 
<code>groupId</code>.
     */
    public UserInfo[] getUsers(GroupID groupId);

    /**
     * Get the groups that this user belongs to.
     *
     * @param userId
     * @return array of GroupInfo of groups that have the user with id 
<code>userId</code> as a member.
     */
    public GroupInfo[] getGroups(UserID userId);

    /**
     * Get the user info given the username.
     *
     * @param userName
     * @return UserInfo of the user with name <code>userName</code>
     */
    public UserInfo getUserInfo(String userName);

    /**
     * Get the group info given the group id.
     *
     * @param groupId
     * @return GroupInfo of group with id <code>groupId</code>
     */
    public GroupInfo getGroupInfo(GroupID groupId);

    /**
     * Get the group info given a group name.
     *
     * @param groupName
     * @return GroupInfo of group with name <code>groupName</code>.
     */
    public GroupInfo getGroupInfo(String groupName);

Re: Question re: Task constants

Posted by Glenn J Gonzales <gg...@exist.com>.
Here's a fix, which follows the conditional in getTasksForInstance(). It 
also removes the redundant status methods in TaskImpl.

Cheers,
Glenn

Geir Magnusson Jr wrote:

>
> On Mar 9, 2005, at 5:19 AM, Glenn J Gonzales wrote:
>
>> Geir Magnusson Jr wrote:
>>
>>>
>>> On Mar 7, 2005, at 4:16 AM, Glenn J Gonzales wrote:
>>>
>>>> In org.apache.agila.services.task.Task:
>>>>
>>>>    public final static int TASK_CANCELLED = 0x03;
>>>>
>>>> shouldn't this be     public final static int TASK_CANCELLED = 0x04; ?
>>>
>>>
>>>
>>> Why?  it's not a bitmap.  They are exclusive values....  Am I 
>>> missing something?
>>>
>> Sorry, was unable to include my reason for asking in my previous 
>> post, must have been dazed or hurrying home :) Anyway, I was just 
>> asking because in the memory implementation of the task service, the 
>> code uses bit-AND to know which task to add:
>>
>> if ( (ti.getStatus() & type) > 0)
>>
>> which would include a cancelled task regardless of the value of type 
>> (assuming it was one of the constants in the Task interface).
>
>
> Ah, yes.  We definitely have to fix this.
>
>>
>>


Re: Question re: Task constants

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 9, 2005, at 5:19 AM, Glenn J Gonzales wrote:

> Geir Magnusson Jr wrote:
>
>>
>> On Mar 7, 2005, at 4:16 AM, Glenn J Gonzales wrote:
>>
>>> In org.apache.agila.services.task.Task:
>>>
>>>    public final static int TASK_CANCELLED = 0x03;
>>>
>>> shouldn't this be     public final static int TASK_CANCELLED = 0x04; 
>>> ?
>>
>>
>> Why?  it's not a bitmap.  They are exclusive values....  Am I missing 
>> something?
>>
> Sorry, was unable to include my reason for asking in my previous post, 
> must have been dazed or hurrying home :) Anyway, I was just asking 
> because in the memory implementation of the task service, the code 
> uses bit-AND to know which task to add:
>
> if ( (ti.getStatus() & type) > 0)
>
> which would include a cancelled task regardless of the value of type 
> (assuming it was one of the constants in the Task interface).

Ah, yes.  We definitely have to fix this.

>
>
-- 
Geir Magnusson Jr                                  +1-203-665-6437
geir@gluecode.com


[PATCH] DAO and Memory Implementation of subprocess-related methods

Posted by Ramil Jason Yao <ry...@exist.com>.
Hi,

I'm submitting a patch related to how the subprocess execution works. The 
parent instance's token is saved using the child instance's id so that it 
can be later retrieved and resume its execution upon completion of the child 
instance. Before, I used to store the parent's token only in memory, or in a 
map, and realized that it needed to be implemented to work both in memory 
and in the DB, just like the other methods (internalCreate, 
internalSave...). The patches I attached include both memory and dao 
implementations.

Ramil 

Re: Question re: Task constants

Posted by Glenn J Gonzales <gg...@exist.com>.
Geir Magnusson Jr wrote:

>
> On Mar 7, 2005, at 4:16 AM, Glenn J Gonzales wrote:
>
>> In org.apache.agila.services.task.Task:
>>
>>    public final static int TASK_CANCELLED = 0x03;
>>
>> shouldn't this be     public final static int TASK_CANCELLED = 0x04; ?
>
>
> Why?  it's not a bitmap.  They are exclusive values....  Am I missing 
> something?
>
Sorry, was unable to include my reason for asking in my previous post, 
must have been dazed or hurrying home :) Anyway, I was just asking 
because in the memory implementation of the task service, the code uses 
bit-AND to know which task to add:

if ( (ti.getStatus() & type) > 0)

which would include a cancelled task regardless of the value of type 
(assuming it was one of the constants in the Task interface).

Re: Question re: Task constants

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 7, 2005, at 4:16 AM, Glenn J Gonzales wrote:

> In org.apache.agila.services.task.Task:
>
>    public final static int TASK_CANCELLED = 0x03;
>
> shouldn't this be     public final static int TASK_CANCELLED = 0x04; ?

Why?  it's not a bitmap.  They are exclusive values....  Am I missing 
something?

>
>
-- 
Geir Magnusson Jr                                  +1-203-665-6437
geir@gluecode.com


Question re: Task constants

Posted by Glenn J Gonzales <gg...@exist.com>.
In org.apache.agila.services.task.Task:

    public final static int TASK_CANCELLED = 0x03;

shouldn't this be     public final static int TASK_CANCELLED = 0x04; ?