This will be a tremendously useful feature.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of John Mettraux
Sent: Tuesday, August 16, 2011 10:20 AM
To: ruote
Subject: [ruote:3223] tentative feature: timers

Dear list,

I had a conversation with Lucas from Howcast the other day:

  http://ruote-irclogs.s3.amazonaws.com/log_2011-08-11.html

There is always this recurring pattern, I emit a workitem towards a
participant and I want it to be reminded of it, like 1 week before the
timeout and then a final time, 1 day before the task closes.

Up until now, it involved writing something like:

---8<---
concurrence :count => 1 do
  participant 'toto', :task => 'clean the car', :timeout => '4w'
  sequence :lose => true do
    wait '2w'
    participant 'toto', :notification => 'clean the car !'
  end
  sequence :lose => true do
    wait '3w'
    participant 'toto', :notification => 'DO CLEAN THE CAR !!'
  end
end
--->8---

You can wrap that in a subprocess:

---8<---
define 'do_task' do
  concurrence :count => 1 do
    participant '${v:target}', :task => '${v:task}', :timeout =>
'${v:tout}'
    sequence :lose => true do
      wait '${v:first_reminder}'
      participant '${v:target}', :notification => '${v:task} !'
    end
    sequence :lose => true do
      wait '${v:second_reminder}'
      participant '${v:target}', :notification => '${v:task} !!'
    end
  end
end

do_task :target => 'toto', :first_reminder => '2w', :second_reminder =>
'3w', :tout => '4w'
--->8---

But it becomes quickly rather ugly.

With Lucas, we discussed having something shorter.

---8<---
participant 'toto', :task => 'clean the car', :reminders => '2w, 3w',
:timeout => '4w'
--->8---

or

---8<---
participant 'toto', :task => 'clean the car', :reminders => '2w:
first_reminder, 3w: second_reminder, 4w: timeout'

define 'first_reminder' do
  participant '${v:text}', :msg => '1st reminder'
end
define 'second_reminder' do
  concurrence do
    participant '${v:text}', :msg => '2nd reminder'
    participant 'supervisor', :msg => '2nd reminder for ${v:text} /
${v:task}'
  end
end
--->8---

These are not always reminders, and it could be beneficial to attach
them to other things that only participant expression. Let's try with
"timers":

---8<---
sequence :timers => '2w: notify, 3w: timeout' do
  participant 'toto'
  participant 'doug'
end
--->8---

In this short example, the sequence has a timeout of three weeks, and
after two weeks, the subprocess (or participant) named 'notify' is
triggered.

I'm working on this feature right now, here is a summary of it:

- they are 'timers'
- it's a list than can get attached to any expression
- they trigger participants, subprocesses or the 'timeout' special
behaviour
- maybe 'error' is another special behaviour, 'cancel' as well ('redo'
?)

It requires a bit of rework of the timeout infra, fortunately it should
be backward compatible.


Thoughts, comments ?

--
John Mettraux - http://lambda.io/processi

--
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

-- 
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