.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

How do I get the root activity from WorkflowDesigner?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :JQuery

I am using the WorkflowDesigner to load and edit XAML workflows, as per this post. I now need to get the root activity from the designer and pass it into a WorkflowApplication so that I can execute the workflow (the reason that I cannot reload the workflow from XAML is because I am having to implement custom visual workflow tracking (see this post) and need make sure that the same activity instances are loaded into the WorkflowDesigner and the WorkflowApplication). I was originally getting the root activity using:


This was working fine until I tried loading a XAML workflow that had InArguments defined at the top level e.g.:

<Activity x:Class="..."...>

View Complete Post

More Related Resource Links

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

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"

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?




Debugging: Root Out Elusive Production Bugs with These Effective Techniques


Errors happen. But in production, error logs often provide little or no help in pinpointing the exact line of code in which the problem originates. You can't usually isolate the root cause by modifying code in a production environment because recreating the exact same environment is very difficult due to the large number of potential software and hardware configurations. This article provides some concrete steps you can take to get at the heart of the problems in your production code.

Matt Adamson

MSDN Magazine July 2005

A Simple XML-driven Tool: Monitor Your Web Site's Activity with COM and Active Scripting


This article describes a simple Web site monitoring tool built with XML, JScript, Windows Script Host, and COM objects. Although it is not intended to replace complete Web site monitoring software products, it has many useful features that help to keep Web servers up and running. An XML configuration file specifies which Web sites to monitor and the actions to be taken if the site isn't functioning properly. In addition, the tool can be scheduled to run at any specified interval using the Windows Task Scheduler. Functions that probe the sites, log events, and send e-mail notifications are written in JScript.

Panos Kougiouris

MSDN Magazine July 2000

Wrong root, absolute paths '~' don't work.


Hi guys,

I have some kind of strange problem. I use Visual Studio 2008 Standard Edition, and whenever I use ~ in links (like PostBackUrl = "~/Admin/AddProduct.aspx"),  ~ is translated into "C:\DocumentAndSettings\User\Desktop" instead of my application root. Of course I dont have any project on Desktop. It happens in every project I run , even in project from pendrive which works properly on other computers.

How can i solve this problem ? What and where should i change ? I will be very thankful for any help.


System.NullReferenceException: At Createtask Activity



I created  Approval Workflow application(.net3.0), it has successfully deployed at sharepoint server, but when executing  workflow at createTask activity, the following errror has occured.

System.NullReferenceException: Object reference not set to an instance of an object.     at BasicApprovalWorkflow.Workflow2.createApprovalTask_MethodInvoking(Object sender, EventArgs e)

below is the code :



void createApprovalTask_MethodInvoking(object sender, EventArgs e)



How to Cancel a Workflow Activity - LogToHistoryListActivity


How can I cancel a LogToHistoryListActivity? I don't understand how to get access to the ActivityExecutionContext. I guess one way is to add an IfElse before entry to avoid the activity completely. Casting the sender object does not work. Help anyone?

  private void logToHistoryListActivity_WorkflowActivated_MethodInvoking(object sender, EventArgs e)
   LogToHistoryListActivity log = (LogToHistoryListActivity)sender;
   string msg = string.Format("Work Request has been SAVED by {0}. Awaiting submittal.", workflowProperties.Originator);
   WFHelper.LogMessageToHistoryList(log, msg, null);

XmlSerializer - how to define class to not generate attributes in root element?

Hi! I have simple class that I serialize to xml file: <?xml version="1.0" encoding="utf-8"?> <MyRootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Area="East">   <Products>     <SalesProduct Taxable="true">       <Name>Sofa</Name>     </SalesProduct>     <Product>       <Name>Television</Name>     </Product>   </Products> </MyRootElement> I don`t want have in xml file attributes xmlns:xsi and xmlns:xsd. How can I define class to not have these two attributes in xml file? I tried use XmlRoot attribute but there is no control for these two attributes. They are always generated. Regards

C# - Creating web client for automating user activity on a HTTPS site

I've been wracking my brain for a couple of weeks on this.  I need to create a web client (I don't want to use the webBrowser control because I need this to be as lightweight as possible) to log in to a secure web site, and then effectively click links and fill in fields to get the data that would normally be displayed in the web browser.  I'm then going to parse the data and perform other actions with it. I have been working with HttpWebRequest and HttpWebResponse and many permutations of suggestions I have found while Googling my issue, but I can't get rid of my problem:  Sometimes when I effictively click the ultimate link that I need to click to get to my data, I get what I am looking for.  However, MOST of the timel, I get a response page that tells me my connection timed out and that I need to log in again.  I have tried messing with cookies and such, but to no avail. I know it's good form to post my code, but it is so sloppy and screwed up right now from tweaking this and trying that, that I'd rather not take the approach of fixing what's there, rather I'd like to start with solid, clean code to begin with. Your help will be greatly appreciated. Thanks, ALo

SQL Server 2008 - Job Activity Monitor Failing

I recently began migrating to Windows 2008. One of the first servers is a server which we install our tools on. This is a new server which currently is only running the SQL Server management tools. On this server I installed the SQL Server 2008 R2 management tools, prior to this install there were no other SQL Server tools installed on this server. The majority of the functionality works and I can connect and manage multiple databases servers from SQL Server version 2000 through 2008. But when I try to bring up the Job Activity monitor I get an error ==> Can not show requested dialog. From Windows XP Windows Server 2003 SP2 this functionality works. I get this error if I connect to a SQL Server 2005 or 2008 database instance. I have tried re-installing the client tools but I still get this error..... any ideas?

Is all this activity wasted

I support a third party application that is absolutely terrible.  Most of the bad I understand, but my SQL Profiler comes back with these types of entries RPC:Starting declare @p1 int set @p1=-1 exec sp_prepare @p1 output,NULL,N'SELECT * FROM Payments',1 select @p1 SP:Statement complete SELECT * FROM Payments RPC:complete declare @p1 int set @p1=-1 exec sp_prepare @p1 output,NULL,N'SELECT * FROM Payments',1 select @p1 Even when their is an SP_sqlexecute, they don't pass the plan handle and the SQL is more select * from payments where customer = 111 What are they trying to do   Thanks for any replies   mark      

Add root xsi attributes to existing documents

I am looking for a way to perform a table update of an XML column containing strongly typed data. Recently, we modified our schema to include xmlns:xsi and xsi:schemaLocation. The thousands of documents already in the table, do not contain these new root element attributes, and I would like to add them. Sample old xml doc: <ROOT xmlns="http://www.xyz.com"><br/> <TAG>12345</TAG><br/> </ROOT>   Sample new xml doc: <ROOT xmlns="http://www.xyz.com"<br/> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br/> xsi:schemaLocation="http://www.xyzcom/schemas/A http://www.xyz.com/schemas/A/a.xsd"><br/> <TAG>12345</TAG><br/> </ROOT> Any thoughts or suggestions on how this might be accomplished?

XSD: Reading string in ROOT of XML

Hi all, I am making a import from XML to SQL. I have chosen to do this via a XSD file, but I have a problem with the ROOT file of the XMLXML:<Dogs bulkmode="0" xmlns="http://scheme01.isp.com">  <UnderDogs>    ...  </UnderDogs></Dogs>XSD:<xsd:element name="Dogs bulkmode="0" xmlns="http://scheme01.isp.com"" sql:is-constant="1">Unfortunately this does not work. If I (for testing) changes the first line of the XML to <Dogs>, (and corrects the XSD) it works like a charm.  It is not an option to change the XML file, so somehow I need to make the changes within my XSD. Does anyone have any suggestions?RegardsBirger Wilhelmsen

How can I specify xsi:schemaLocation inside my path or root tag?

I am using: SELECT RecordCode, FieldToBeBlank, [Year] , [Month] FROM dbo.SomeTable FOR XML PATH('CustomRootName'), ELEMENTS XSINIL Which then returns:   <CustomRootName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RecordCode>5</RecordCode> <FieldToBeBlank xsi:nil="true" /> <Year>2010</Year> <Month>8</Month> </CustomRootName>   However, I need to also include xsi:schemaLocation="blah BLAHV6.xsd" in that CustomRootName tag. How can I set it up so that it would read more like: < CustomRootName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="blah BLAHV6.xsd">       

Properties of a child activity are null when the activity executes

I have an activity library containing several activites; one of my activities, let's call it MainActivity, contains another one, InnerActivity. A code block in MainActivity sets some properties of InnerActivity, but then when InnerActivity is executed, these properties are null. Some of these properties being set are dependency properties, other are "plain" properties. I had done the same thing in another activity and had got no problems at all. Any hints why this is happening? Thanks, PaoloPaolo Tedesco - http://cern.ch/idm

TFS 2010:Testing Workflow 4.0 activity

Hi EveryOne, Is there any way to test the workflow activity with out queing the new build?Usually while working with TFS2008, we ll test the particular class  through console application by passing parameters. In TFS 2010 ,i need to test the workflow ?is there any way some thing like creating an object for workflow and calling through console application? Please  suggest me. Thanks & Regards, eswar reddy 
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