BPELscript

Description

The Web Services Business Process Execution Language (WS-BPEL, BPEL for short) is a programming language to describe the control flow of business processes. BPEL has native support for concurrency, backward and forward recovery. A BPEL process is executed via a workflow engine. Using these engines, a BPEL process can execute for years. IBM, Oracle and Microsoft are some the big players in this field and provide workflow engines which can execute BPEL processes.

The syntax of BPEL is based on XML infoset. Since it is uncommon to write programs using XML, the group around Apache ODE made the proposals BPEL4coders, simBPEL and SimPEL. BPELscript is based on these proposals and provides

The translation to WS-BPEL 2.0 ensures that BPELscript can be executed on all workflow engines supporting WS-BPEL 2.0. To enable programmers to maintain WS-BPEL 2.0 code, the translation of WS-BPEL 2.0 to BPELscript allows them to modify the code in a syntax more common to programmers.

Example

namespace pns = "http://example.com/loan-approval/";
namespace lns = "http://example.com/loan-approval/wsdl/";

@type "http://schemas.xmlsoap.org/wsdl/"
import lServicePT = lns::"loanServicePT.wsdl";

@suppressJoinFailure
process pns::loanApprovalProcess {
partnerLink customer = (lns::loanPartnerLT, loanService, null),
approver = (lns::loanApprovalLT, null, approver),
assessor = (lns::riskAssessmentLT, null, assessor);
try {
parallel {
@portType "lns::loanServicePT" @createInstance
request = receive(customer, request);
signal(receive-to-assess, [$request.amount < 10000]);
signal(receive-to-approval, [$request.amount >= 10000]);
} and {
join(receive-to-assess);
@portType "lns::riskAssessmentPT"
risk = invoke(assessor, check, request);
signal(assess-to-setMessage, [$risk.level = 'low']);
signal(assess-to-approval, [$risk.level != 'low']);
} and {
join(assess-to-setMessage);
approval.accept = "yes";
signal(setMessage-to-reply);
} and {
join(receive-to-approval, assess-to-approval);
@portType "lns::loanApprovalPT"
approval = invoke(approver, approve, request);
signal(approval-to-reply);
} and {
join(approval-to-reply, setMessage-to-reply);
@portType "lns::loanServicePT"
reply(customer, request, approval);
}
}
@faultMessageType "lns::errorMessage"
catch(lns::loanProcessFault) { |error|
@portType "lns::loanServicePT" @fault "unableToHandleRequest"
reply(customer, request, error);
}
}

Downloads

The grammar of the language expressed in ANTLR and can be downloaded here (pretty printed). Further details of the language are explained in “Translating WS-BPEL 2.0 to BPELscript and Vice Versa”. The source code is available here @ Github.

Related Work

Future Work

Publications

Contact

Please report bugs to our issue tracker.