Research Article

An Improved Abstract State Machine Based Choreography Specification and Execution Algorithm for Semantic Web Services

Listing 6

Goal (the user).
  Local ontology stored in a separate file
Name(Peter).
DateOfBirth(19830622).
Gender(Male).
CreditCardNo(1234432156788765).
CreditCardHolder(PETER JACKSON).
CreditCardCVV(123).
myGoal:Goal[
importOntology -> ../Flight/GoalsOntology.flr,
capability ->
pre ->   myRequest:RequestFlight[
From->Paris,
To->Chicago,
Departure->23,
Return->30],
post ->   (?R:Reservation[?X->?Y]),
gRule(R01):ChooseRule ->
if (  tripChoice(?fl_dep,?fl_ret,?P),
(+ trip:Trip) )@WM
then (
deltaInsert(trip:Trip[
Dep->?fl_dep,
Ret->?fl_ret]) ) ,
gRule(R02):ForallRule ->
if ( (?Q:QuestionByWS[
Name->?X,
DateOfBirth->?Y,
Gender->?Z])@WM,
(Name(?N), DateOfBirth(?DoB), Gender(?G))@WM )
then (
deltaInsert(answer:AnswerByGoal[
Name->?N,
DateOfBirth->?DoB,
Gender->?G] ) ) ,
gRule(R03):ForallRule ->
if ( (?Q:QuestionByWS[
CreditCardNo->?X,
CreditCardHolder->?Y,
CreditCardCVV->?Z])@WM,
( CreditCardNo(?CCN),
CreditCardHolder(?CCH),
CreditCardCVV(?CCCVV) )@WM
)
then (
deltaInsert(answer:AnswerByGoal[
CreditCardNo->?CCN,
CreditCardHolder->?CCH,
CreditCardCVV->(?CCCVV)]) )
].