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

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

Problem with bookmarks when combined with Delay activity.

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :Windows Application
Let's take this code sample : using System; using System.Activities; using System.Activities.DurableInstancing; using System.Activities.Statements; using System.Collections.Generic; using System.Runtime.DurableInstancing; using System.Threading; using System.Xml.Linq; using Microsoft.VisualBasic.Activities; namespace WindowsFormsApplication1 { public class WaitExternalEventActivityTestInnerCode : CodeActivity { public OutArgument<string> resultat { get; set; } protected override void Execute (CodeActivityContext context) { context.SetValue (resultat, "SUCCEEDED"); } } public class WaitExternalEventTestEvent : NativeActivity { protected override void Execute (NativeActivityContext context) { context.CreateBookmark ("TestEvent"); } protected override bool CanInduceIdle { get { return true; } } } internal static class Program { private static SqlWorkflowInstanceStore _store; private static readonly XName WorkflowHostTypePropertyName = XNamespace.Get ("urn:schemas-microsoft-com:System.Activities/4.0/properties").GetName ("WorkflowHostType"); private static readonly XName WfHostTypeName = XName.Get ("V1", "Test"); [STAThread] static void Main () { // Init the persistance store string connectionString = @"Data Source=.\

View Complete Post

More Related Resource Links

Customer Activity Designer Problem - "Could not generate view for VisualBasicValue`1"

I'm reading Bruce Bukovics Pro WF4 book and in chapter 16 - Advanced Customer Activites, he details emulating a Sequence activity along with a custom designer. When I drop the custom activity into a new xaml activity, I'm getting all sorts of wierdness. The custom sequence activity has a condition property that determines whether to schedule each child activity contained within. Once I set a value in the ExpressionTextBox for the activity, Visual Studio starts showing in red "Could not generate view for VisualBasicValue`1" along with this error showing up in my error window: The activity 'VisualBasicValue<Boolean>' cannot be referenced by activity 'MySequence' because the latter is not in another activity's implementation.  An activity can only be referenced by the implementation of an activity which specifies that activity as a child or import.  Activity 'VisualBasicValue<Boolean>' is declared by activity 'MySequence'. Here is the source for the activity itself: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Activities; using System.ComponentModel; using System.Collections.ObjectModel; namespace ActivityLibrary { [Designer(typeof(ActivityLibrary.Design.MySequenceDesigner))] public sealed class MySequence : NativeActivity { [Browsable(false)] public Collection<Activity&

Invoke Delay Activity multiple times

HI! I am using Workflow Foundation workflows with sharepoint lists. I have a state machine workflow. One state of workflow has 2 event driven activities, one is waiting for task change and other is waiting for delay of 1 day. What i need is to send email if delay of 1 day is elapsed and send this email every day. But Delay activity is invoked only once. How can i change it so that it can be invoked multiple times. Shabih

Delay in Sequence Problem??????

I have a Approval work flow..What i am doing is,if the approver doesn't review with in a certain time-period the task will be send to another person in the company.... I did this by using Sharepoint List ..and i am using Listen Activity ... Inside the Listen Activity i am using HandleExternalEventActivity and Delayas Parellel Activity... But it does'nt work...I dont know how to extend it... I refers many article...most of them said there is an issue in delay activity...i got conduced ..is that problem fixed or not ? pls guide me... Thanks ________________________ arWINdh

Delay Activity wake up issue..

Hi guys! I've a big problem with my sharepoint 2010: when I use a DelayActivity my workflow NEVER wake up... Sharepoint timer service is ON, and it's loop time is set to 2 minutes. I have already tried with this suggestion (http://howtosharepoint.blogspot.com/2010/05/sharepoint-workflow-delay-activity-not.html), but I still have the problem. Any ideas? Enrico

Unit Testing Delay Activity in workflows 4.0

I need to run unit test scripts for workflows developed in workflows 4.0. I have requirement to unit test the whole workflow including the delay activity.   If the delay activity contains for example for 15 days delay and after that it perform certain other tasks. In this scenario I cannot wait for 15 days for unit test the workflows.   Please let me know How to unit test workflows in case of delay activity? Can I modify the pending timer filed in instance table to advance time?  rajeevkalyan

Problem: Experiencing a delay/timeout in retreiving data

Hi, I have a simple question. We had a application before working perfectly. we moved the application and the WCF into new server. unfortunately we are experiencing some delays/timeout in retreiving data . what do you think it cause?3 stars and a sun

Delay Activity is not working with SharePoint state machine workflow

Hello,   I have a problem with Delay Activity in Sharepoint state machine workflow. This issue is kind of common to many people but so far I haven't come accross any working solution. In one of the workflow states, I want to add a delay activity to send email notification if no action is taken after certain time. Below is what I have done:   In the targeted state: 1) add one eventDriven activity to handle the normal process (approve the item) 2) add another eventDriven activity to send the reminder email. In this eventDriven activity, I first add a delayActivity, set it to 2 minutes for test purpose. Then I add a Sharepoint SentEmail activity.   With my test, the Dealy Activity is never invoked after timeout period. What should I do to make the delay activity work in the SharePoint state machine workflow? Is there any work around if the delay activity is simply not working there?   Any suggestions are appreciated.

State Machine Workflow + External Event + Delay activity



I have state machine workflow with a state contain 2 event driven activities, one is waiting for an external event, and second one is delay. If the external event didn't happen within specified time, timeout occurs and send email. But if the external event delivered, it transited to next state.


Both situation works fine. But once the external event occurred and transited to next state, the delay activity time out happens and it sends the mail. I don't want it happen, When i read through various blog, I learnt that once the workflow instance moved to next state, all event subscriptions related to the previous state are removed from the queue.... But it is not happening in my situation

Kindly help me to find where i am going and to resolve this issue..


p.s I set manualworkflow scheduler  - useActiv

problem with Form in visual studio load with delay


my project have a base form

all form in project loading bad. mean tha control on it splash.

where is problem?

C# Is My World

WorkflowApplication.Run, SqlWorkflowInstanceStore and Delay Activity not resumed(?)

Hi all, 

I am trying to leverage the persistence on our own BPM application built upon BETA 2 of WF. We have a WCF service that accepts external "RunWorkflow" requests, that, in turn (on the WCF method implementation) create the WorkflowApplication, loads designed XAML, and runs the workflow itself.

I added a Delay activity and added SqlWorkflowInstanceStore instance. Basically on my logs, I see that the Workflows runs fine until Delay activity is reached. The Workflow gets Unloaded correctly but is never resumed.

Obviously I installed and configured the  Workflow Management Service correctly (I suppose) by making it point my instance database, where the appropriate scripts have been executed.

Looking at the  SQL Profiler, I see activity of the Management Service. 

I tried to look into the [System.Activities.DurableInstancing].CommandQueueExecutionLogTable and  [System.Activities.DurableInstancing].CommandQueueTable are empty.

The table 

Contains some rows (at each new worfklow appends a new instance and this is fine)... however wiht the "ExecutionStatus" set

Instances not unloading on Delay Activity


Hi there,

We have an application that uses a Delay Activity with a timeout set to 10 seconds. We have set up persistance to unload on idle, but for some reason instances don't seem to unload when they reach this particular delay activity. Our loading interval is 30 seconds and my guess, that I would like to confirm with you, is that instances do not get unloaded when they reach a delay activity with a timeout that is shorter than the loading interval. Can this be correct?

Thank you in advance!

// Peter


Activity field xml serialization problem


Hello,first of all I beg your pardon if my question could be out of topic, but I don't know where to address it. I'm working with 3.5 workflow foundation and I have a custom activity with a field of type DictionaryList, which is a serializable class containing some simple typed members, and a FeedbackItem[] member. FeedbackItem is a serializable class containing an ID (int), a Type (System.Type) and a Value (System.Object) fields. In the designer when I edit the custom activity, and I set the List Property (by using a PropertyGrid) i fill the DictionaryList class with all fields including the array of FeedbackItem. When I save the designer saves the workflow in a xoml file. When I load the xoml in the designer and I open the designer of the List property of the activity the DictionaryList object stored in previous session is missing the contrent of the FeedbackItem array; the FeedbackItems property has a FeedbackItem[0]. It seems like the xml serializer serializes the DictionaryList object but it can't deserialize it completely. Is there something I have to beware of? It's possible that some field in the FeedbackItem is not serializable and causes some error in deserialization process? I don't understand because il I edit the xoml file I can read the array like this:

    <x:Array Type="{x:Ty

How to implement delay in code activity


Actually i want to use the delay in async code activity. 

For example, In my async code activity i am trying to check the file presence in a folder, if file is not present i have to wait for some time (consider 30 seconds), after 30 seconds i have to check the file again.

Can any one help me, hwo to implement this in async code activity.


Thanks raj

ASP.NET Repeater Combined with jQuery FAQ Plugin Demo

The plugin is really straight forward. You just have to add your FAQ items in a header element such as an h2 and content sections in spans. This could be done in a pure HTML page or the FAQ items and content could be pulled from a database or XML file like I did in the download. Once the markup is built, the plugin does the rest. It will hide the content sections, add click events to the headers to open and close the content sections, toggle the plus/minus symbols and build the index shown on the right if you want.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.
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