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

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

Enumerating Variables & Arguments in Rehosted Designer

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :Windows Application
I'm trying to enumerate the variables and arguments of a workflow after I load it into my rehosted designer.  I see that I can use ActivityMetadata.GetArgumentsWithReflection() and ActivityMetadata.GetVariablesWithReflection() but those require that I have ActivityMetadata to start with.  So the real question is, how do I get the ActivityMetadata once I've done MyWorkflowDesigner.Load(XamlPath);?Thanks in advance.ChuckChuck Berg | Consulting Engineer | Corporate IT - Station Casinos, Inc.

View Complete Post

More Related Resource Links

Sharepoint Designer need help returning Variables

Ok I am nearly there now with my holiday request form I have two lists one the is called annual leave reamaing this has the following columns Employee Name: Text Total Days: Number Days Taken: Number Days Remaining: Calculated Total Days - Days Taken and the other is the holiday booking form Employee Name: data taken from Employee name on annual Leave remaining Date From: Date Date To: Date Total days Taken: Number I am creating a workflow in sharepoint designer that when a new item is submitted someone gets tasked to approve or reject the holiday. If they approve it the annual holiday remaing list gets updated with the new days that are remaining and the user who created the item recieves an email also stating how many days that they have left, I had this working fine in Sharepoint 2007 however the variables that i am creating to capture data do not seem to be working properly. If i do a calculate in designer which is days requested plus days taken i get the input box called lookup for number displayed where i can pick the variables that i want to calculate but there is a new box at the bottom now which gives me the following choices As Double lookup Value (as Number) User ID (as Number) My ones are set to as double im not sure what they actually mean but it seems what ever i set them as i am not getting the correct information back. Lets say that a user books 10 days they ha

How to directly open activity on rehosted designer

Hello Everyone,      Let's say you have a rehosted designer that contains activities within activities.  Some of these activities are not shown on the designer because of the nesting.  Now lets say you know the name of one of the hidden nested activities and want to programmatically open the DesignView to this one activity.  How would one do this?  I was thinking about creating a miniature visual tree showing every activity in the workflow.  Clicking on an item in this mini-tree would open the main designer to that activity, this would allow for quick navigation to deeply nested activities.  Is this possible, or am I hopelessly delusional?  I'm thinking the tree itself could be fairly easily built from the xaml text itself, however causing the designer window to switch to an arbitrary activity view may be another matter. Thanks in advance everyone, Bob

NullReferenceException in ReHosted Designer on double-click

Hi,   I have a WinForms application with a rehosted workflow designer (WF4) and although my xamlx workflow opens in the designer without error, I find that when I drill down into the SendReceive activities I get a NullReferenceException as follows: NullReferenceException: Object reference not set to an instance of an object, at System.Activities.Core.Presentation.FlowchartDesigner.CleanupFlowchart() at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)... I'm running on Windows 7 x64. Any help with this would be hugely appreciated. Thanks, Stuart  

How do I generate service reference activities in my rehosted designer

My desginer is used to create lots of xamlx workflows.  These are hosted in app fabric. From Visual Studio I can add a service reference that points to my workflows, and it generates activities in my toolbar that I can use to call my service from another workflow. I'd like to do the same thing from my rehosted designer.  I figured it would be something like calling svcutil.exe, but couldn't find any information on this. Does anybody know how to create xaml activities by pointing at a service for a workflow designer rehost?   CheersJason Bolstad

Rehosted Designer does not display custom Activities with custom ActivityDesigner


In a custom Rehosted Designer, when attempt to load a custom activity that has the Designer Attribute, referecing a custom ActivityDesigner, the rehosted designer display only the message "Could not generate view for MyCustomActivity" with red backtext.

When the mouse pointer is passed over the text, the following message is displayed:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation, --> System.Exception: The component 'Procwork.Software.Mersey.CORE.Common.ProcessManager.Designers.BusinessSourceActivityDesigner' does not have a resource identified by the URI '/Procwork.Software.Mersey.CORE.Common.ProcessManager;component/designers/businesssourceactivitydesigner.xaml'.
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Procwork.Software.Mersey.CORE.Common.ProcessManager.Designers.BusinessSourceActivityDesigner.InitializeComponent() in c:\Procwork\PW.Mersey\Modules\CORE\Common\ProcessManager\Designers\BusinessSourceActivityDesigner.xaml:line 1
       at Procwork.Software.Mersey.CORE.Common.ProcessManager.Designers.BusinessSourceActivityDesigner..ctor() in C:\Procwork\PW

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,

Detecting changes to a workflow in rehosted designer.


Is it possible to check to see if any changes were made to a workflow in the rehosted designer? I'd like to prompt the user to save their changes if they are trying to close or load a different workflow and they have not yet saved them.


Failed to display the IActivityTemplateFactory designer as a root activity on the rehosted applicati


Hi guys,

I have created a custom composite activity that derived from the Activity and IActivityTemplateFactory. When I try to deploy this composite activity as a root activity on the rehosted application. It failed to display its designer probably. If I put a sequence as a root activity, and the composite activity as a child activity inside the sequence activity,  I got my composite activity designer display nicely on my rehosted designer. Is it a limitation for us to put a IActivityTemplateFactory designer as root activity in the rehosted app. Please advice.


public class CustomCompositeActivity : Activity, IActivityTemplateFactory
  public Activity Create(System.Windows.DependencyObject target)

    return new Sequence
       Activities = 
          new WriteLine
            Text = "Hello"
          new WriteLine
            Text = "WF 4.0"

Rehosted Designer: Using custom activities from dll


I adding to activities toolbar my custom activity, made in rehosted designer and compiled via msbuild.exe . Then I dragging it from toolbar to my workflow view. But when I try to compile or just run activity , which is using activity from the dll, there is the error. It cannot find type of needed activity in dll. Dll is in designer's executable folder.

=Sorry for my english

Working with sub-workflow in rehosted designer?


Is it possible to work with a sub-workflow (i.e. subset of the workflow in the designer). For example a sequence, a flowchart, or any activity inside the workflow.

My idea is something like these:

  • Save the subworkflow to a file (for example, save the selected Sequence activity)
  • Load a saved subworkflow and add it into current workflow
  • Add a sub-workflow as an item in toolbox
Are these even possible?

How to get Rehosted Workflow Designer selected property from PropertyGrid



How to find the selected Property from PropertyGrid in Rehosted Workflow Designer.

Suppose if I select the Assign activity To Property, I need find this selected property from code when I click some button.

Hanumantha Rao

What does "property" direction of arguments editor in WF designer mean?


When you use the WF designer for managing Arguments, the direction column has several options including "in", "in/out", "out" and "property".  What does the "property" choice mean?

Thank you,


WF4 Rehosted Designer Custom Expression Issues......



As we don't have the intelligence support in WF4 rehosted designer itself, we wanted to provide the custom window to build the expressions. To open the custom window we have used IExpressionEditorService, IExpressionEditorInstance…

Code to open Custom Expression window.....

public class CustomExpressionEditorInstance : IExpressionEditorInstance


Adornments on activities in rehosted designer not working for activities without a custom designer


I've been working with the sample provided at http://blogs.msdn.com/b/kushals/archive/2010/01/04/base-designer-with-additional-adornments.aspx and the workaround suggested for activities that don't have a custom designer (http://blogs.msdn.com/b/kushals/archive/2010/03/12/base-designer-with-additional-adornments-ii.aspx). However, I cannot get the adornments to work - they simply do not show up. I notice that someone else had the same problem as me and posted a comment on the second blog article and didn't get a reply. I've also tried contacting the author with no success.

Does anyone have the source code to the sample, or know how to get it working?

[edit]: found the answer: http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/e141211b-c998-42a6-b57a-71191aed103d/#588182c8-9bf5-439d-9e79-c98187fec4ce

SharePoint Designer

This video series shows you how to quickly and easily build complex business solutions on the SharePoint platform. Microsoft Office SharePoint Designer 2007 Business Administrator Training is a one-and-a-half hour, 300-400 level training series, produced in collaboration with the SharePoint Product Team and Total Training

Temporary tables in SQL Server vs. table variables

When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.

Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



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