Commit c591bbea authored by Bas Lijnse's avatar Bas Lijnse

Migrated the internetShop/order processing example

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@506 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 564ad395
......@@ -6,6 +6,7 @@ import iTasks
import Vote
import Purchase
import TravelBooking
import OrderProcessing
//Higher order examples
import MovingTask
......@@ -24,6 +25,7 @@ where
workflows = flatten [ voteExample
, purchaseExample
, travelBookingExample
, orderProcessingExample
, movingTaskExample
, deadlineTaskExample
, delegateTaskExample
......
definition module OrderProcessing
import iTasks
orderProcessingExample :: [Workflow]
\ No newline at end of file
module internetShop
implementation module OrderProcessing
import iDataTrivial, StdEnv, iTasks
import iTasks, iDataTrivial, StdArray
/*
* The scenario contains a number of different events and activities:
......@@ -16,16 +16,14 @@ import iDataTrivial, StdEnv, iTasks
* the confirmation to the customer.
*/
// High level definitions
Start :: *World -> *World
Start world = startEngine [myWorkflow] world
myWorkflow
= { name = "orderPlacement"
, label = "orderPlacement"
orderProcessingExample :: [Workflow]
orderProcessingExample
= [ { name = "Examples/Business/Order processing"
, label = "Order processing"
, roles = []
, mainTask = orderPlacement customer #>> return_V Void
, mainTask = orderPlacement customer >>| return Void
}
]
orderPlacement :: UserId -> Task Void
orderPlacement user =
......@@ -58,7 +56,7 @@ fillInAndCheckCreditCard cardInfo =
, validateCreditCard cardInfo
) =>> \valid ->
if valid
(return_V cardInfo)
(return cardInfo)
(invalidCreditCard cardInfo #>>
fillInAndCheckCreditCard cardInfo
)
......@@ -108,7 +106,7 @@ fillInCreditCard cardInfo =
?>> editTask "Ok" cardInfo
validateCreditCard :: CardInfo -> Task Bool
validateCreditCard cardInfo = return_V (size cardInfo == 5)
validateCreditCard cardInfo = return (size cardInfo == 5)
invalidCreditCard :: CardInfo -> Task Void
invalidCreditCard cardInfo =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment