.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

Workflow persistence with a non-serializable variable

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Windows Application
I'm using Entity Framework and WF4. I want to be able to persist a workflow but one of my variables in the workflow is an EF ObjectContext. Is there a way to make the workflow persist-able and when it re-hydrates, has a fancy new ObjectContext instance?Blades Don't Need Reloading...

View Complete Post

More Related Resource Links

Persistence not reloading workflow properly

To start with, some background on the project I'm working on. It's basically a todo list. I have a workflow with activities that will send a message to the UI layer to display a todo item to the user when that point in the workflow is reached. The todo activity is set up so that each time the activity context loads, it will send out a request to show the todo item if the activity is in executing status. This is a multiple host environment, so instance ownership is of interest during persistence (I use the SqlWorkflowPersistenceService). I originally was trying to set this to a max timespan. It works ok, except it relies on the closing of the application to call dispose on the workflow runtime in order to remove the ownership. If the application crashes, I have a manual "unlock workflow" functionality. That is a bit of a pain, so I thought I'd try a small ownership duration, but it's not working quite right. When I first load the workflow into the client, everything shows up fine. I have a refresh functionality that also works fine as long as the ownership duration hasn't been reached. Once it is reached, the todo item doesn't show up. I believe the workflow is not even loading from persistence. I've been testing it with a single runtime, so I know there are not any other runtimes taking ownership. Here is what I do during a refresh: for each workflow in run

How to persist workflow with non-serializable arguments

I have a workflow that has some arguments for underlying components (DAL implementation, email sender etc). It also has a  WCF data contract and other serializable arguments. I need to persist and unload this workflow and then resume later on. It is throwing an exception because it is trying to serialize and persist all the workflow arguments. Is there a way to get the serializer to persist only those arguments that can be serialized?

Change Variable and Argument editor in workflow designer?

Is it possible, in Beta 2, to customize the behaviour of the editing grids use for entering data about a workflow's variables or arguments in the workflow designer?  Can I:- add my own custom column to the grid?- can I customize the variable type drop down editor? (e.g. have my own editor or otherwise filter the list of types)- can I change the "default" expression editor (and possibly remove it)?Thanks,Notre

Dynmic updation of Variable name in Workflow 4.0

Hi, I have created couple of variables & used them in workflow. Now suppose client changes the name of a variable then that has to be updated dynamically at all used places in that workflow. Any suggestions to achieve this...

workflow 4 correlation / persistence question

Hello all, I would like to understand why the following behavior takes place. In most cases my workflow that runs monthly account renewals works just fine. But with selected accounts it gets stuck. What I mean by stuck, is that a record is created in System.Activities.DurableInstancing.InstancesTable (in my persistence db), but IsInitialized remains to be set to 0 (so is IsSuspended, IsReadyToRun). When I step through my workflow, I see that the problematic accounts do not pass InitializeCorrelation activity (I pass an AccountID to initialize AccountIDHandle). What I can't figure out is  where InitializeCorrelation looks to determine if a flow with a given AccountID already runs? I killed all the instances of workflows in the database using DeleteInstance stored procedure, so InstancesTable has no rows. And yet the same problematic accounts trip over InitializeCorrelation activity - a new instance of a workflow will be created and stored in InstancesTable with IsInitialized = 0. Thank you very much, Andrei  

how to trim a string value of a workflow variable using SharePoint designer.


I build a custom workflow using SP designer and have a need to trim a string value of a workflow variable. I tried using Calculation or Dynamic String builder but without success.

i store a user name type value into workflow variable called  check_name_var (string type). the logon name have this format  domainname\first_lastname 
how do i trim this value in check_name_var to only first_lastname.

Can anyone show me how or have suggest on how to accomplish this or is it possible to do this in SP designer?

Thanks for your help

Windows Workflow Persistence Service using Oracle Database



We are using windows state machine workflow. We need to use Oracle for persisteing and tracking workflow instances. Can anyone provide custom services for Oracle?

We have even tried WFTools but not able to connect to Oracle database. Please provide the same code if anyone has tried.





Workflow in two sides : SQL Persistence in the WCF Service side + Workflow logic in the client side



I'm new in Windows Workflow Foundation 3.5, and I red some documentation.

Now, I would like to know if an architecture is possible in my case :

- WCF service with SQL Service access : put in it the Workflow SQL Persistence. I know that this part can be ok alone.

- Client side (ASP.Net) : put in it the Workflow logic. Ex : know when we are in a given state, and display icons and text related to this state, and know what is the next available step.

Is this architecture possible, and how to manage it in a few words ?


Workflow used with : WCF + Persistence + Tracking : how to manage ?



My question is simple : how to manage both all these technologies in the same project ?

Framework : Workflow 3.5 VS2008

What files are in the Workflow WCF Project :

- the interface for methods exposed.

- the Workflow C#.

- the app.config file.

What I already know how to do :

- Workflow WCF with SQL persistance and activate SQL Tracking

What I don't know how to do :

- Publish WCF methods in the same project for querying the tracking database (C# classes used : SqlTrackingQuery and SqlTrackingQueryOptions)

How to manage it ?

Thank you.

Problem passing local variable for Approvers email in customised Approval workflow


I am building an Approval workflow using SPD and have used the Start an Approval Workflow task action.

The workflow works on a change register and looks up different list of approvers assigned to change items.

Using Local Variables, the look up assignment works fine.

My problem is that when I pass the Approvers variable to the email at the end of the workflow (the on Current Item with... part) it appears the variable in empty?

I have used the approach of adding a variable check in the content of the emails - as the workflow sends the emails anyway. The lookup works fine - it’s just the email at the end of the process that does not seem to be able to see the contents of the variables that are shown to be set earlier.

Workflow with id "xx" not found in state persistence store.


I have a state machine workflow having around 15 states. In few of the states I am using SqlWorkflowPersistenceService to persist the workflow instance into the database. Workflow is using WorkflowInstance.Unload() method to manually persist the workflow instance and UnloadOnIdle is set to false. Workflow service is hosted as WCF service on a windows service.

Problem: The states which implements SqlWorkflowPersistenceService to persist the wf instance calls another WCF service (which may take a lot of time) and then persists the instance. WCF service when finished with its processing responds the Workflow service by calling the operation contract associated with the Receive Activity in the next state of Workflow Service. Everything runs fine if the WCF service takes some time to respond the Workflow back. But sometimes it happens that WCF service has nothing to process and it responds immediately to the workflow, in this case workflow throws the error "Workflow with id “xxxxx” not found in state persistence store." 

What I think here is when WCF service reponds back to the WF immidiately then WF is still busy in persisting the WF instance. WF Runtime finds no wf instance in memory and checks into the persistance database. Since WF instance is still in the process o

How to set or assign a Workflow Variable from data entered in a Form Web Part


Greetings -

I have a Form Web Part wherby the user enters a number

That number is sent to a subsequent Data View WebPart that uses the number to pull data from another source via a Web Service.

This all works fine. BUT

I'd also like for that number entered into the Form Web Part to be set as a Variable to be used until a new number is entered into the Form Web Part when the variable will be changed accordingly.

I need the newly set variable to be later used for filtering out data in other lists and views.

I also need the variable to automatically set a field in any newly created list item.

Gurus, please help.

How to assign a workflow argument with Direction=Property to a workflow variable?


I created an argument 'ArgTest' with Direction=Property and ArgumentType=String and a variable VarTest with VariableType=String.

I'd like to assign ArgTest to VarTest. Direct assignment (using Assign activity) doesn't work, because there is a compiler error "'ArgTest' is not declared. It may be inaccessible due to its protection level".

I tried to change definition of Assign activity in XAML using PropertyReference (which is System.Activities. ActivityPropertyReference) :

<Assign sap:VirtualizedContainerService.HintSize="242,58">
  <OutArgument x:TypeArguments="x:String">[VarTest]</OutArgument>
   <PropertyReference x:TypeArguments="x:String" PropertyName="ArgTest" />  

, but I got runtime error: "Object of type 'System.String' cannot be converted to type 'System.Activities.Activity`1[System.String]'."


From another reasons it's important for me to have Direction of ArgTest set to Property instead of In.

I believe the solution must be easy, so I feel like I'm missing a trick. Thanks in advance for any pointers.

How can I show data from a Workflow variable in a Collect Data from User form?



I have collected some data from a user in a SharePoint Designer workflow step and I now want to display that data in a second "Collect Data from User" form at a subsequent step in my workflow.  How can I add the content of my Workflow data variable in the Collect Data from user form?

This guy says he has done something similar but does not explain the detail: http://www.mstechblogs.com/paul/spd-workflow-collect-data-from-a-user-modify-the-generated-task-form

I'm keen to hack at the aspx form in SPD but I really need the particular line of code that will do it as I'm not a developer.

Your help is greatly appreciated!

How can I show data from a Workflow variable in a SharePoint Designer Collect Data from User form?



I have collected some data (a comment) from a user in a SharePoint Designer (SPD) workflow step and I now want to display that comment in a second "Collect Data from User" form at a subsequent step in my workflow.  How can I add the content of my Workflow data variable, or even data from my original item, in the Collect Data from user form?

The Collect Data from user form is generated out of the Workflow Tasks list and only contains the url of the item where I could store the comment and which has the workflow attached to it.

This guy says he has done something similar but he appears to only use the URL and static info and does not explain the detail in any case: http://www.mstechblogs.com/paul/spd-workflow-collect-data-from-a-user-modify-the-generated-task-form

I'm keen to hack at the aspx form in SPD but I really need the particular line of code that will do it as I'm not a developer.

Your help is greatly appreciated!

Architectural insight for a workflow persistence/tracking problem

I'm working for a client who has many (~200) SQL databases containing client information.  My client would like to store each of their customer's workflow persistence/tracking information within their respective database.  This is needed because the databases need to be portable so they can be moved from a client site to a hosted environment and vice versa.  They want to handle all of the workflow processing from a single Windows service.  My initial thought is that I'll need to rewrite the SqlWorkflowPersistenceSerivce and SqlTrackingService services to be able to handle this requirement.  This rewrite would include the ability to scan all of the databases on a periodic basis for workflow events that need to be processed.  This sounds like a bit of challenge, and I want to make sure that I'm not overlooking something simple.

Any expert opinions on this?
Matt Ruwe

Assign SharePoint list sum total value to a sharepoint designer workflow variable


I have a similiar question and get answered but the solution is possible but not simple as I thought.   So I like to ask it again

I use SPD to build a workflow and I need to be able to get a SharePoint list column sum total value to assign to one of the workflow variable.

Do anyone have a similar situation and have came up with a solution , please share

Environment is  MOSS 2007 /SP2.

Thanks you so much in advance.


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