.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

Dynamically get the current instance of the workflow within a re-hosted WPF application

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Windows Application


the scenario is: I create a re-hosted WPF application for the workflow designer, and within this designer I can edit the workflow(sequence, flowchart) with pre-defined and custom activities. The question is, how can I programmatically get an instance of the current workflow. Thereafter I can do some manipulations on this instance.



View Complete Post

More Related Resource Links

Get the current workflow instance ID in a WF4 workflow service


Is it possible to somehow query the current workflow instance ID (or another unique identifier) within code executed as part of a workflow service?


public sealed class SomeCodeActivity : CodeActivity
  public InOutArgument<List<string>> Messages { get; set; }

  protected override void Execute(CodeActivityContext context)
    var logger = new SimulatedLogger();

public class SimulatedLogger
  public void CreateLog(IList<string> messages)
    //This line throws an exception

How to share a single workflow instance across diff pages of asp.net application..?



I am using WWF 3.0 with ASP.Net application with two pages of form submission and approval.

The submission form instantiates, starts the workflow and completes half part of the workflow. In the approval page the suspended workflow has to be resumed to get completed(throught HandleExternalEvent Activity). In this case how i can use the same workflow instance between two different aspx pages..?


Can I dehydrate the Workflow object as well as the instance?

Hiya All Can I dehydrate the workflow object (i.e. not an instanciation of it) into SQLServer?  I want to save all versions created of a workflow so that I can chose to instanciate the workflow from any of the previous versions if I need to. This is due to a compliancy issue - being able to reconstruct the data created by a previous version of a workflow to prove accuracy. ThanksMichelle x

Is there a way to check if workflow instance already exists for a particular productID in Workflow o

I am using Visual Studio 2008 and .NET 3.5. I am trying to build a WF that is exposed as WCF hosted on IIS. This service is consumed by ASP.NET client. It is a very simple WF- receive info for new product "A"- send email to person 'Xyz' that new prodcut "A" is received- do some business process for product "A"- send out more notifications for product "A"Consider this scenario - - Client hits submit on asp.net page for prodcut "A"- new WF instance is created for product "A"- client can go back to the same page, edit some more info and hit save again. However, this time or for any subsequent "Saves",  I do not want to create a new WF instance for product "A".I can check to see if a WF instance exists for product "A" on the client side before calling the service operation. However, I want to see if there is a way to do this in WF or WorkflowServiceHost, as I don't want to add this logic to client. First acitvity in WF has to be receive activity with CanCreateInstance = true, so not sure how I can do this check in WF itself.Also, I have another stupid question, when using WF exposed as WCF service, do we have to implement all service operations using WF? What if I have some service operations that just involves checking some business logic? Do I implement this in a

How to keep my Workflow alive only during the time my client application is running ?

Hi, I want to my workflow do some action when server  lose connection with client and at the same time client get exceptions about it. It is possible to implement some session mechanism or something like that with workflow service ? Regards Marcin

System.InvalidOperationException: Instance operation is not valid on workflow runtime thread

Am getting the exception related in the title of this article when using the StateMachineWorkflowInstance object to arbitarily set state in my workflow code; and am unsure why.  The code follows below:   500     Protected Overrides Function Execute(ByVal executionContext As System.Workflow.ComponentModel.ActivityExecutionContext) As System.Workflow.ComponentModel.ActivityExecutionStatus   501    502    506         Dim smwi As StateMachineWorkflowInstance = New StateMachineWorkflowInstance(StaticWFRuntime.LocalRuntime, Me.WorkflowInstanceId)   511    512         'set workflow-wide database connection string   513         _connectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString   518    519         Utility.LogEnabled()   520    521         Utility.FoaeaLogger.WriteEntry("Processing TracingApplication.Execute()....", EventLogEntryType.Information)   522         If StaticWFRuntime.LocalRuntime Is Nothing OrElse StaticWFRuntime.LocalRuntime.IsStarted = False Then   523             Utility.FoaeaLogger.WriteEntry("No static RuntimeService object exists!", EventLogEntryType.Warning)   524         End If   525    526         Return MyBase.Execute(executionContext)   527    528     End Function   796     Private Sub gotoState2_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)   797    798        

WCF Workflow Service Application - Required Extensions

Hello, I built a WCF Workflow Service App and I built a custom activity that requires an extension in the workflow. In a web app, I'm trying to create a service reference to the WCF workflow service but it says that an extension that is required has not been provided; so how do I consume a service with a required extension? At what point do I supply that extension in an ASP.NET scenario? Thanks. http://linkedin.com/in/brianmains

Display XAML workflow image in browser and hightlight the current Activity

I have a requirement in project to display the XAML workflow in browser as image like the Visual studio designer displaying and it should Hightlight the current activity in workflow.  Please guide me on this.rajeevkalyan

Developing common content pages that can be hosted at the Web application or TLS level and can be sh

We are working on a Publishing site and planning to provision each client as a sub-site under the top level site (TLS). All of these sub-sites will almost have the same web pages and based on the client specific requirement they can customize these pages if needed. To meet the above requirement: I want to develop common content pages or application pages with the publishing capabilities and host them at the TLS, making these common pages available for all sub-sites under the TLS with the following requirements. ·        Sub-sites will not have any of these pages on their own and there would be only one central copy of this common page at TLS. ·        The sub-sites should be able to access these common pages in their context that means using the sub-site specific Master page & Themes. ·        When there is a specific customization is required such as adding a different web part, or updating the HTML data on the page, the common page will be edited in the sub-site and eventually making its own copy of the common page and resulting breaking apart from the common page for any future changes. ·        When the user edits the page he should be alerted that customizing this common page will make a local copy an

Hosted Designer fails to load workflow xaml that has InArguments with default values (xaml saved by

I have hosted the designer in our app. Using the hosted designer, workflows are saved as xaml to a database. When an end user wishes to edit a workflow the xaml is downloaded to a file and loaded into the designer via the .xaml file. The user can also associate assemblies with the workflow and there is a mechanism which makes sure that these assemblies are loaded into the appdomain and available. The problem we are hitting occurs when the top level activity (Sequence) has InArgument with default value. I create a simple Sequence, add InArguments (type of Int32 and String)  and set some default values. I save the workflow xaml to the database and close down the designer. When I wish to edit the workflow and try to load I get the following errors Could not find member '{clr-namespace:}_e905.argument3'. Could not find member '{clr-namespace:}_e905.argument1'. suggesting that some assembly/namespace missing. Here is the xaml I try to load: <Activity mc:Ignorable="sap" x:Class="{x:Null}" this:_e905.argument3="99" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorl

Workflow Instance ID field in MS Access

Hello, please help! When I open a SP list with MS Access (Action > Open with Access), the Workflow Instance ID field is available with no data.  How can I get this field to display so I can create queries within MS Access using joins/relationships?  Thank you!

Book to learn and Develop enterprise application using InfoPath with workflow in MOSS 2007

Hi all, I'm new to infopath forms and i dont find much articles to develop enterprise application (I'm coding for an ERP module). I have sys environement of MOSS 2007, windows 2008 (64 bit), MS SQL 2008  Though it is easy to design and publish form to a site,  devloping the form with more business rules and validation seems to be vague for me. So please refer a good book to find the deveopment procedures to master Infopath with workflow integration. it is quite urgent. Thanks Gomathi Sha   sharepoint development

Urgent- How to show sequential workflow on asp.net web page dynamically

Hi All,My basic question is how can we show a sequential workflow diagram on asp.net web page dynamically. using WWF can we do this?. i have gone throgh the some of forums/articles but i could not find right information anywhere. please suggest me the right path to achieve this.

Passing value from one web application to another hosted in different server

I want to redirect from one aspx page to another aspx page of different application. Both applications are hosted in different application servers. I want to pass a value from one application to another. I tried - 1. Response.redirect with Query string - But query string is not secure as it is visible to user in browser. 2. Cookies - This is also not a secure way. Again if the cookies are disable in the browser it may not work. 3. Server.transfer - In different web application we cant use server.transfer. Please provide any easy solution how to achieve this.  I dont want to display the values to the user as it is confidential data.

Problems with "Set Field in Current Item" in SP 2007 Workflow

I have created a workflow in spd 2007 that begins by comparing two lists and if the “VendorName” is the same on both lists, I then auto-populating four fields by grabbing the values from another list within same site collection by using the “Set Field in Current Item” action. I have recently discovered that I cannot set additional fields beyond these four fields. I have tried this on two different sites using the same action (i.e. set field in current item) and the result is the same – I cannot add additional actions of this type? To remedy this, I removed duplicate instances of the workflow via List Settings > Workflow Settings > remove dups, but no luck. Problems still persists.   What would be causing this? Has anyone run across this issue? Help!   Thank you in advance.

Changing a current SQL 2008 Express Sharepoint instance to incl. Reporting services

I have a current instance of SQL 2008 Express that was created with a Sharepoint installation. Currently, that is the only purpose of the instance. We don't have management studio installed but from what we can tell by searching help screens is that instance is on SP 1 (10.1.2531.0) with Database Engine Services and SQL Server Replication. We need to now add Reporting Services. If we go to the Installation Tools to Add/Change the current instance, it asks for the SQL media which was from the original Sharepoint install. I have downloaded SQL 2008 Express with Advanced Tools but not SP 1. I've seen some threads where this wasn't a direct install. Ideally, I'd like to be able to change the current instance to add Reporting Services. When the wizard prompts for the media, will I be able to now point to the downloaed SQL Express w/ Adv. Tools even if it's not SP1? Thanks for your help. Tracy

How to get current user in an action of a workflow (without .NET coding) in SharePoint Designer


Does somebody know how to get current user (logon user) in an action of a workflow definition from the Sharepoint Designer 2007. I know how to do it by using .NET coding, but it requires to upload a dll to the bin directory of the application which is not an option due to my company Sharepoint policies.

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