You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by Alex Boisvert <bo...@intalio.com> on 2007/12/18 21:12:03 UTC

SimPEL

In case you missed it, Matthieu just added a SimPEL version of the BPEL
spec's Loan Approval process.

http://svn.apache.org/viewvc/ode/sandbox/simpel/src/test/resources/loan-approval.simpel?revision=605313

Much nicer than 3-4 pages of xml-goobleygook.

:)
alex

Disclaimer: These are just test cases for the parser.  SimPEL doesn't
execute yet.

Re: SimPEL

Posted by Matthieu Riou <ma...@offthelip.org>.
Here's another example with a few more stuff, it also demonstrates an XML
literal. I have to work on inlined function declaration when it's used only
once in a process, it should make it even shorter but that's already not too
bad.

namespace sref=" http://docs.oasis-open.org/wsbpel/2.0/serviceref";
namespace addr="http://example.com/addressing";

# Correlation functions
function auctionIdFromAnswer(answer) {
  answer.auctionId;
}
function auctionIdFromBuyer(buyer) {
  buyer.ID;
}
function auctionIdFromSeller(seller) {
  seller.auctionId;
}

# Auction process as defined in chapter 15.4 of the BPEL 2.0 specification
process Auction {
  partnerLink buyerOrSeller, auctionRegistrar, seller;
  var auctionId unique, buyerData, sellerData;

  # The original BPEL spec example for the auctions process uses a join
pattern which
  # we chose to not support in SimPEL. This is equivalent.
  receive(buyerOrSeller, submit) { |startData|
    if (startData.buyer) {
      buyerData = startData;
      auctionId = auctionIdFromBuyer(buyerData);
      sellerData = receive(seller, submit, {auctionIdFromSeller:
auctionId});
    } else {
      sellerData = startData;
      auctionId = auctionIdFromSeller(sellerData);
      buyerData = receive(buyer, submit, {auctionIdFromBuyer: auctionId});
    }
  }

  # The endpoint hardcoded in the process is kind of evil but heck, that's
the example.
  auctionRegistrar = <sref:service-ref>
                       <addr:EndpointReference>
                         <addr:Address>
http://example.com/auction/RegistrationService/</addr:Address>

<addr:ServiceName>as:RegistrationService</addr:ServiceName>
                       </addr:EndpointReference>
                     </sref:service-ref>;
  auctionData.auctionHouseEPR = auctionRegistrar.myRole;
  auctionData.auctionId = sellerData.auctionId;
  auctionData.amount = 1;

  invoke(actionRegistrar, processData, auctionData);
  answerData = receive(actionRegistrar, answer, {auctionIdFromAnswer:
auctionId});

  parrallel {
     seller = sellerData.endpointReference;
     sellerAnswerData.thankYouText = "Thank you!";
     invoke(seller, answer, sellerAnswerData);
  } and {
     buyer = buyerData.endpointReference;
     buyerAnswerData.thankYouText = "Thank you!";
     invoke(buyer, answer, sellerAnswerData);
  }
}

Matthieu

On Dec 18, 2007 12:12 PM, Alex Boisvert <bo...@intalio.com> wrote:

> In case you missed it, Matthieu just added a SimPEL version of the BPEL
> spec's Loan Approval process.
>
>
> http://svn.apache.org/viewvc/ode/sandbox/simpel/src/test/resources/loan-approval.simpel?revision=605313
>
> Much nicer than 3-4 pages of xml-goobleygook.
>
> :)
> alex
>
> Disclaimer: These are just test cases for the parser.  SimPEL doesn't
> execute yet.
>

Re: SimPEL

Posted by Guillaume Nodet <gn...@gmail.com>.
On Dec 18, 2007 9:27 PM, Matthieu Riou <ma...@offthelip.org> wrote:

> On Dec 18, 2007 12:21 PM, Guillaume Nodet <gn...@gmail.com> wrote:
>
> > I was about to try it ...  :-(
>
>
> A bit more time will be needed for that :)
>
>
> > We just need the same kind of dsl for wsdl now...
>
>
> That'd be really nice... Anyone willing to start?


I'm in vacation for the next two weeks.  I'd like to give it a try if time
-- and familiy ;-) -- permits


>
>
> Matthieu
>
>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> >
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: SimPEL

Posted by Matthieu Riou <ma...@offthelip.org>.
On Dec 18, 2007 12:21 PM, Guillaume Nodet <gn...@gmail.com> wrote:

> I was about to try it ...  :-(


A bit more time will be needed for that :)


> We just need the same kind of dsl for wsdl now...


That'd be really nice... Anyone willing to start?

Matthieu


>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
>

Re: SimPEL

Posted by Guillaume Nodet <gn...@gmail.com>.
On Dec 18, 2007 9:12 PM, Alex Boisvert <bo...@intalio.com> wrote:

> In case you missed it, Matthieu just added a SimPEL version of the BPEL
> spec's Loan Approval process.
>
>
> http://svn.apache.org/viewvc/ode/sandbox/simpel/src/test/resources/loan-approval.simpel?revision=605313
>

Nice :-)
Great work !


>
> Much nicer than 3-4 pages of xml-goobleygook.
>

Agreed


>
> :)
> alex
>
> Disclaimer: These are just test cases for the parser.  SimPEL doesn't
> execute yet.
>

I was about to try it ...  :-(
We just need the same kind of dsl for wsdl now...

-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/