index > Windows Workflow Foundation > WebPageRequest/Response activities for ASP.NET integration

WebPageRequest/Response activities for ASP.NET integration

http://wf.netfx3.com/files/folders/control_flow/entry4354.aspx

Package includes WebPage Request/Response custom activities:

- WebPageRequest

- WebPageResponse

- WebPageTransfer

- WebPageRedirect

These activities will help integrate Workflow technology into your ASP.NET projects. Just derive your ASP.NET page from "WorkflowPage" and indicate which workflow to use.

Features:

- integration with Http Request/Response, ability to expose Http parameters in Workflow designer, ability to "Activity Bind" and use them in rules/condition expressions.

- integration with ASP.NET WebControls and data binding sample

- ability to use in both Sequential and StateMachine Workflows

- includes extensible examples of workflow driven authentication procedure, Sequential Page Navigation combined with EventHandlingScope and a StateMachine based search engine prototype.




Ghenadie Plingau | SDET | WF | This is provided "AS IS" with no warranties, and confers no rights
ghenap

WebPageInput WebPageOutput activities use a generic type parameter, which is not supported in Xoml workflows. In order to use them in code separation workflow add a ListSerializer class to the project.

using System;

using System.Collections.Generic;

using System.Text;

using System.Workflow.ComponentModel.Serialization;

using System.ComponentModel.Design.Serialization;

namespace Microsoft.Workflow.Samples.WebPage

{

public class ListSerializer : WorkflowMarkupSerializer, IDesignerSerializationProvider

{

protected override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)

{

return true;

}

protected override void OnBeforeSerialize(WorkflowMarkupSerializationManager serializationManager, object obj)

{

serializationManager.AddSerializationProvider(this);

base.OnBeforeSerialize(serializationManager, obj);

}

protected override void OnAfterSerialize(WorkflowMarkupSerializationManager serializationManager, object obj)

{

base.OnAfterSerialize(serializationManager, obj);

serializationManager.RemoveSerializationProvider(this);

}

protected override void OnBeforeDeserialize(WorkflowMarkupSerializationManager serializationManager, object obj)

{

serializationManager.AddSerializationProvider(this);

base.OnBeforeDeserialize(serializationManager, obj);

}

protected override void OnAfterDeserialize(WorkflowMarkupSerializationManager serializationManager, object obj)

{

base.OnAfterDeserialize(serializationManager, obj);

serializationManager.RemoveSerializationProvider(this);

}

protected override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)

{

List<PageParameter> parameters = (List<PageParameter>)value;

StringBuilder stringValue = new StringBuilder();

foreach (PageParameter parameter in parameters)

{

stringValue.Append(string.Format("{0}:{1},", parameter.Name, parameter.Value));

}

if (stringValue.Length > 0)

{

stringValue.Remove(stringValue.Length - 1, 1);

}

return stringValue.ToString();

}

protected override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)

{

List<PageParameter> paramList = new List<PageParameter>();

string stringValue = value as string;

if (stringValue != string.Empty)

{

string[] parameters = stringValue.Split(',');

for (int i = 0; i < parameters.Length; ++i)

{

string[] paramValues = parametersIdea.Split(':');

if (paramValues.Length != 2)

{

throw new InvalidOperationException();

}

PageParameter parameter = new PageParameter();

parameter.Name = paramValues[0];

parameter.Value = paramValues[1];

paramList.Add(parameter);

}

}

return paramList;

}

#region IDesignerSerializationProvider Members

public object GetSerializer(IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType)

{

if (objectType == typeof(List<PageParameter>))

{

return this;

}

else

{

return null;

}

}

#endregion

}

}

Then add the following attribute on top of WebPageRequest/WebPageResponse class

[DesignerSerializer(typeof(ListSerializer), typeof(WorkflowMarkupSerializer))]




Ghenadie Plingau | SDET | WF | This is provided "AS IS" with no warranties, and confers no rights
ghenap
http://wf.netfx3.com/files/folders/control_flow/entry4354.aspx


Ghenadie Plingau | SDET | WF | This is provided "AS IS" with no warranties, and confers no rights
ghenap

I followed the instructions in the ReadMe and I am unable to debug the applicaton or even run the app in Internet Explorer.

I have .NET 2.0 and .NET 3.0 installed.

I can debug other sample apps I have dowloaded from http://wf.netfx3.com/content/WelcometoNetFx3.aspx

Any ideas?




CG
NuTech
reply 4

You can use google to search for other answers

 

More Articles

• DelayActivity dynamic update
• Workflow Parameters?
• Event cannot be delivered
• Custom activity based on HandleExternalEventActivity
• Xoml customization and compilation
• Performance problem
• using correlation token to decide which activity to be executed
• Issue when removing an activity
• WorkflowPersistence simple question
• How is the user interaction represented in the workflow designer ...
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• asp.net session object
• how to implement human workflow in asp.net
• Workflow Monitor from asp.net
• Smart tags lost functionality in Beta2
• Error while viewing the Workflow Designer
• WF Beta 2 and February WinFX CTP Compati
• Please Answer this question
• State machine workflows and transactions
• WWF and SharePoint
• Custom Activity - Errors Best Practice
• Beta2 - can't find system.workflow.* ass
• Asp.net Application with Delay Activity
• where are changes to theme properties st
• Hosting Windows Workflow
• How can I control a WinForm from a workf

Hot Articles

• InvokeWorkflow simple question.
• how to save the process def. in rehosted
• GetActivityByName cannot find children a
• Question about performance overhead
• GoTo Activity
• WF Designer: Glyph provider is not being
• Clarification on persistence & workf
• Re-hosting workflow designer
• Implementing IDynamicPropertyTypeProvider
• CancellationHandlerActivity
• Could you tell me when will the windows
• basic questions
• workflow versioning question
• No templates show after installation of
• State Machine SQL Tracking DB: How to fi

Recommend Articles

• Edit lock in the designer?
• Sample applications for Windows WF Beta2
• Reentrant workflows and activies
• Can I persist my data along with the Wor
• Relation between IfActivity and .Rules f
• WF StateMachine with forward and back se
• .xoml File
• Windows Workflow Foundation Technology F
• Developing on Windows XP SP2
• WF Technology Directions
• can't install the wwf!
• Sql script files
• Durable and non-Durable Workflows in sam
• WWF and Enterprise LIbrary
• Visual status display during execution