.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

Parsing Dynamic Activity Argument Default Values

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

Is it possibly to access the default value of a dynamic activity's argument through the API? I would like to do this outside of the scope of execution.

So far I've attempted to load the XAML as a DynamicActivity and access the individual DynamicActivityProperty types. In a DynamicActivityProperty, there is a Value property, but it returns a type of InArgument with actual type of the argument set as a generic. I would like to get the actual value of the InArgument, rather than InArgument<T>. I would assume this would be the actual default value of my argument.

The code I have so far looks something like this:

      System.Activities.Activity activity = null;
      DynamicActivity dynActivity = null;

      // Get bytes from string .xaml
      using (Stream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(xamlString)))
        activity = ActivityXamlServices.Load(stream);

      dynActivity = activity as DynamicActivity;

      // Iterate through workflow arguments
      foreach (Dy

View Complete Post

More Related Resource Links

Default values in SQL syntax / MVC


Hi guys, I have a little problem for which I need a little advice about.

I have a repository function called getList which retrieves certain information that gets posted to it from a form. My form has 6 fields, and a user can enter searvh criteria in any or all the fields. According to what he has entered, I must execute a SQL string to retrieve matching information.

I have the following:

public List<Client> getList(string clientSurname, string clientInitials, string clientName, string clientNumber, string clientReference, int divisionID, int clientStatus, int usrID)


var clientlist = from c in DB.Clients
                             where c.Surname.Contains(clientSurname)
                             && c.FullName.Contains(clientName)
                             && c.Initials.Contains(clientInitials)
                             && c.OldClientNo.Contains(clientNumber)
                             && c.Reference.Contains(clientReference)
                             && c.DivisionID == divisionID
                             && c.Status == clientStatus
                             && division.Contains(c.DivisionID)
                             orderby c.Surname,c.Initials

gridview help on each dynamic row solve this show values based on all columns

<asp:GridView style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 183px" id="Gridview1" runat="server" Width="613px" Height="127px" ForeColor="Teal" Font-Size="12pt" Font-Names="Palatino Linotype" Font-Bold="True" Visible="False" BorderColor="Transparent" AutoGenerateColumns="false" CellSpacing="2" GridLines="None" OnRowCreated="Gridview1_RowCreated" SelectedIndex="5" ShowFooter="true" OnRowDataBound="Gridview1_RowDataBound"><Columns>  <asp:TemplateField HeaderText="ItemCode"><ItemTemplate> <asp:DropDownList id="DropDownList1" tabIndex=16 runat="server" AutoPostBack="True" DataValueField=" ItemCode " DataTextField=" ItemCode" ></asp:DropDownList></ItemTemplate></asp:TemplateField>  <asp:TemplateField HeaderText="ItemName"><ItemTemplate> <asp:DropDownList id="DropDownList2" tabIndex=16 runat="server" AutoPostBack="True" DataValueField="ItemName" DataTextField="ItemName" ></asp:DropDownList> </ItemTemplate> </asp:TemplateField>  <asp:TemplateField HeaderText="Category"&

Dynamic Dimension with Aggregate Values

Hi, I have an specific requirement to make the measure value as an dimension. Let me explain my problem in brief. I have a fact table with dimensions like Time, Products etc and having single fact table with two measures. I have to create a calculated measure which shows the average of Measure 1 (here used calculated measure because there are couple of other calculations involved). And other two calculated measures. when I drill down with Products dimension for Calculate measure 1, it shows the average value for each products. Now, I want this calculated measure values (includes Product dimesnion drill down) as a Dimension and based on this value, I need to show the value of other two measures. For example: when the dimension products is used for drill down the values displayed will be like this and in this I need CM1 to be another dimension Products CM1 CM2 CM3 P1 0.10% 20 1 P2 0.20% 40 2 P3 0.30% 80 3 P4 0.40% 70 4 P5 0.50% 30 5 P6 0.60% 110 6 P7 0.70% 120 7 P8 0.80% 130 8 P9 0.90% 86 9 P10 1.00% 65 10 when CM1 is used as a dimension it should show the value like this CM1 CM2 CM3 0.10% 20 1 0.20% 40 2 0.30% 80 3 0.40% 70 4 0.50% 30 5 0.60% 110 6 0.70% 120 7 0.80% 130 8 0.90% 86 9 1.00% 65 10 How can we create the dynamic dimension with the aggregated values? Any assistance will be greatly apprec

Dynamic workflow with While activity

We have a very strange problem with WWF 3.5. All our workflows are loaded dynamically, i.e we have different  assemblies containing libraries of the workflows. We starting each workflow by specifying path to assembly and name of the workflow class in the assembly:     Assembly  workflowAssembly = Assembly.LoadFrom(path);     Type  workflowType = workflowAssembly.GetType(name ); We are creating work flow instance as following and execute starts:     WorkflowInstance instance =     workflowRuntime.CreateWorkflow(workflowType, dictParameters);      instance.Start(); Everything works just fine till it hits the While activity. Here workflow is terminated because of the exceptions. Interesting thing is that exceptions here are different depending on what work flow is doing. In case when loop execute sequence activity containing just code activity which increasing some index by 1 each iteration (what could be simpler!) exception is, providing as part of the WorkflowTerminatedEventArgs e: Exception    {"Error binding to target method."}    System.Exception {System.Runtime.Serialization.SerializationException}   When our assembly containing workflows has name  "TestLibPghWWF" and inside While activity, the sequence activity contains real,&

Setting Managed MetaData default values on site creation

I am working on a project where the requirement is to have specific document content types.  I have therefore create a site columns feature which creates all my columns, I have a Site Contentypes feature which creates all my content type and I have list templates based on my content types.  I also have created a couple of Site definition features which create specific list instance based on my list template As part of my content types I have created a few Managed Metadata fields which I wanted to set defaults for on the creation of my sites.  I have therefore created a feature which is right at the end of the WebFeatures section in my ONET.xml.  This features enumerates through all lists, looking for specific column names(managed metadata columns) and looks to set these to specific values.  The code to set the default value on the field is: TaxonomyField documentCategoryField = (TaxonomyField)library.Fields["Document Category"]; if (documentCategoryTerm != null) { documentCategoryField.DefaultValue = documentLibraryDefault.ToString(); documentCategoryField.Update();                                                     }                         &n

Hosted Designer fails to load workflow xaml that has InArguments with default values (xaml saved by

I have hosted the designer in our app. Using the hosted designer, workflows are saved as xaml to a database. When an end user wishes to edit a workflow the xaml is downloaded to a file and loaded into the designer via the .xaml file. The user can also associate assemblies with the workflow and there is a mechanism which makes sure that these assemblies are loaded into the appdomain and available. The problem we are hitting occurs when the top level activity (Sequence) has InArgument with default value. I create a simple Sequence, add InArguments (type of Int32 and String)  and set some default values. I save the workflow xaml to the database and close down the designer. When I wish to edit the workflow and try to load I get the following errors Could not find member '{clr-namespace:}_e905.argument3'. Could not find member '{clr-namespace:}_e905.argument1'. suggesting that some assembly/namespace missing. Here is the xaml I try to load: <Activity mc:Ignorable="sap" x:Class="{x:Null}" this:_e905.argument3="99" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorl

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

Default values on query strings?

Hi!I have alot of query strings on one of my seartch pages. The problem is that even if the corsponding setting is not set by the enduser it will be visible in the URL. Is there a way to avoid this?In this case the Controller actions take an object of the following class : public class AdList { public AdList() { this.Page = 1; this.ModelViewAd = new PagedList<ModelViewAdList>(); this.CS = new CategorySelect(); this.LS = new LocationSelect(); } public PagedList<ModelViewAdList> ModelViewAd { get; set; } /// <summary> /// SeartchString /// </summary> [DisplayName("Sökord")] public string S { get; set; } /// <summary> /// CategorySelection /// </summary> public CategorySelect CS { get; set; } public LocationSelect LS { get; set; } /// <summary> /// Paging /// </summary> public int Page { get; set; } [DisplayName("Säljes")] public Boolean O1 { get; set; } [DisplayName("Köpes")] public Boolean O2 { get; set; } [DisplayName("Bytes")] public Boolean O3 { get; set; } [DisplayName("Uthyres")] public Boolean O4 { get; set; } [

Default values for filters not populating in report builder (SQL server 2005)



I  am frustrated with this challenge for  populating default values for filters in report builder. Here are the steps that I am performing.

I have clicked on the filter icon, then dragged the dimension to the filter pane, switched the properties to Prompt and changed the operator to 'in this list'.

 by default the value selected is 'no value selected', Microsoft online tutorials says that this should automatically populate the filter criteria with the default list of values for the underlying dimension. However it dosen't

How do I populate this filter with default list of values.

Please help.










Dynamic Activity calling CLR Activity fails when Invoked?


MyActivity.xaml has a child activity, a CLR AsyncCodeActivity, SendMail.cs, dragged and dropped onto the 'root' activity which is a FlowChart.   SendMail.cs is in the same directory as MyActivity.xaml which is loaded dynamically like so:

    dynamicallyLoadedActivity = ActivityXamlServices.Load("("..\..\..\MyActivities\MyActivity.xaml");

At runtime, when WorkflowInvoker.Invoke(dynamicallyLoadedActivity ) is called, this exception is thrown:

    XamlObjectWriterException: Cannot create unknown type {"Cannot create unknown type '{clr-namespace:MyApp.MyActivities}SendEmail'."}

The imports on MyActivty.xaml include "MyApp"  xmlns:local="clr-namespace:MyApp.MyActivities"  and the xaml: <local:SendEmail .... looks OK.

Here is the top of the stack trace:

System.Xaml.XamlObjectWriterException was unhandled
  Message=Cannot create unknown type '{clr-namespace:MyApp.MyActivities}SendEmail'.
       at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
       at System.Xaml.XamlWriter.WriteNode(XamlReader reader)

Change Default Sort for Dynamic Data Web Application




I just created a dynamic data web application and setup a simple .EDMX file. Next, I created meta-data / partial classes to ensure that my integer identifiers wouldn't show up:

// ...


public object TableId { get; set; }

 // ...

I wanted to now set the up the list pages so they sort using a different attribute ("Name" in this case). Anyone know if this is possible / how to do it?






Default Column Values in a Document Library (SP2010) do not show up in word 2010 until you save and


when you create a document in a SP 2010 document library (of a particular content type, by clicking new, letter (content type name) in sharepoint for example) which has default values set on in in the library (set by using library settings -> change default column values), the default values do not show up until you create the document , save it and reopen it again.  Is this a bug or by design.  If it is by design, it is horrible since if some of the column default values are mandatory in the content type then you actually have to type them in before you could possibly save the file which defeats the whole point of having default column values.  Also it is tremendously clunky for a user to have to create file, save it , close it, and reopen it just to view the default metadata in the document information panel that is supposed to be there.

Anyone have any thoughts/solutions to this problem?


I want to use the values executed by a dynamic sql in a view. Can this be possible? Can you please l

Dynamic SQL Stored Proc:

        create procedure dbo.USP_USR_GETATTRIBUTEVALUE
                @AttributeName nvarchar(200),
                @ID uniqueidentifier,
                @AttributeValue nvarchar(200) output
                Declare @ATTRIBUTEVIEWNAME nvarchar(200)
                Declare @sql nvarchar(4000)

                set @ATTRIBUTEVIEWNAME = (select 'V_QUERY_ATTRIBUTE'+ convert(varchar(50),REPLACE(AC.ID,'-','')) from ATTRIBUTECATEGORY AC where AC.NAME=@AttributeName)


Default Values in ADO Entity Framework (GetDate())


I have a sql server table with a date column that has a default value of GetDate()

this default does not seem to get passed to the EF and so i was wondering what the most elegant way was to code this default value within my asp.net application? I dont want to manually alter the EF Model as i may want to re-import it and dont want to lose these changes.

any suggestions gratefully appreciated



Dynamic Sql depending on parameter values



I have only just started to use Reporting Servcies and would like to know is there any way of putting IF statments into the SQL statment depending on the value of a selected parameter.

="select  code, cid, name + '(' + code + ')' as ShopName, qty, val, salesdate  from shops" & 
" inner join sal_sumdaily on code = shopcode inner join calendar on salesdate between weekstart and weekend" &
" where trading = 0 and shopclosed = 0 and cid = " & Parameters!RP_CID.Value & "" &
" and l4l = " & Parameters!RP_L4L.Value & "" &
" and newarea = " & Parameters!RP_Area.Value & "" &
" order by code"

What I would like to do is when "Parameter!RP_Area.value" = 99 then miss that part of the sql statment out, something like this.

="select  code, cid, name + '(' + code + ')' as ShopName, qty, val, salesdate  from shops" & 
" inner join sal_sumdaily on code = shopcode inner join calendar on salesdate between weekstart and weekend" &
" where trading = 0 and shopclosed = 0 and cid = " & Parameters!RP_CID.Value & "" &
" and l4l = " & Parameters!

Default Parameter Values not Updated when Report Updated


This is either a bug or really wierd behavior by design that needs to be rethought in the near future.

I'm an enterprise developer on a commercial product that integrates and leverages reporting services.  We install a sizable number of reports automaticly as part of our production isntallation or upgrade.  I have a recent QA bug on that process that I find mystifying.

We install reports through calls to the CreateReport web service and its worked pretty well.  Recently, I had a report with a parameter whose definition changed.  Specifically, the default value of the parameter changed from 'All' to 'Select' and corresponding changes were made to the valid values list of the parameter.  When the report is installed, it works just fine.  But when the report is created as part of an upgrade to an existing system, the report for the most part gets all the expected changes but the new default value is not picked up.   Instead, it seems to stay hung on 'All', with the result that the parameter remains in a state of having unresolved dependencies ('All' no longer appears as a valid value) and as a result, breaks our interface (which was designed for single rather than multistep entry of parameters).

I know that some properties are not reset when calling CreateReport. &n

Refreshing fomulas/default values


Dear all,

I have a form with related fields which are manipulated during the Form_Loading event, however formulas are not updated in response to this.  Has anyone noticed this and can help?

Here is an example,

Field1 = 0 (default)

Field2 = Field1 (default)


In the FormLoading Event,

MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Field1", NamespaceManager).SetValue(1);


But Field2 still shows 0.


However, if Field1 was updated manually, Field2 also changes.


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