1. Trang chủ
  2. » Công Nghệ Thông Tin

Introducing Windows Azure- P47 potx

5 232 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 210,1 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Now we need to bind the state machine workflow item properties to the corresponding handler.. Figure 7-9 shows the bindings for WaitingForShoppingCartItem:eventItemAdded.. Bindings for W

Trang 1

228

},

new NextItem {

Relative = ShoppingCartItem.ENDPOINT ITEM UPDATE,

Uri = string.Format("{0}{1}",

WorkflowEnvironment.WorkflowInstanceId.ToString())

},

new NextItem {

ShoppingCartItem.SHOPPING CART URI,

Relative = ShoppingCartItem.ENDPOINT ITEM DELETE,

Uri = string.Format("{0}{1}",

ShoppingCartItem.SHOPPING CART URI,

WorkflowEnvironment.WorkflowInstanceId.ToString())

}

};

WebOperationContext.Current.OutgoingResponse.StatusCode =

System.Net.HttpStatusCode.Created;

}

private void codeUpdateShoppingCartItem ExecuteCode(object sender, EventArgs e) {

var id = WorkflowEnvironment.WorkflowInstanceId.ToString();

currentShoppingCartItem.ShoppingCartItemId = receivedId;

currentShoppingCartItem.ItemName = receivedShoppingCartItem.ItemName; currentShoppingCartItem.Price = receivedShoppingCartItem.Price;

currentShoppingCartItem.NextItem = new NextItem[]

{

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT CREDITCARD PAYMENT,

Uri = string.Format("{0}{1}",

ShoppingCartItem.CREDIT CARD PAYMENT URI,

id.ToString()),

},

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT ITEM UPDATE,

Uri = string.Format("{0}{1}",

ShoppingCartItem.SHOPPING CART URI,

id.ToString()),

},

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT ITEM DELETE,

Uri = string.Format("{0}{1}",

ShoppingCartItem.SHOPPING CART URI,

id.ToString()),

}

};

Trang 2

229

WebOperationContext.Current.OutgoingResponse.StatusCode =

System.Net.HttpStatusCode.OK;

}

private void codePayShoppingCartItem ExecuteCode(object sender, EventArgs e)

{

var id = WorkflowEnvironment.WorkflowInstanceId.ToString();

currentShoppingCartItem.ShoppingCartItemId = receivedId;

currentShoppingCartItem.ItemName = receivedShoppingCartItem.ItemName;

currentShoppingCartItem.Price = receivedShoppingCartItem.Price;

currentShoppingCartItem.NextItem = new NextItem[]

{

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT CREDITCARD PAYMENT,

Uri = string.Format("{0}{1}",

ShoppingCartItem.CREDIT CARD PAYMENT URI,

id.ToString()),

},

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT ITEM UPDATE,

Uri = string.Format("{0}{1}",

ShoppingCartItem.SHOPPING CART URI,

id.ToString()),

},

new NextItem

{

Relative = ShoppingCartItem.ENDPOINT ITEM DELETE,

Uri = string.Format("{0}{1}",

ShoppingCartItem.SHOPPING CART URI,

id.ToString()),

}

};

WebOperationContext.Current.OutgoingResponse.StatusCode =

System.Net.HttpStatusCode.Created;

}

private void codeCheckOutShoppingCartItem ExecuteCode(object sender, EventArgs e)

{

WebOperationContext.Current.OutgoingResponse.StatusCode =

System.Net.HttpStatusCode.Created;

}

}

}

Trang 3

230

6 Now we need to bind the state machine workflow item properties

to the corresponding handler Figure 7-9 shows the bindings for WaitingForShoppingCartItem:eventItemAdded

Figure 7-9 Bindings for WaitingForShoppingCartItem:eventItemAdded

Trang 4

231

7 The bindings for ShoppingCartItemPlaced:eventItemUpdated are shown

in Figure 7-10

Figure 7-10 Bindings for ForShoppingCartItem:eventItemUpdated

Trang 5

232

8 Bindings for ShoppingCartItemWorkflow:ShoppingCartItemPlaced are shown in Figure 7-11

Figure 7-11 Bindings for ShoppingCartItemWorkflow:ShoppingCartItemPlaced

Ngày đăng: 05/07/2014, 01:20

TỪ KHÓA LIÊN QUAN

w