ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Re: Easy BPEL aka BPEL4Coders aka BPEL4Hackers
Date Tue, 06 Nov 2007 19:01:19 GMT
On 11/6/07, Dan Kearns <dan.kearns@gmail.com> wrote:
>
>
> Is there any reason not to attempt to have a process just be a totally
> valid
> javascript?


Because JavaScript the language doesn't have the notion of 'store where you
are, come back later'.  If you write this in JavaScript:

{
plink1.send(msg1);
msg2 = plink2.receive();
plink1.send(msg2);
}

the semantics are that of a method call that blocks until the message
arrives, which sounds good enough for the trivial case. If you have a lot of
these long-running processes waiting significant amount of time to receive
messages, you'll quickly run out of memory.   If you crash, you lose all of
them.

So the alternative is either to come up with a complex framework for
structuring processes, the equivalent of programming against Jacob, which
just replaces one complexity with another, or come up with a syntax that can
handle these kinds of long-lived processes.


Assaf

Using e4x would save having to create new xml-isms, and the
> whole thing would also have the potential side-benefit that it could be
> implemented inside a browser. Imagine a google gears app with embedded
> Ode...  that would rock!
>
> Plus, there could be the added irony of combining e4x with json. There
> could
> be a couple of preordained object-literal constructs, and a way to bless
> those things into actual processes, scopes, partners, etc. Some logic
> chunks
> normally handled in bpel might get delegated to javascript, but that
> doesn't
> seem like a big problem.
>
> Random syntax examples:
>
> default xml namespace = "urn:my:process";
> var scope = {
>    Sequence: { ... }, // or Flow, etc
>    onEvent: function(e) { ...},
>    onFault: function(f) { ...}
> };
>
> With e4x, PortTypes and references could be literals if needed:
>
> var epr = <EndpointReference><Address>http://foo/bar
> </Address></EndpointReference>;
> var pt = new QName(x, y);
> var counter_pl = { PortType: pt , Epr: epr} ;
>
> Slight modification of one of the examples:
>
> var ExternalCounter = new Process({
>   onReceive: function(my_pl, start_op, msg_in) {
>     var resp = <root><count>0</count></root>;
>     while(resp.root.count < 10) {
>       invoke( {
>          Link: counter_pl,
>          Operation: partner_start_op,
>          Message: <counter>{resp.root.count}</counter>,
>          onReply: function(reply) { resp.root.count += reply.counter; }
>          onFault: function(fault) { ... };
>       } );
>     }
>     reply(resp);
>   }
> });
>



-- 
CTO, Intalio
http://www.intalio.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message