.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

Can't I have more than one event on a StateMachine Workflow?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JavaScript/VBScript

Hi all. I'm a newbee on workflow foundation and I'm facing the following problem. I built an State Machine with 3 States. When I pass through on the State 1, I call an ExternalMethod that calls a method 'OpenBug' defined on my interface. This method raises an event that is caugh by the host application.

The callback function on the host application is registered. The problem is I'm getting the following error:

Terminated with error System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Workflow.Activities.EventDeliveryFailedException: Event "BugOpened" on interface type "ClassLibrary1.IBugService" for instance id "8e3613fe-5985-492c-a421-9e233a7cfbf4" cannot be delivered. ---> System.Workflow.Runtime.QueueException: Queue 'Message Properties
Interface Type:ClassLibrary1.IBugService
Method Name:BugOpened
' is not enabled.  

Following is my code


Host application


using System;<br/>

using System.Collections.Generic;<br/>

using System.Linq;<br/>

using System.T

View Complete Post

More Related Resource Links

InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


Infopath button click event in custom workflow code.


Hi All,

I have designed the infopath form(Init) and integrated with my state machine workflow. i want to access button click event (designed in Infopath form) in my workflow code.

Can you help me.




Binding event or interacting with WorkflowDesignSurface in Workflow Monitor

Is there any way to modify the sample Workflow Monitor class so the user can interact with the diagram, for example;    1) being able to select an activity in the diagram and get back an event of which activity was selected? and/or 2) being able to trigger an if else branch by clicking on the diagram. Any pointers to howtos/tutorials will be helpful, thanks!

How does the workflow engine receive the external event?

WorkflowRuntime workflowRuntime = new WorkflowRuntime(); ExternalDataExchangeService dataExchangeService; dataExchangeService = new ExternalDataExchangeService(); workflowRuntime.AddService(dataExchangeService); PaymentProcessingService paymentProcessing; paymentProcessing = new PaymentProcessingService(); dataExchangeService.AddService(paymentProcessing); With the code above, our application can use paymentProcessing.RaiseXXXXEvent to interactive with the workflow instance. My question is : What's the principle to implement such a mechanism. I think this is a kind of Event Driven Pattern, but how can I implement this mechanism and why ? Please point me the direction or any references are appreciated. By the way, is there the mechanism in jBPM ? Does jBPM include sequence workflow and state machine workflow like window workflow foundation ? Thanks ! Dummy

pass data to event in workflow



i have the event that calling  my workflow to start,then this workflow when is completing must passing data to this event.

how i can call(and pass data to)event in sequential workflow programming?(in sharepoint2010,visual studio2010) 


WorkFlow Event Reveiver parameter "properties.ActivationProperties" is null.

I have been trying to write the event receiver on completion of my out of box "Approval - Sharepoint 2010 workflow" set on a Site Page library. I need to update some column on completion of the workflow.

So for this I need is the list and listItem to which the workflow is attached and the column that I need to update. I understand I can get this using "properties.ActivationProperties" but what I get is null value for this. Can someone help me in this regard? I also tried reading the same in workflowStarted event but even there I get the value as null.

how to create date time event in sharepoint workflow



I want to change the status of a list item one month after its approval. which event should i fire and how do i do it in workflow. any idea.



workflow pause and event handlers


Hi All,

No matter what I do, if I pause my workflow, and then update a list item after the pause is over, my event handler on update list item will not fire, though the item has been updated! No matter I use Set Field or Update Field, same result. If I do not use pause, it will fire. 

I need pause to give user sometime to react, if he doesnt then remind him. Can use Wait Until Due Date etc., but why not pause. (Not sure, if event firing will work with Wait Until Due Date even.)

Any ideas will be much appreciated.


Rehman Gul

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

Error loading and running event receiver Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventRecei


Hi all, i found the below error in event log. How can i fix this issue.

Event ID: 6875            Source: Windows SharePoint Services 3

Error loading and running event receiver Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver in Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Additional information is below.

: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Please help me out in this issue. Thanks in advance.


K2Blackpearl, Sharepoint, .Net

SSL System Impact on Sharepoint BDC, Workflow & Event handler



if SSL  implement on existing  Sharepoint portal .what is the impact of  existing Sharepoint BDC, Workflow &  Event handler ?




Surendra Singh

How to get Workflow Runtime outside SharePoint Workflow class, while calling Handle External Event?



I have a state based workflow. Now, i want to change its state based on the event raised by my form(Like on Submit). I created the workflow and started it on the item in a doc Library. But, now when i want to register an external event we need to add that local service to the workflow runtime of the current executing workflow.

I am not able to find any way to do that or a workaround to achieve the same.

Does anybody has any idea about this??

Auto Save Workflow after any ModelChanged event....


1. After any changed to work flow I want to save my workflow locally on disk (e.g. similar to _workflowDesigner.Save(FileName)). When I call _workflowDesigner.Save within ModelChanged event none of my changes are reflected in that File which gets Saved...



2. Under which scenario TextChanged event gets raised ?

SharePoint 2007 workflow problem Application Event Viewer shows Event 1314

I created a state machine workflow that works well in a test environment with only one user. When attempting to run the workflow in the production environment, the user sees the message operation in progress. The workflow will not continue. The event log on the server shows Event ID 1314, Event Code 4011. It looks like this has something to do with permissions on the server but I'm not sure where to go from here. I've Googled this and not been able to find a resolution. Any help would be appreciated.

Workflow event handler


Hi ,

I am new in sharepoint custom workflow.I am creating a sequential workflow in visual studio on a list.Initially it has only two steps OnWorkflowActivated and then onWorkflowItemChanged1.When I am running this workflow with breakpoints on new list item creation ,break point reaches to onWorkflowActivated1_Invoked with workflow status In Progress.Again  when I have edited the list item  breakpoint goes to onWorkflowItemChanged1 event handler first then   InitializeComponent(); ( constructor) and again onWorkflowActivated1_Invoked handler with final In Progress status.

I am not able to understand why onWorkflowActivated1_Invoked handler again executed on item edit after onWorkflowItemChanged1 handler and why workflow status always shows In Progress

Please help


Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.
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