On 17/11/2007, Jeffery <[EMAIL PROTECTED]> wrote:
> James.Strachan wrote:
> >
> > On 10/11/2007, Jeffery <[EMAIL PROTECTED]> wrote:
> >>
> >> We have 4 activities to monitor. I can't figure out how to put them
> >> together
> >> in one TemporalRule, say for example, to expect four of them happening
> >> within a time constraint. It works with two, as described in the example.
> >
> > Is there a well defined activity that starts first? If say A starts
> > first then you could do say..
> >
> >
> > b.starts().after(a.completes())
> >                         .expectWithin(seconds(1))
> >
> > .errorIfOver(seconds(10)).to("activemq:overdue.b");
> > c.starts().after(a.completes())
> >                         .expectWithin(seconds(1))
> >
> > .errorIfOver(seconds(10)).to("activemq:overdue.b");
> > d.starts().after(a.completes())
> >                         .expectWithin(seconds(1))
> >
> > .errorIfOver(seconds(10)).to("activemq:overdue.b");
> >
> > I guess we could do much better in the DSL though to specify b, c, d
> > all within some time periond.
> >
> > Another idea is we could maybe say that a, b, c, d should all complete
> > within a time period of the entire process starting (whichever
> > activity comes first).
> >
> > e.g. maybe something like this?
> >
> > expectActivities(a, b, c, d).
> >                         .expectWithin(seconds(1))
> >
> > .errorIfOver(seconds(10)).to("activemq:overdue.b");
> >
> > so you could say that however a process is started, you expect all
> > activities to complete with 10 seconds
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> > Open Source SOA
> > http://open.iona.com
> >
> >
>
>
> In my case, they are orderless. So, I probably need write a lot of
> statements like this:
> b.starts().after(a.completes())
>                         .expectWithin(seconds(1))
>                         .errorIfOver(seconds(10)).to("activemq:overdue.b");

So maybe being able to specify a, b, c, d all complete within some
time from the process itself starting (i.e. a, b, c, d can all start
the process, but if (say) a starts it then b, c, d must arrive within
a certain time)...

expectActivities(a, b, c, d).
                       .expectWithin(seconds(1))
                       .errorIfOver(seconds(10)).to("activemq:overdue.b");

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to