.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Worflow template with some predefined activities and a hole to add other activities

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WPF
Hi,all,        I am trying to write a workflow template to simplify modeling a new workflow.  The workflow template include some predefiend activities and an empty ifelseactivity there. When the user wants to define a new workflow, it use this workflow as base workflow(something like NewWorkflow: WorkflowTemplate), and then add some ifelsebranchactivities in the empty ifElseActivity.        I tried to implement it. But I met some problems .  First, When I drag a new ifElseBranchActity into the hole, it was not permitted and said "Cannot add or remove child activities on a non-editable activity". Furthermore, in the InitializeComponent() function,the designer will generate all the elements that has in the template workflow again.  So there will be two activities with the same name, one is inherited from the workflow template, one is generated in the new workflow.       Is there any way to implement my requirement in workflow 3.5? or workflow 4?        Best wishes to you all!  

View Complete Post

More Related Resource Links

How to drop Activities in Custom Activity Designer having custom style template?



I have designed a custom activity designer developed using Activity Designer XAML and using that in a rehosted Workflow environment on a WPF. I have changed the outer design of the Activity designer by setting the style template to my required style. If I do this, I am unable to add the activities to the custom activity having my custom activity designer.

Am I missing anything.? Please help me in this regard.

Thanks in advance,



worflow for short time activities


Dear Folks,

Currently I am working on a travel booking portal where travelers can search and book a flight but user has the option to book online and pay later within specified time frame (say 2 hours). Here, I am thinking of implementing the workflow for order fulfillment with following states.

OrderBooked (When user book flight online but has not paid yet)

OrderPaid (Later when user pays using credit card or any other payment mechanism)

OrderCanceled (If user doesnt pay in specified time)

OrderCompleted (in case user pay and ticket successfully generated)


Here I am no sure if we should implement WWF in this scenario as the life span of an order is very short (say 2- 4 hours). If payment is not done in this time span, order will be canceled. My understanding is that WWF is best suited for long running activities.

Please suggest



Foundations: Unit Testing Workflows And Activities


Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

Windows Workflow: Build Custom Activities To Extend The Reach Of Your Workflows


This article covers the core components required for building custom activities in Windows Workflow Foundation.

Matt Milner

MSDN Magazine December 2006

Cutting Edge: A Tour of Windows Workflow Activities


Windows Workflow Foundation supports virtually any scenario where human opera¬tors are involved. Learn how to use it to tame your workflows.

Dino Esposito

MSDN Magazine November 2006

WebMethods, sends to wrong address (activities.aspx.aspx)?

I'm verifying e-mail address using WebMethods, however, I'm getting a 404 not found (error console) saying that it can't find activities.aspx.aspx. I am using URL-Rewriting, but I tried adding a detect for 'activities.aspx.aspx' and redirect back to .activities.aspx' but it didn't do anything.Here is the error:[HttpException]: The file '/activities.aspx.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandl

How do I process Child activities

Hi! I have built a for each loop to process to process two activities grouped in a sequence activity. When I step through this code and get to the executionContext.ExecuteActivity it recognizes the child sequence activity but I don't drop into it what have I missed? Thanks foreach (MissingResult MR in ChecklistResponse) { string NotamID = MR.NOTAMID.ToString(); string Acountbility = MR.AccountID.ToString(); // Build the Query URL SingleQueryURL = String.Format(SingleQueryBase, AIDAPAccount, AIDAPPassword, JournalType, Acountbility, NotamID); // Access the first Child Activity Activity a = this.EnabledActivities[0]; // Subscribe to the closed event a.Closed += ChildActivityCountinuation; // Execute the activity executionContext.ExecuteActivity(a); // Increment the Loop counter LoopCounter++; }

Serializaing/deserializing XOMLs with custom activities that have properties of ISerializable types

I have custom activities that have dependency properties of types that implement ISerializable. When they are serialized/deserialized to XOML, the ISerializable-implied functionality is ignored and the standard reflection-based SerializableAttribute behavior is invoked. This poses a serious problem since the types require precise control over their serialization to ensure that proper internal state is maintained across serialization boundaries. I am aware of the WF custom serialization methods as mentioned in Tom Lakes' blog post, but they seem to require the DesignerSerializerAttribute attribute on all custom types. This is a problem because the types are business objects shared across many (non-WF) applications and they are part of a seperate code base to which I have no access. Is there a different method for getting custom serialization? And what is the reasoning behind the WF team choosing to ignore the very basic ISerializable attribute which is supported by every other .NET API across the framework? Thanks in advance.

How to Add custom WF4 Activities to ToolBox using Code?

Hi I have a number of custom activities in my dll. My requirement is to add the custom activities to ToolBox using Code/installer. I written the following code System.Reflection.Assembly asm; asm = Assembly.LoadFrom(Path.Combine(assemblyPath, @"MyProject.dll")); var types = from t in asm.GetExportedTypes() where typeof(Activity).IsAssignableFrom(t) select t.FullName; if (types != null && types.Count() > 0) { string activityName; foreach (var item in types) { activityName = item.Substring(item.LastIndexOf(".") + 1); myTab.ToolBoxItems.Add(activityName, item); } } Above code is adding the activities to the Toolbox as HTML Controls. How can I add the same as WF4 Activities in Toolbox ? Thanks AmbilyIT Analyst

Custom sequence activity deriving from System.Workflow.Activities.SequenceActivity

Hi, I try to create custom sequence activity. I found some sample (http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/f54e8eb2-29d9-46f6-ad96-766fe6fad333/). But this custom activity looks ugly (to separate nested activity using ellipses instead of arrows). My question is - how to create custom sequence activity, which will look like sequence activity. I also found this sample - <ContentPresenter x:Uid="ContentPresenter_1" Content="{Binding}" Style="{x:Static sacdt:DesignerStylesDictionary.SequenceStyle}"/> When I used this ContentPresenter my custom activity looks like System.Workflow.Activities.SequenceActivity, but I couldn't put on it another activity. I also created class, which derives from System.Workflow.Activities.SequenceActivity, but I couldn't see it in toolbox. My question is - how to create class, which derives from System.Workflow.Activities.SequenceActivity and is visible in toolbox or how to use ContentPresenter for sequence activity, which allows put on itself another activity.

Custom Activities

Hi, I need to create following custom activities( dynamic design): - circle with image in it and 2 connect points one left, one right - rectangle with image in it and 2 connect points one left, one right - diamond with image in it and 2 connect points one up,one down I also need to catch clicks on activities and nodes. How do you recommend I do this? I was aiming for FreeFormActivityDesigner( with overriding OnPaint, CanConnect etc), but that seems to be unusable in 4.0 Thank you very much  

Where are the built-in powershell activities?

Hi, searching the web I found many blog posts  about early versions of Workflow 4.0 and I found references to some built-in powershell activities, but I couldn't find them in VS2010 Beta 2 nor RC. Where are them? Thank you

How to find child (model item) activities of a flow chart model item?

Hello,In an earlier post, I asked how to find the children of a given model item.  If the model item I'm working with is a FlowChart, then the strategies given in that earlier post don't work.  How can I, given a model item that contains a FlowChart activity, find the direct children of the model item?  I'm not particularly interested in the order in which the child will execute, I just want a list of all the immediate children. (I'm not interested in child activities nested within an activity that is a direct child of the FlowChart activitiy).Also, I would like to get the model item representing the child activities, rather than the activities directly themselves.  I think I could do something like this: Flowchart flowChart = _activeflowChartDesigner.ModelItem.GetCurrentValue() as Flowchart;            if (flowChart != null)            {                foreach (FlowNode node in flowChart.Nodes)                {                    FlowStep flowStep = node as FlowStep;    

Move Multiple Activities

I am trying to move multiple activities in a workflow sequence on the Rehosted workflow designer.When I select multiple activities and try to move them, only one activity gets moved and other activities get deselected. 

Group activities in to rehosting workflow.

I want to group multiple activities in rehosted workflow designer.

Cannot create unknown type '{clr-namespace:Blog.LongRunningWorkflow.Example.Activities}WaitForReques

Hi, I am facing problem in loading XAML at runtime. Below is the code please help me. public void ProcessRequest(Request request) { // Get the workflow instance id to use Guid instanceId = this.requestToInstanceMapping[request.Id];         // Setup the arguments that are passed to the workflow          IDictionary<string, object> input = new Dictionary<string, object>();              input.Add("Request", request);            using (FileStream fs = new FileStream(@"ProcessRequest.xaml", FileMode.Open))          {             // Load the ProcessRequest workflow           Activity wf = ActivityXamlServices.Load(fs) as Activity;                            // Create the workflow instance specifying the arguments and instance id                      WorkflowApplication wapp = new WorkflowApplication(wf, input);          string persistenceConnectionString = "Data Source=Dev1;Initial Catalog=InstanceStore;User id=sa;password=xxxxxxx;Asynchronous Processing=True";          &nbs

'Completed' is not an event of 'System.Activities.WorkflowApplication'

Hello,I have a C# code which i have converted into VB.But i am getting compile error in VB code:'Completed' is not an event of 'System.Activities.WorkflowApplication'find below C# and VB code:C#:application.Completed += delegate(WorkflowApplicationCompletedEventArgs e){completedEvent.Set();};VB : AddHandler PickSample.application.Completed, Sub(e As WorkflowApplicationCompletedEventArgs) completedEvent.Set()Can some one provide me solution ?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend