Skip to main content

Workflow Foundation Activity Template

WF has two two types of activities you can create, the easy one and the hard one. That’s not really their names (though it would be cool), the first (easy) is a composite activity. This is is the one that Visual Studio lets you create and is in effect just another sequential workflow which you build up and reuse.

image

However when you use them they just look like sequence activities. If you want something that looks like a “real” (read: what you get out of the box) activity to need to create the hard one which is call an activity (so clear a name, ain’t it). The smallest this can be is one class and the biggest it can be is five classes and they all basically have the same structure. So it’s weird that there is no easy way to build these, say a template. Well I have created one which sets up the base for an activity and lets you get going as quickly as possible.

Usage

To use it, select the normal Add -> New Project, and under Visual C#, My Templates will be the template called WF Activity! Some things that should become clear from that little sentence

  • You need Visual Studio 2008 (yeah, that wasn’t clear but I need to sneak it in somewhere).
  • It’s C# only
  • It creates a project for your new activity for ease of packaging purposes.
  • And for some reason if I put a space in the name, if crashes my Visual Studio - so um, that could just be me.

 

image

When you create it, it creates 4 files which all start with the name you choose (that will also be the name for your activity, so I don’t suggest putting activity in it) - For example mine was called ConsoleWriteLine so my files are:

  • ConsoleWriteLineActivity.cs
  • ConsoleWriteLineActivityDesigner.cs
  • ConsoleWriteLineActivityDesignerTheme.cs
  • ConsoleWriteLineActivityValidator.cs

image 

Special Features

I will come back to what they do but I thought I would point out that I have taken special care with the code so that if you run code analysis (fxcop) you get no issues with the code - you will get five for the project not being signed and com visibility stuff - and that StyleCop also reports no issues. I have also added in three TODO’s (if you use the VS task list)

image

  • The first one (Write Code) takes you to the Execute method in the {Project}Activity.cs file. This is what will run when your activity is executed.
  • The second one (Pick some nice colours) takes you to {Project}ActivityDesignerTheme.cs file where you can specify the start and end colours for the gradient. By default it’s dark to light blue.

image

  • The third one (Add validation) takes you to the Validate method in the {Project}ActivityValidator.cs file where you can add any design time validation you need. It even has a sample of how to add a validation failure message.

image

What do I need to add to use it?

Basically all you need to do to get up and running is

1) Add the properties you need to the {Project}Activity.cs file.

2) Add the code as indicated by the task item.

3) Compile and use.

Optionally you can change the colours, add validation, add an icon or change what is shown on the component. The changing of what is shown is controlled via the SetText method in {Project}ActivityDesigner.cs and it has been wired up so that it will respond to property changes. So you can actually have the text change if the properties change with very little code needed.

How do I deploy it?

To use it just dump the ZIP file in the Visual Studio 2008 > Templates> ProjectTemplates > Visual C# in your documents folder and restart Visual Studio!

image

Where can I get it?

 

Note: My hosting provider has something that corrupts zip files so it has been uploaded in 7-zip format which you will need to extract it.

Hopefully you get some productivity benefit from this component or it helps you learn how to write your own, and if it does please leave a comment here so I know (and get that warn fuzzy feeling I like so much).

Filter SharePoint log entries

I often end up in the eventlog with SharePoint problems - since there is so much goodness there… um normally too much. So this trick of using PowerShell to filter the results and the export to a grid or CSV is very useful.

Get newest 20 SharePoint logs to a grid:

get-eventlog –logname Application –source ‘*sharepoint*’ –newest 20 | out-gridview

Export all SharePoint logs to CSV (perfect for Excel):

get-eventlog –logname Application –source ‘*sharepoint*’  | export-csv c:\eventlog.csv 

SharePoint Diagnostics Tool

The SharePoint Diagnostic tool (SPDiag) was created to simplify and standardize troubleshooting of SharePoint Products and Technologies, and to provide a unified view of collected data. SharePoint Products and Technologies administrators can use SPDiag to gather relevant information from a farm, display the results in a meaningful way, identify performance issues, and export the collected data and reports for analysis by Microsoft support personnel.

Download it from: https://www.microsoft.com/downloads/details.aspx?familyid=1c222804-51c7-4bb5-ae3d-89c68ad27a78&displaylang=en&tm

Thanks @mysharepoint for the heads up.

He is back!

The  man who has more friends that are robot’s than are human (check the pics on his blog posts), kids who fly supersonic speeds (soon) and has never attempted a Rubik cube is back online with his blog! Yep, Willy-Peter Schaub is now blogging with Microsoft branding ;) Go follow him at http://blogs.msdn.com/willy-peter_schaub - His blog on dotnet.org.za will still be their but will focus on personal items.

Microsoft Newsletters for South Africa

Stumbled across this when taking myself off some newsletters I don’t read any more. When you go to the profile site there is a list of all the news letters, you select which you want to join/leave. However if you change the language to English (South Africa) there are ones specifically from Microsoft South Africa (and actually Africa as a whole). Nice to see this!

image

Dublin - What you need to know!

Dublin is the code name for a application server which will ship as a separate download for Windows server around the .NET 4.0 timeframe. The application server’s focus will be on Workflow Foundation and Windows Communication Foundation applications. So, to me the developer pushing out code today what does it mean?

Well it means that a lot of the grunt work involved with WCF/WF applications is taken away because Dublin will provide a host for them - no more need for IIS for WCF and bespoke solutions for WF. That is not so great, I mean of course you can write your own still and in some situations that will be faster or more scalable than Dublin, but because the host is built the surrounding services come included. So lets take a prime example of how this would effect WF: Currently WF has a great tracking system which you can visualize using WinForms or ASP.NET, but why should I need to “copy-and-paste” that code into every WF application? Why isn’t there an out of the box tool like BizTalk has? Well since the Dublin server will host your workflows they will now provide you with a tool to do it!

Dublin setup/configuration tool

There is some important points to understand here:

  • Dublin is NOT .NET Framework 4 - It’s a separate Windows Server component. Updates will follow the Framework update schedule, but that’s as close as it gets.
  • Dublin is backwards compatible to .NET Framework 3.5 - So the work you are doing today is not wasted.
  • Dublin will support Oslo - Dublin is the first application to support administrators deploying out of Oslo.
  • So do I need BizTalk - Yes. BizTalk will still be great for B2B or LOB integration scenarios where you still will need to write code to get close to those great out of the box features. It is told they will work well together, but I have no details on how yet.
  • So do I need IIS - Yes. Even though a lot of apps now run on IIS will be moved to Dublin, you still want IIS for what it it good for - websites. In addition to that Dublin’s management interface is part of IIS!

Dublin settings in IIS 7.0

  • OS supported - Nothing official I can find but it uses IIS 7.0 so that implies Windows 2008 is a requirement.
  • What will it be called - Nothing offical although the beta bits have Windows Application Server as the name so it looks like it could be that.

Interesting the first customers to start work on Dublin are the Dynamics AX and CRM teams. Since I know CRM let me explain how I think they will use it (nothing official here). In MSCRM 4.0 you have two core components (high level):

  • Async Service - Which runs workflows
  • Web site - Which does the front end and web services

The async service will be dropped and it’s function together with hosting of the web services will be shifted over to Dublin with IIS continuing to host the website!

Persistence Out of the Box!

You can find out more at http://www.microsoft.com/NET/Dublin.aspx

Pictures from: http://www.biztalkgurus.com/blogs/biztalk/archive/2008/11/02/first-look-screen-shots-of-windows-application-server-dublin.aspx

Invite2Messenger

I don’t like Facebook for lots of reasons (how hard - and against their TOC - it is to get my data out being a big one), and one thing on Facebook that I used once and hated was their chat program (I don’t like browser based chat, not just Facebook’s). Thankfully Microsoft has solved that problem for me with the site Invite2Messenger, which lets you select your friends from Facebook and send them an invite to add you to Live Messenger. It is amazingly fast as well, working out which of the 120ish friends on Facebook have messenger accounts and which don’t in about 10 seconds and letting me have separate emails sent to each type.

The only downside to it, is that it doesn’t check who is already in messenger so a lot of my contacts got a mail asking to add me, even though they are in messenger. You can un-tick those manually… but I was lazy and this should be done automatically.

The thing that made me wonder is how Microsoft got access to that information, especially since all it asked for was the email address I use to sign in to Facebook. There was no prompt for logins or validation! In my untested theory based on running it one it may be possible to put anyone’s email in and get their friend list :( This seems like a security issue on the Facebook side… or maybe evidence of how much Microsoft’s little share in it actually has bought it!

SharePoint + Facebook

Courtz has had a great idea about combining SharePoint Mysites with Facebook information. He has a bit of simple code up there, but there may be a lot more options to explore (must put on thinking cap) around this and the upcoming Office 2009 release and features like the Knowlegde Network (yes that link points to the Channel 9 video of the product that didn’t happen with 2007, but it is happening with 2009!).

Delphi Prism: Part 4: What is available in each .NET Framework 3.5

What is available on each .NET Framework with Prism… this is mainly a screen shot post since it supports exactly what C# (and VB.NET) supports on those framework versions.

.NET Framework 3.5

Delphi - General

image

Mono

image

Silverlight

image

WCF

image

Windows

image

Windows (WPF)

image

.NET Framework 3.0

Delphi - General

image

Mono

image

Silverlight

NONE!

WCF

image

Windows

image

Windows (WPF)

image

.NET Framework 2.0

Delphi - General

image

Mono

image

Silverlight

NONE!

WCF

image

Windows

image

Windows (WPF)

NONE!

Juval Lowy coming to SA

Juval Lowy is from IDesign (which does some of the best WCF and .NET guidance) and runs the WCF master class which is a brilliant, but damn expensive course, so I’m definitely attending the FREE event where he will be speaking about .NET services. If you want to register: https://msevents.microsoft.com/CUI/Register.aspx?culture=en-ZA&EventID=1032402482&CountryCode=ZA&IsRedirect=false More details below.

Event Details:

Start Time:
11 February 2009 06:00 PM Harare, Pretoria

End Time:

11 February 2009 08:00 PM Harare, Pretoria

What is .NET services?

The .NET services bus is part of the new Microsoft Cloud Computing Windows Azure initiative, and arguably, it is the most accessible, ready to use, powerful, and needed piece. The service bus allows clients to connects to services across any machine, network, firewall, NAT, routers, load balancers, virtualization, IP and DNS as if they were part of the same local network, and doing all that without compromising on the programming model or security. The service bus also supports callbacks, event publishing, authentication and authorization and doing all that in a WCF-friendly manner.

This session will present the service bus programming model, how to configure and administer service bus solutions, working with the dedicated relay bindings including the available communication modes, relying on authentication in the cloud for local services and the various authentication options, and how to provide for end-to-end security through the relay service.

You will also see some advanced WCF programming techniques, original helper classes, productivity-enhancing utilities and tools, as well as discussion of design best practices and pitfalls.