On 9/20/07, rfoxmich <[EMAIL PROTECTED]> wrote:
>
> In thinking about how to build web applications that scale, where
> workitems get dispatched to people or groups, I found the stores
> scheme to be a bit unwieldy.    My thinking is as follows:
> - Work items can be dispatched to a person.
> - Work items can be dispatched to a group.
> - I should not need to iterate over the work items in a store or all
> relevant stores
>   looking at parameters in each work item to select workitems meant to
> be acted
>   on by a user or group.. that's what databases are good at.
(snip)
>
>     sequence do
>         concurrence do
>
>             linemanager :target     =>
> "user:#{$processInfo['linemanager']}"
>             budget            :target     =>
> "user:#{$processInfo['budgetmanager']}"
>         end
>
>         msuform             :target     => "group:travel"
>     end
> end

Hi Ron,

at first you made me realize that I had completely forgotton to
add_index to the workitems table. My bad.

http://rubyforge.org/tracker/index.php?func=detail&aid=14106&group_id=2609&atid=10195


You're right. But somehow I would have done it a bit differently :

1). adding those forgotten indexes, on the participant_name and the
store_name especially.

2). instead of adding a new column, I would extend the ActiveParticipant :

---8<---
class SpecialActiveParticipant < ActiveParticipant

    def consume (workitem)

        target = workitem.attributes['params'].attributes['target']
            # simplified...

        store_name = if target
            target
        else
            "default_store"
        end

        Workitem.from_owfe_workitem(workitem, store_name)
    end
end
--->8---

Here I use a special store_name based on the value in target.

Feel free to use store_name or participant_name for your indexation
purposes, as long as the "flow expression id" (fei) is left untouched,
the engine, will recognize the workitem at reply time.

Having many stores could be tiresome for Densha and its "stores" view,
I could extend store permissions to support regular expressions (why
not?).
Or you could place your 'target' value in 'participant_name'
("#{participant_name}::#{target}"), leaving store_name untouched. Many
possibilities.

Trying to avoid modifying the schema, playing with the Ruby classes.


Thanks for sharing your experience, best regards,

-- 
John Mettraux   -///-   http://jmettraux.openwfe.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to