Thanks John
I came up with this when I was looking through the source code of ruote-kit

It uses similar approach when it displays the current workitems for each 
process, and the if a user want to work on a process, the user can click on 
that item and proceed it.

In this case, the user needs to know the current workitems only for a 
particular process. Because the workitems may need to prioritized based on 
which process it's in and  on the requirement of the user.

On Tuesday, June 19, 2012 2:38:04 PM UTC-4, John Mettraux wrote:
>
>
> On Tue, Jun 19, 2012 at 11:12:36AM -0700, ddeng wrote: 
> > 
> > I found my self always using some duplicated code to access current work 
> > item in Ruote. So I wrote a simple extension that includes a method for 
> > quick accessing the current workitems given a process positions: 
> > 
> > Could you please have a look at the code and see if I am reinventing the 
> > wheels? 
> > 
> > class Ruote::ProcessStatus 
> >   def current_work_items 
> >     current_positions=self.position 
> >     items=current_positions.collect { |pos| 
> >       self.stored_workitems.find { |wi| 
> >         #puts "#{wi.fei.sid} <> #{pos[0]}" 
> >         wi.fei.sid==pos[0] } 
> >     } 
> >     return items 
> >   end 
> > end 
>
> Hello, 
>
> the "normal" use case goes like "hey I want to know what workitems are 
> available for my users", and it's usually done via something like 
>
>   workitems = dashboard.storage_participant.all 
>
> As a human participant, you don't want to list process instances and then 
> list workitems. You directly list the work that's for you, whatever the 
> process. 
>
> If, for whatever reason, you feel like listing all the processes, then 
> Ruote::ProcessStatus#store_workitems (which you use) should return the 
> same 
> list (probably different order) as your 
> Ruote::ProcessStatus#current_work_items. I don't understand why you come 
> up 
> with this. 
>
>
> Best regards, 
>
> -- 
> John Mettraux - http://lambda.io/jmettraux 
>
>

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to