Skip to main content

TechBlog

Go Search
About
TechBlog
SharePoint Development
  

Blue Surf Tech > TechBlog
SharePoint and other ramblings
How to Cancel Custom Sharepoint Workflows programatically
An interesting goal: cancel all active workflows on a Sharepoint list item programatically from another workflow.
 
you can do this, of course you have to be careful not to cancel the workflow itself that is doing the cancelling.  So, you'll need to get the name of the workflow (I used a string constant).  If someone can get the GUID in another way, please let me know. 
 
here's the code to cancel the active workflows:
 
where CancelRDTWorkflowName is a constant for the workflow name doing the cancelling.
 
-----------------------------------------------

SPWorkflowManager manager = this.workflowProperties.Web.Site.WorkflowManager;

foreach (SPWorkflow workflow in manager.GetItemActiveWorkflows(this.workflowProperties.Item))

{

System.Guid wfAssociationID = workflow.AssociationId;

//Get the ID for the Cancel workflow so we don't cancel this WF as it's running.

SPWorkflowAssociation workflowAssociationCancel =

this.workflowProperties.List.WorkflowAssociations.GetAssociationByName(

CancelRDTWorkflowName, new System.Globalization.CultureInfo("en-US"));

System.Guid wfAssociationIDCancel = workflowAssociationCancel.Id;

//We are comparing the current workflow AssociationID with the ID from the Cancel workflow.

//If they are not the same, go ahead and cancel, else we would cancel ourself.

if (wfAssociationID != wfAssociationIDCancel)

{

SPWorkflowManager.CancelWorkflow(workflow);

}//if

}//foreach

How To Filter out an Active Directory User Profile Import
Under the Search base filter, use wild cards:
 

This, essentially, filters the Active Directory schema to only import those objects that:

1. (objectCategory=person) = are under category “person”.

AND

2. (objectClass=user) = are of class “user”.

AND

3. (sn=*) = have a surname [Last Name].

AND

4. (mail=*) = have a valid e-mail address.

AND

5. (showInAddressBook=*) = are available in our corporate address book.

AND

6. (!(userAccountControl:1.2.840.113556.1.4.803:=2)) = is an account that is active.

Here's a good article on this:

http://www.travislowdermilk.com/?p=150

 

 

 

Sharepoint 2010 OS requirements
Blog from the MS Program manager:
 

We've seen some confusion in the newsgroups and elsewhere on the versions and editions of Windows that SharePoint 2010 will run on. This post is meant to clarify some of the most common questions we have seen.

SharePoint 2010 will support only 64-bit (x64) versions of Windows Server 2008 SP2 and Windows Server 2008 R2.  SharePoint will not install at all on 32 bit Windows, or any earlier version of Windows  such as Windows Server 2000 or Windows Server 2003.

SharePoint is not supported on 'Server Core' installations of Windows Server 2008 and R2. The Server Core installations of Windows server do not contain some of the components required for SharePoint to be configured or run.

To make developing for SharePoint 2010 easier, it is possible to install SharePoint on 64-bit versions of Windows Vista SP2  and Windows 7. Note that running production environments on these OSes are not supported and it will not be possible to upgrade deployments running on client versions of Windows to future versions of SharePoint.  Instructions on installing SharePoint 2010 on client versions of Windows are a bit more involved and we recommend reading the instructions at http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx.

 

Windows version/edition (64 bit only)

SharePoint 2010 support

Windows Server 2008 R2 Foundation

No

Windows Server 2008 R2 Standard

Yes

Windows Server 2008 R2 Enterprise

Yes

Windows Server 2008 R2 Datacenter

Yes

Windows Web Server 2008 R2

No

Windows HPC Server 2008

No

Windows Server 2008 R2 for Itanium-based systems

No

Windows Server 2008 Standard

Yes

Windows Server 2008 Enterprise

Yes

Windows Server 2008 Datacenter

Yes

Windows Web Server 2008

No

Windows Storage Server 2008

No

Windows Small Business Server 2008

Yes*

Windows Essential Business Server 2008

Yes*

Windows Server 2008 for Itanium-based systems

No

Windows Server 2008 Foundation

No

Windows Vista

Developer-only**

Windows 7

Developer-only**

* Small and Essential Business Server editions of Windows install SharePoint as an optional component.

** Support for specific editions of Windows 7/Vista are yet to be finalized, but are likely to be 'Business'/'Professional' editions and above.

 

The list above is meant for informational purposes only. The official list of system requirements for SharePoint 2010 is located at http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx and includes additional details on prerequisites and other optional components.

 

Umesh Unnikrishnan

Program Manager, SharePoint

1 - 3 Next

 ‭(Hidden)‬ Admin Links

How to Cancel Custom Sharepoint Workflows programaticallyUse SHIFT+ENTER to open the menu (new window).New
How To Filter out an Active Directory User Profile ImportUse SHIFT+ENTER to open the menu (new window).
Sharepoint 2010 OS requirementsUse SHIFT+ENTER to open the menu (new window).
New versions of custom Sharepoint workflowsUse SHIFT+ENTER to open the menu (new window).
Webpart maintenance PageUse SHIFT+ENTER to open the menu (new window).
Live From Sharepoint 2009 Mandalay BayUse SHIFT+ENTER to open the menu (new window).
Create a .wsp for a custom sharepoint workflow 2nd versionUse SHIFT+ENTER to open the menu (new window).
How to migrate a Sharepoint SQL Server Reporting Services Integrated mode installation to a new Sharepoint server.Use SHIFT+ENTER to open the menu (new window).
Edit a PDF in a Sharepoint Document Library loses metadataUse SHIFT+ENTER to open the menu (new window).
SharePoint Custom List Form Error - Input string was not in a correct formatUse SHIFT+ENTER to open the menu (new window).
How to create a dropdown list webpart to send as a filter to another webpartUse SHIFT+ENTER to open the menu (new window).
All 40 SharePoint templates with screenshots Part 1Use SHIFT+ENTER to open the menu (new window).
STSADM: How to change the default domain in the Sharepont People PickerUse SHIFT+ENTER to open the menu (new window).
401 Error SQL Server Reporting Services Add-In for SharepointUse SHIFT+ENTER to open the menu (new window).
Adding a Sharepoint list item using the Sharepoint web service Lists.asmxUse SHIFT+ENTER to open the menu (new window).
Sharepoint Reporting Services Integrated Mode - How to find all the reports that use a datasource (rsds)Use SHIFT+ENTER to open the menu (new window).
Installing MOSS 2007 on Server 2008 using NLBUse SHIFT+ENTER to open the menu (new window).
The Sharepoint way for Application Error AlertsUse SHIFT+ENTER to open the menu (new window).
Setting Workflow Configuration Settings Dynamically From a List (updated with code)Use SHIFT+ENTER to open the menu (new window).
Another SharePoint Reminder TicklerUse SHIFT+ENTER to open the menu (new window).
SharePoint workflow in Visual Studio 2008 Error: Failed on StartUse SHIFT+ENTER to open the menu (new window).
Building a home VM server farm on a Dell Inspiron 530Use SHIFT+ENTER to open the menu (new window).
Cool SharePoint PostersUse SHIFT+ENTER to open the menu (new window).
Contacts Management Template foolishnessUse SHIFT+ENTER to open the menu (new window).
SharePoint 2007 backup softwareUse SHIFT+ENTER to open the menu (new window).
Reporting Services SharePoint Integration mode Installation GotchaUse SHIFT+ENTER to open the menu (new window).
SSRS Installation for SharePointUse SHIFT+ENTER to open the menu (new window).
All 40 SharePoint templates with screenshots Part 3Use SHIFT+ENTER to open the menu (new window).
All 40 SharePoint templates with screenshots Part 2Use SHIFT+ENTER to open the menu (new window).
40 SharePoint 2007 TemplatesUse SHIFT+ENTER to open the menu (new window).
SharePoint Migration ToolUse SHIFT+ENTER to open the menu (new window).
Moving to 64 bitUse SHIFT+ENTER to open the menu (new window).
MOSS custom workflow deploy errorUse SHIFT+ENTER to open the menu (new window).
MOSS Workflow deploy error: Shows up but InactiveUse SHIFT+ENTER to open the menu (new window).
Workflow deploy error: Farm is unavailableUse SHIFT+ENTER to open the menu (new window).
SharePoint Designer Reminder System (Tickler workflow)Use SHIFT+ENTER to open the menu (new window).
Sharepoint workflow wf hot fix 4/2007Use SHIFT+ENTER to open the menu (new window).
Regular Expression ToolUse SHIFT+ENTER to open the menu (new window).
SharePoint Planning and Architecture Parts 1 and 2Use SHIFT+ENTER to open the menu (new window).
Using Log Parser to parse media server and flash filesUse SHIFT+ENTER to open the menu (new window).
MS Blog on using the Record Center template in Sharepoint 2007Use SHIFT+ENTER to open the menu (new window).
quicktime streamingUse SHIFT+ENTER to open the menu (new window).
TechNet for Sharepoint Workflow 2007Use SHIFT+ENTER to open the menu (new window).
Walkthrough MOSS 2007 install with screenshotsUse SHIFT+ENTER to open the menu (new window).
How to stream a quicktime movie from a web pageUse SHIFT+ENTER to open the menu (new window).
What's the difference betwee Sharepoint 2007 MOSS and WSS?Use SHIFT+ENTER to open the menu (new window).
Excel Services Step By StepUse SHIFT+ENTER to open the menu (new window).
Sharpoint Team BlogUse SHIFT+ENTER to open the menu (new window).
SQL Server Reporting 2005 ChartsUse SHIFT+ENTER to open the menu (new window).
New Biztalk help filesUse SHIFT+ENTER to open the menu (new window).
Virtual serversUse SHIFT+ENTER to open the menu (new window).
Basic Biztalk direct bindUse SHIFT+ENTER to open the menu (new window).