.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

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

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

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"

View Complete Post

More Related Resource Links

How to display breakpoint and debug visual cues with custom activity designer based on WorkflowViewE

Hi,   I am developing custom activity designers based on "WorkflowViewElement" instead of "ActivityDesigner" in my xaml. It allows me to have greater control of the look and feel of the designer. However I noticed that with this approach, the breakpoint visual cue (Dark red solid circle that appears on the left side of the designer when you set breakpoint on the designer) is not visible. It works fine when you write your designed based on "ActivityDesigner". The same behavior happens to the debug visual cue when you debugging the WF. It appears as bright yellow rectangle surrounding the activity designer if you are based on "ActivityDesigner", but it is not available when your designer is based on"WorkflowViewElement". Any help is highly appreciated. Li

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

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

Is there a plan to support a custom activity type as a root document in xaml on VS workflow designer



Referring to the post below. It seems that the current VS workflow designer only support "Activity" type as a root document. Is there a plan to support a custom activity type as a root document in xaml on next release of WF?




How to use display Text in Hyperlink For SharePoint 2010 Designer Workflow


In SharePoint 2007 Designer, I have used the Hyperlink column to store the link "http://www.sharepoint.com/Default.aspx, Details". The details text will be shown in the Hyperlink column. Everything works fine in sharepoint 2007 Designer workflow.

In SharePoint Designer 2010 Workflow, I used the same method but the hyperlink column is displaying the full text "http://www.sharepoint.com/Default.aspx, Details" instead of only Details


[VS2008] Designer's display problem

Hello, I created a solution with multi-project and i've recently added some resources files to lacalized my application and of course my XAML files too. I used the "How To:" http://msdn.microsoft.com/en-gb/library/dd882554(v=VS.95).asp I inserted the class LocalizedString in one off my project that I use as library for common actions. But since, my designer is not loading properly because it can't find this class while I precised the good assembly and that the application is running properly with resources applied. It's then not handy to develop an HMI... If anybody has an idea about this trouble... Of course I tried dozens of times to clear the projects and regenerate without success. Thank you for your help !

Customer Activity Designer Problem - "Could not generate view for VisualBasicValue`1"

I'm reading Bruce Bukovics Pro WF4 book and in chapter 16 - Advanced Customer Activites, he details emulating a Sequence activity along with a custom designer. When I drop the custom activity into a new xaml activity, I'm getting all sorts of wierdness. The custom sequence activity has a condition property that determines whether to schedule each child activity contained within. Once I set a value in the ExpressionTextBox for the activity, Visual Studio starts showing in red "Could not generate view for VisualBasicValue`1" along with this error showing up in my error window: The activity 'VisualBasicValue<Boolean>' cannot be referenced by activity 'MySequence' because the latter is not in another activity's implementation.  An activity can only be referenced by the implementation of an activity which specifies that activity as a child or import.  Activity 'VisualBasicValue<Boolean>' is declared by activity 'MySequence'. Here is the source for the activity itself: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Activities; using System.ComponentModel; using System.Collections.ObjectModel; namespace ActivityLibrary { [Designer(typeof(ActivityLibrary.Design.MySequenceDesigner))] public sealed class MySequence : NativeActivity { [Browsable(false)] public Collection<Activity&

Enumerating Variables & Arguments in Rehosted Designer

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.

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

Custom designer for a Flowchart activity?

Can anyone point me in the right direction for developing a custom designer for a Flowchart activity?  In actual fact, the Flowchart control we are using is a custom activity - it's not the regular .NET Flowchart activity, but our own creation with a collection for FlowNodes/etc.  We'd like to put a UI around it now as well ... mimicking the .NET Fllowchart designer.  Is that really possible, or extremely difficult?  It seems there's no real API or anything available for constructing the node connectors, arrows, etc.

how to display bread-crumb always starting from the root-web of the site collection, not the current

Hello all, In sharepoint 2010, the breadcrumb shown in the title area starts from the site you are currently into. Suppose my root web is Home and I have a subsite called Child1 and under this subsite I have another subsite called GrandChild1 My requirement : when I am at Home site .. currently the bread crumb shows Home .. as expected it shows Home when I am at Child1 site .. currently the bread crumb shows Child1 .. expecting it to be Home > Child1 when I am at Child1 site .. currently the bread crumb shows GrandChild1 .. expecting it to be Home > Child1 > GrandChild1   How can I achieve this ? Thanks mano   Mano Mangaldas | Blog : http://howtosharepoint.blogspot.com 

How to display Initiation Forms using SharePoint Designer

hello,   Using Designer 2010 and Sharepoint Foundation, I'd like to implement initiation forms for some of my workflows. However, i can't find a good overview of the process of implementation. I do not have Infopath.  I can see the aspx files on Designer but cannot figure out how to display them to users.  Can anyone direct me to a simple how-to? Thanks! Beth Singley PBM Graphics

The values provided for the root activity's arguments did not satisfy the root activity's requirem

I have flowchart as implementation  of activitybuilder and added two dynamicactivityproperty to it. The flowchart is having flowdecision and 3 other customized activities with same defined arguments. But when i invoke the workflow and pass dictionary, it gives the error: The values provided for the root activity's arguments did not satisfy the root activity's requirements: 'Sample Workflow': The following keys from the input dictionary do not map to arguments and must be removed: FolderName, FolderSize.  Please note that argument names are case sensitive. Parameter name: rootArgumentValues Flowchart       fc = new Flowchart();  protected override void OnInitialized(EventArgs e) { wd.Load(new ActivityBuilder { Implementation =  fc});             ModelTreeManager mtm = wd.Context.Services.GetService<ModelTreeManager>();             ModelItem ab = mtm.Root;             ModelItemCollection argsAndProperties = ab.Properties["Properties"].Collection;                     InArgument<string> foldername = new InArgument<string>();    &n

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  

Disable an activity in Designer at run time in workflow 4.0

There are couple of activities in my workflow & based on some condition, I need to make an activity disabled i.e. I don't want that activity to be seletable by the user. I am opening my workflow in designer at run time to give an overview of WF to the user. Something like  (new DesignerMetadata()).Register(); this.wd = new System.Activities.Presentation.WorkflowDesigner(); this.designerSection.Child = (this.wd.View); I was going thru the MS sample of CommentOut Activity but that won't solve my requirement as Activity needs to be disabled at run time based on some condition.

Performancepoint designer error - Update View Failed

I've created a scorecard that uses dynamic members.   I'm no longer able to design it. When I click on 'Update' to retrieve the scorecard I get the following error:   The last attempt to update this view failed. Try retireving the view again by pressing Update in the Edit tab. If you are still not able to retrieve it, contact your administrator. Error Details: An unexpected system error has occured. Additional details have been logged for your administrator.   The event log says: An unexpected error occurred.  Error 56822. Exception details: System.ServiceModel.CommunicationException: The maximum message size quota for incoming messages (100000000) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. ---> System.ServiceModel.QuotaExceededException: The maximum message size quota for incoming messages (100000000) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.    --- End of inner exception stack trace --- Server stack trace:    at System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded()    at System.ServiceModel.Channels.HttpInput.GetMessageBuffer()    at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)    at System.S

Exception "The activity with display name 'Flowchart' has already been associated with an instance

Using VS 2010 RTM. I have rehosted the desginer and provided a "test" button which runs the WF shown in the desginer, the code for running the WF is simple:  void OnTestWorkflowCommandHandler(object parameter) { ActivityBuilder designerBuilder = (ActivityBuilder)WFDesinger.Context.Services.GetService<ModelTreeManager>().Root.GetCurrentValue(); WorkflowInvoker invoker = new WorkflowInvoker(designerBuilder.Implementation); var se = invoker.Invoke(); it works fine, BUTThe root activity is a flowchart , if I start messing with the desginer and adding sequences and going back and forth to child activities and try to test(run) the WF I get the exception:The activity with display name 'Flowchart' has already been associated with an instance.  Once associated with an instance an activity's metadata cannot be manipulated.  This error might also indicate that you are attempting to execute a workflow whose root activity is actually part of another workflow.
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