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
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
Hello Mark,
no, but you could use Ruby to generate it (and thus include/execute any Ruby code arbitrarily).
Best regards,
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..."
Hello David,
yes, it's indentation driven.
Best regards,
Hello,
up until now, ruote understood process definitions expressed in Ruby, in XML or directly as trees (Ruby or JSON).
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,