.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

Hidden Workflow Arguments to System.Activities.ActivityBuilder

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery

Hi, I have rehosted the Workflow designer, and the base activity that i load is the Activity Builder(workflowDesigner.Load (activityBuilder);)

I basically need to add in some details to the activity, and the value of which the user should not be able to edit (or may be even see on the designer surface). For this I am (currently) adding some arguments as follows where i can add in the extra information.

activityBuilder.Properties.Add (new DynamicActivityProperty { Name = "HiddenArgument", Type = typeof (string), Value = "Value that the user should not edit." });

But as these arguments are visible on the designer surface in the Arguments Panel on the bottom of the designer, the user can edit this. i also have other arguments that the user is allowed to edit so therefore i cant disable the whole arguments pane.

I would just want to know how can i add my information to the workflow(and obviously save it in the *.XAML file) so that the user cant edit (or see) this information.

EXTRA DETAILS: I basically want something like, if i create a custom activity i can add properties with [Browsable(false)], which causes the user to not see the property on the right side pane but hold a value!

View Complete Post

More Related Resource Links

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.

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

Exchange 2000: Web Storage System, Workflow Tools, and CDO Turbocharge Collaboration Apps


Microsoft Exchange 2000, the upcoming version of Exchange Server for Windows 2000, provides many new features including integration with Active Directory, Web Storage System events and forms, and a new version of Collaboration Data Objects (CDO). Exchange 2000 also provides a workflow engine and design tool to create workflow applications. This article will give you an overview of these new features and looks at ways to do a few standard tasks with the new version of CDO. Also included is a sample workflow application that manages the posting of messages to a public server to illustrate the new workflow engine and workflow design tool.

Sean McCormick

MSDN Magazine July 2000

Collect Feedback workflow hidden field


Hello all,

I am using the out of box Collect Feedback workflow.  It works well for most part.  However I would like to get reviewer's feedback to be shown on a Dashboard.  Is there a way to expose that information in a Data View?  I couldn't figure out which data field stores the feedback information.


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        

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?

Examining the context/arguments for an idle workflow

Short version: How can I get the values of arguments for an activity that's been idled?  That is, is there some way to load the activity up (without resuming it) so that I can retrieve the values of the arguments? Long version: I have an activity.  It takes in a large amount of information via its arguments, emails a user that they've got work to do, and then creates a bookmark and idles.  That part works fine. The user clicks the link in the email and goes to a page that presents to them information about the work they need to do.  This information comes from the arguments passed into the activity.  I'm missing the magic link that'll get me that information.  I could have the activity persist all of its arguments to the database, but this seems redundant (as the instance is already persisted to the database) and inefficient (I only need this information while the activity is idle).   What am I missing?

Group activities in to rehosting workflow.

I want to group multiple activities in rehosted workflow designer.

'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 ?

approval workflow showing modified name as system account

Hi, I have an approval workflow for page library, when normal user, who have contribute permissions has modified the page content , but the version history of the page showing the modified name as system account instead actual name. Here i need to display actual user name. thanks.

System.Workflow.Runtime.Hosting.PersistenceException Timeout expired.

Is there a way for me to set the CommandTimeout property on the SqlCommand. I can see that there is a DbResourceAllocator that has a NewCommand that creates the SqlCommand but there is now way that I can change the CommandTimeout property. My workflow is quite large and I am save the Tracking information as well with the SharedConnectionWorkflowCommitWorkBatchService. These are the service that I load: string connectionString = ConfigurationManager.ConnectionStrings["DBConnectionWorkflowTracking"].ConnectionString; SqlWorkflowPersistenceService persistenceService = new SqlWorkflowPersistenceService(connectionString); persistenceService.EnableRetries = true; wr.AddService(persistenceService); SqlTrackingService sqlTrackingService = new SqlTrackingService(connectionString); sqlTrackingService.PartitionOnCompletion = true; sqlTrackingService.EnableRetries = true; wr.AddService(sqlTrackingService); SharedConnectionWorkflowCommitWorkBatchService wb = new SharedConnectionWorkflowCommitWorkBatchService(connectionString); wb.EnableRetries = true; wr.AddService(wb); wr.AddService(new CallWorkflowService()); wr.AddService(new CallWorkflowWorkflowLoaderService()); Can anyone help? Thanks Gert   

System.ArgumentException : The input workflow type must be an Activity.


Hi everyone! I’m getting this error when starting up the workflow:

System.ArgumentException : The input workflow type must be an Activity.
Parameter name: workflowType

The code I’m using is shown below:

using (var wf = new WorkflowRuntime())
  wf.WorkflowCompleted += (_, __) => signal.Set();
  wf.WorkflowTerminated += (_, __) => signal.Set();
  var args = new Dictionary<stringobject>();
  args.Add("Input", plainText);
  var inst = wf.CreateWorkflow(typeof (HtmlTypography), args

Cannot set a user column to SHAREPOINT\system by workflow?


I created a list item programatically. So the workflow assoicated with the item will not start automatically. I started the workflow then by codes.

However, in this case, the workflow can not update a user column of an item in another list to the modifier of the item created by codes. The modifier is SHAREPOINT\system.

I can do this through SharePoint UI, the user will change to {domain}\Administrator automatically after I put SHAREPOINT\system. So I have to modify my workflow to assign administrator explictly in this case.

Two questions:

Is it a bug of spd workflow? both SHAREPOINT\system and {domain}\Administrator has full control to all the lists.

Or is there anyway to specify who starts the workflow programatically?


List does not exist -- AutoStart Workflow: System.NullReferenceException:


I have been in a discussion on the MSDN forums concerning a site with which I am having considerable issues.  (http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0feaf4c7-77cd-46c6-b3cd-4d18c69b18c3)    There is one issue that keeps cropping on one of the pages on that site.  The page is a customization of the EditForm.aspx which is being used to edit folders. We call it EditFolderForm.  Like the EditForm it uses a DataFormWebPart.  It also has a SharePoint:SaveButton  and a SharePoint:GoBackButton.  The Listid on the page has been confirmed to be the correct ListID.  Clicking the SaveButton causes the following two errors:

List does not exist  The page you selected contains a list that does not exist.

and then

AutoStart Workflow: System.NullReferenceException: Object reference not set to an instance of an object.

I have found references that mentioned getting these messages for custom made workflows that are built on Designer.  However the workflow being called is a built in SharePoint Workflow so that none of the suggested fixes will work.  (Also it seems that the workflows that cause the issue seem to be sending

Validating activities sequence in a workflow

Dear all,

I rehost a workflow designer and there is a flowchart activity as a default root activity in it. I want to validate the activities in the flowchart was arranged in the right order, e.g. Activity2 must be performed before Activity3, Activity1 must be performed after Activity3. How can I do it programmatically to the Xaml content generated by the designer?

Thanks in advance.

How to set an overload group on arguments in the workflow designer?



I'm wondering how to set an overload group (http://msdn.microsoft.com/en-us/library/ee358733.aspx) to arguments using the workflow designer. If I click on an argument in the Arguments tab in Visual Studio, the properties window shows a checkbox for the Required attribute, but no property for the OverloadGroup.

Is there a way to use overload groups in the designer?

Thanks 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