Welcome to Windows Workflow Foundation (WF)
Top Tasks :

WF Team Bloggers

Browse by Tags

All Tags » ASP.NET   (RSS)

  • State machine workflow web service example

    Being able to have a StateMachineWorkflow hold state across multiple different web service calls can be very useful. This example will show you how to get start. The first step is to create your interface. For this example I will be using the following: public interface IOrderService { string CreateOrder( string id); string UpdateOrder( string id); string ProcessOrder( string id); void CancelOrder( string id); string ShipOrder( string id); string GetOrderStatus(); } To implement one of the methods add a WebServiceInputActivity, which is an IEventActivity, into an EventDriven on the state machine workflow or any of the states contained within it. After setting the InterfaceType and the Method name the input parameters will appear in the property browser. Bind them to workflow level variables so that you can use them across the workflow. Add any activities needed to do the work for the method followed by a WebServiceOutputActivity. After setting the InputActivityName the out parameters for the method are displayed so that you can bind to the variables containing the results. After implementing all the methods you need right click on the project and choose Publish as Web Service to create the web service project. In order to make multiple calls to the same web service you need to make sure that you have added a CookieContainer like below: localhost. StateMachineWorkflow_WebService webservice = webservice = new localhost. StateMachineWorkflow_WebService (); webservice.CookieContainer Read More...
  • Examples of using Persistence and Tracking in ASP.NET

    When you are working with ASP.NET you may have the need to persistence and / or tracking. I have put together two examples, one with shared databases and the other with separate, and included the command scripts to create the databases for you. The sample is written using Windows Workflow Foundation Beta 2.2 and will not work on prior versions. When you run the project you will start on Default.aspx. If there are no existing orders that have not been completed you are redirected to Order.aspx. If there are any existing orders there will be a link for each existing order. Click on the link to start processing the order from its current state. You can click on the enabled button to move the order through the order process. This posting is provided "AS IS" with no warranties, and confers no rights. Read More...
  • Examples of using Persistence and Tracking in ASP.NET

    When you are working with ASP.NET you may have the need to persistence and / or tracking. I have put together two examples, one with shared databases and the other with separate, and included the command scripts to create the databases for you. The sample is written using Windows Workflow Foundation Beta 2.2. When you run the project you will start on Default.aspx. If there are no existing orders that have not been completed you are redirected to Order.aspx. If there are any existing orders there will be a link for each existing order. Click on the link to start processing the order from its current state. You can click on the enabled button to move the order through the order process. This posting is provided "AS IS" with no warranties, and confers no rights. Read More...
  • Using XAML activation in ASP.NET with a StateMachineWorkflow

    If you want to use XAML activation in ASP.NET you will need to be using Windows Workflow Foundation Beta 2.2, that can be found here . The reason for this is that although XAML activation works in most cases with Beta 2 it isn’t officially supported in that build because it was added as a feature at the last minute and was not fully test yet. Below is a sample that uses XAML activation to start a StateMachineWorkflow in ASP.NET. This posting is provided "AS IS" with no warranties, and confers no rights. Read More...
  • Sample of StateMachineWorkflow receiving events fired in ASP.NET

    If you are using a state machine workflow in ASP.NET you need to use the ManualSchedulerService. After the workflow is started or an event is fired to it you need to make a call to RunWorkflow. This allows the current thread to process the event, for more information take a look at Nate’s blog . With Beta 2 and 2.2 there are some issue with having delay activities in a workflow used in ASP.NET, see Paul’s blog for more info on that, so I have not included a delay in this sample. Once a build post Beta 2.2 is release publicly I will update the sample. This sample is a modified version of the OrderApplication from lab 4 of the Hands on Labs that can be found here . The steps to create the sample yourself are posted in the Window Workflow Foundation forum here or attached to this post is the completed project. This posting is provided "AS IS" with no warranties, and confers no rights. Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us