radial process definitions

33 views
Skip to first unread message

John Mettraux

unread,
May 2, 2011, 1:38:35 AM5/2/11
to ruote
Hello,

up until now, ruote understood process definitions expressed in Ruby, in XML or directly as trees (Ruby or JSON).

Thus, this Ruby process definition

---8<---
Ruote.process_definition 'test', :revision => '1.0' do
alpha
concurrence do
bravo :timeout => '2d'
charly
end
delta :task => 'final changes'
end
--->8---

would be equivalent to (Ruby array)

---8<---
['define', {'revision'=>'1.0', 'test'=>nil}, [
['alpha', {}, []],
['concurrence', {}, [
['bravo', {'timeout'=>'2d'}, []],
['charly', {}, []]]],
['delta', {'task'=>'final changes'}, []]]]
--->8---

or (JSON string)

---8<---
["define", {"revision":"1.0", "test":null}, [
["alpha", {}, []],
["concurrence", {}, [
["bravo", {"timeout":"2d"}, []],
["charly", {}, []]]],
["delta", {"task":"final changes"}, []]]]
--->8---

or (XML)

---8<---
<process-definition name='test' 'revision'='1.0'>
<alpha />
<concurrence>
<bravo timeout='2d' />
<charly />
</concurrence>
<delta task='final changes' />
</process-definition>
--->8---

The new "radial" process definition language looks like :

---8<---
process-definition test, revision: 1.0
alpha
concurrence
bravo timeout: 2d
charly
delta task: 'final changes'
--->8---

It's mostly the Ruby syntax, without the "do" and the "end", and attributes that are expressed with the javascript 'lazy' syntax.

Since it accomodates Ruby-like and JSON-like styles, these are equivalent :

---8<---
bravo timeout: 2d
bravo "timeout": 2d
bravo 'timeout': 2d
bravo timeout: "2d"
bravo timeout: '2d'
--->8---

Attribute values can be expresses the JSON way or the Ruby way :

---8<---
charly info: { a: 'b', c: [ 1, 2, 3 ] }
charly info: { 'a' => 'b', 'c' => [ 1, 2, 3 ] }
# ...
--->8---

Comments start after the "#" sign.

Multiline strings are OK, they are delimited by ''' or """

It should accomodate a very relaxed style of writing.

The big minus point : your favourite text editor won't have a syntax file for it.


Comments and questions are welcome,

--
John Mettraux - http://jmettraux.wordpress.com

Mark V

unread,
May 2, 2011, 2:13:00 AM5/2/11
to openwfe...@googlegroups.com

One question: Would it be possible to include/execute arbitrary Ruby
code in this new syntax?

> --
> John Mettraux - http://jmettraux.wordpress.com
>

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

John Mettraux

unread,
May 2, 2011, 2:15:41 AM5/2/11
to openwfe...@googlegroups.com

On Mon, May 02, 2011 at 04:13:00PM +1000, Mark V wrote:
>
> One question: Would it be possible to include/execute arbitrary Ruby
> code in this new syntax?

Hello Mark,

no, but you could use Ruby to generate it (and thus include/execute any Ruby code arbitrarily).


Best regards,

David Greaves

unread,
May 4, 2011, 3:29:57 PM5/4/11
to openwfe...@googlegroups.com, John Mettraux
On 02/05/11 06:38, John Mettraux wrote:
> Hello,
>
> up until now, ruote understood process definitions expressed in Ruby, in XML or directly as trees (Ruby or JSON).
>
> Thus, this Ruby process definition
>
> ---8<---
> Ruote.process_definition 'test', :revision => '1.0' do
> alpha
> concurrence do
> bravo :timeout => '2d'
> charly
> end
> delta :task => 'final changes'
> end
> --->8---
>
[snip]

> The new "radial" process definition language looks like :
>
> ---8<---
> process-definition test, revision: 1.0
> alpha
> concurrence
> bravo timeout: 2d
> charly
> delta task: 'final changes'
> --->8---

So, minor point: are blocks indentation driven?

I assume so since 'delta' is not part of the concurrence block.

David

--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."

John Mettraux

unread,
May 4, 2011, 6:04:26 PM5/4/11
to ruote

Hello David,

yes, it's indentation driven.


Best regards,

John W Higgins

unread,
May 4, 2011, 5:11:24 PM5/4/11
to openwfe...@googlegroups.com
Good Day,

On Sun, May 1, 2011 at 10:38 PM, John Mettraux <jmet...@openwfe.org> wrote:
Hello,

up until now, ruote understood process definitions expressed in Ruby, in XML or directly as trees (Ruby or JSON).

This language seems somewhat ominous - are you switching to exclusively the "radial" style or will the current mechanisms continue to work?

John

John Mettraux

unread,
May 4, 2011, 6:09:18 PM5/4/11
to openwfe...@googlegroups.com

Hello John,

welcome to the ruote mailing list.

the current mecanisms will continue to work. Radial is for now only an exploration, but it will not kill the other "formats".


Best regards,

Reply all
Reply to author
Forward
0 new messages