.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

Inheriting from StateMachineWorkflowActivity?

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :WPF
I'm implementing a number of state machine workflows which all have a number of properties and a top level EventDrivenActivity in common. My first approach was to implement the common features in a class inheriting from StateMachineWorkflowActivity and then inherit my workflows from this class. However, this doesn't seem to be supported; specifically: 1. During build, validation fails on my base class because I haven't specified an initial state or final state. I tried adding two empty states to get around this problem, which worked, but then 2. The designer in VS2008 duplicates the activities in my base class when designing my derived class and then complains that it has duplicate component names. For example, I have a state in my base class called RESERVED_INITIAL which is my dummy initial state; when I work with my derived class in the designer, the designer adds a state called RESERVED_INITIAL to the derived class, causing an error because there are now two components with the same name What I want to ask, then, is: 1. Is using inheritance in this sort of way supported, ie, can we create classes that sit between StateMachineWorkflowActivity and actual concrete workflows to factor out common features of those workflows? And if not, 2. Is there a better way to capture the commonality between a number of workflows in a solution? Thanks in advance

View Complete Post

More Related Resource Links

Sharepoint 2007 - Wiki site - New Pages Not Inheriting Custom Master Page


I am working on a SP site (MOSS not WSS) which is heavily customised away from the OOTB layout. I need to create a Wiki site, which was going well - I've created a master page which displays the miniconsole (this was not visible with our customised layout), and made it the default master page for the site. This has been applied to the two standard pages that come with the Wiki site, however when a new page is created, it seems to inherit the default.master, rather than my custom master page - thus not showing the miniconsole.

When I have created a new page, I am able to use SharePoint Designer to attach my custom master page to it, which works perfectly, however this will not be a viable option going forward as end-users create their new wiki pages.

How can I get the new pages to inherit my master page when they are created?


New Document Library in a subsite is inheriting permissions from wrong site

I have a site collection (using the out-of-the-box Business Intelligence site template) called "BI Home". A couple weeks ago I created a bunch of subsites (Finance, Regulatory, Marketing, etc.) all using the BI site template, and then created a Document Library called "Reports" in each one of those subsites. Those are all working as expected. Yesterday I needed to create a new subsite (again, a BI site just off the root site collection) called "Operations". I created the subsite, and then created the "Reports" document library underneath it.  When I went to modify the permissions of the new document library (located here: /Operations/Reports), it said it was inheriting permissions from it's parent: "BI Home".  Why would this be?  Shouldn't the parent be "Operations" ?? All my other sites' "Reports" folders are inheriting permission from their respective parent, but any new sites I create seem to have this issue. Thanks in advance for any insight someone may provide! [SharePoint 2010 RTM on Win2k8R2 using SQL 2008R2 RTM on Win2k8R2]

Programmatically(WSS Web Services) Inheriting Parent Site Permissions for Workspaces

I'm able to create meeting work spaces in Sharepoint 2007 using the WSS web services. This issue that I'm running into is that the default is not inheriting permissions from the parent site. I'm looking for a way to configure this option for the work space programmatically through the use of the WSS web services. I've tried changing this in the template that I'm using to create the workspace, but this does not seem to effect the end results.Regards,Timothy H

Permission NON-Inheriting not working

I'm having two permission issues that must be simple but have me baffeled. 1. I want all users to have view access. I setup builtin\users in the visitors group and nothing happened.  I then added them to the members group. Now they have read, write, etc access. What am I missing. 2. I stopped inheriting on one sub site. It looks and feels like it has it's own permission management but and changes I make to the parent are reflected in the child and any changes I make in the child are reflected in the parent. Help! Thanks, Jake

Adding a group while inheriting permissions

Hi all, I was wondering if its possible to create a group that only exists within a subsite, while still inheriting permissions, For example, I have a subsite named Child that currently inherits permissions from its parent site Parent.  Is it possible to create an Owners group only within Child that allows people to make changes exclusively to Child while at the same time continuing to inherit permissions from Parent? Any help at all would be greatly appreciated! 

Can a page inheriting from masterpage have its own CSS?


Hi all I was wondering if it was possible to add CSS styles to a content page? I am trying to add styles to one of my content page by using a <link rel> tag but I get a compilation error. Is there another way of doing this?

I was thinking of loading all my styles on the MasterPage and then just using them as I need to but surely thats an inefficient way of doing things? I want to be able to just include CSS files that are relevant to the single content page...

Thanks in advance, Onam.

URGENT: Document Library Content Type not inheriting some fields from parent Site Content Type


I have a situation that has foxed me!! I have a site level content type that has 8 fields... I use this to create more content types at the site level and use these in multiple Document Libraries (I have 40 doc libs).  This works fine for 38 of the libraries.  But for 2 of them... 2 of the columns are not showing up on the document libraries.  These are user lookups fields.  I am not sure why it's not working in these libraries only!  When I use the same content type in another library... the inheritance does not break for these fields!

Anyone please provide some guidance on this?  I am using WSS 3.0 and SPD to do workflows.

On another note... the content type has a template (in excel) attached to it.  When I create the content manually using the content type from the New menu option, the template is used... however, when I try to add it using an SPD workflow, it creates a blank template... the content type template is not being used.

Please help... I am in a fix and need to release this application today!!!

where i should put jscript code in aspx page, which created by inheriting a master page


hi budies,

 i am creating a simple web portal, but i am stuck in a aspx page which created by inheriting master page ,

there is some jscript code, but i don't know where to put this code in that page.

please help out ppls. 

thanx in advance 

Cannot initialize 'StateMachineWorkflowActivity' that does not define a valid 'InitialStateName'


I'm getting this error while creating workflow.

WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(typeof(MyWorkflow));

 I checked on the other forums and also I confirmed that build action of my .xoml file is content and .layout and .rules file is embedded resource. i have downloaded the latest extention of WF from this location and installed it. http://www.microsoft.com/downloads/details.aspx?FamilyId=A2151993-991D-4F58-A707-5883FF4C1DC2.


I have also confirmed that x:class attribute has fully qualified class name of my workflow.


Error is raised at this paticular location after initializing all the private class level variable.

public BaseEventArgs m_BaseEventArgs = default(BaseEventArgs);


This is the last class level variable to be initialized.


Please help.


Thanks in advance.


Bug - Cannot initialize 'StateMachineWorkflowActivity' that does not define a valid 'InitialState


Hello everyone,


I'm actually encountering this problem, i get the "Cannot initialize 'StateMachineWorkflowActivity' that does not define a valid 'InitialStateName' property." error on the line :

WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(WorkflowUtexbel));

I know it already has been discussed but since i couldn't find a solution to this bug, i'm posting.

I triple-checked EVERYTHING :

* The project file has the correct projecttypeguid tags for WF ;

* The namespaces are OK everywhere in the software

* The workflow files (layout, .cs and .xoml) have the correct references to the workflow name (and full qualified when necessary in the .xoml file)

* Everything in the workflow layout is OK

* A valid initial state is set

* I'm using .NET framework 3.5 + SP1,  and Visual Studio 2008

* All the references to the WF are added to my project

* I already could get a workflow working in another project on the same machine but had the same problem when i had to rename my namespace, i think i had to recreate completely the workflow because just modifying the tags in the files didnt fix anything. I already recreated completely the workflow in my project (deleting the previous one), nothing changes, it's still not working.



SharePoint 2010 Documents inside Document set is no inheriting shared fields (lookup fields)


I have a situation that is making me crazy !! I have a content type that inherits from Document set. I have set some fields (metadata) in the document set and configured the document set to share it with documents inside it.

All the fields are being shared (inherited) to the documents inside the document set except for the lookup fields

I have 2 lookup fields that looks for information from a SharePoint list.

I'm using SharePoint 2010.



Thanks ..


Inheriting Windows User Control in WPF User Control


Is it possible to inherit a Windows User Control in WPF User Control. I mean a WinForms User control as a base class to a WPF User Control class (which would be of Xaml). Please let me know the steps or code snippet.

Thanks in advance.

Regarding Creating Custom Field type Class Inheriting from IFieldEditor Interface and UserControl C


How to enable the hidden labels On Create Column Page after selecting our Custom Field type before just ckicking OK so that all those labels appear.

Inheriting more then one class


I have a class called clsSiteWiseServices whicj i inheriting a class called clsSite



Know i want to inherit an another existing class called clsUser in it .

please help me in doing so

Masterpage not inheriting



I am using Sharepoint 2010 Enterprise, i have created a site collection and have used a Publishing Site as the template for the portal.  I have customised the master page of the site and everything looks good.  When i add a subsite, although the masterpage settings are set to inherit the parents masterpage, this is not happening.  Instead the subsite is using its own masterpage and i need to make my changes all over again to this site. 

How can i make it so that the site will inherit the master page of its parent? am i doing something wrong?

On the subsite, under http://spoint2010/Departments/_Layouts/ChangeSiteMasterPage.aspx all 3 options for Site Master Page, System Master Page and Alternate CSS URL are set to Inherit site master page from parent of this site.

Inheriting SqlDataSource


I was wondering if there is a way to create a custom server control that inherits from the SqlDataSource web control and still maintain the smart tag, or at least the property editor that allows you to use the Command and Parameter Editor dialog box when setting up the command strings.  I can't seem to figure out which uiTypeEditor the SelectCommand, InsertCommand, DeleteCommand, and UpdateCommand properties use. 


Custom template not inheriting custom masterpage/branding


We are in the process of migrating from MOSS 2007 to Sharepoint 2010 nad need to recreate site templates used in multiple business processes. We have done the Visual upgrade and designed a new Master Page/CSS that is compatible with 2010. However - To create a template, Publishing must be off. But when I create a site from these templates, they do not inherit the custom master page because Publishing is not enabled.

So to this point  it appears I cannot create a template that will inherit my branding. Is that the case? 

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