Monday, March 15, 2010

Creating custom activity in Workflow Part – 4

Hi All,

As we are approaching to some final posts of the series, I feel happy to share these posts with you all and make you aware of all things related to custom activity.

If you have not read previous articles, I recommend you reading Creating custom activity in Workflow Part – 1 First.

Here in this post, we will talk about the visual designer for the custom activity. It has nothing to do with functionality, so definitely this is not something which is required, However it is something which is nice to have.

So let us go ahead and understand how we can create visual appearance of custom activity.

By default when you drag and drop any activity, you will observe the shape and coloring same for each and every activity. We can change the shape, background color, border of our custom activity to give new fresh look. Hence I refer this visualization change of custom activity as makeup of activity. (Remember I used this term in post 1). :)

To achieve this, we need to implement three steps instead of two steps like other posts that we did.

1) Create a class which inherits from ActivityDesigner.
2) Create class which inherits from ActivityDesignerTheme.
3) Add ActivityDesignerTheme attribute to the class which inherits from ActivityDesigner.
4) Add Designer attribute to the Custom activity class.

So let’s start. Add one more class to our custom activity project. Name it CustomActivityDesignerTheme



Then add CustomActivityDesigner class which inherits from ActivityDesigner and add attribute as shown in figure below.



And then add designer attribute to the Custom activity class.



Now again just compile whole custom activity project, add activity to the console application and see the result. You will see our customized theme for our custom activity that we’ve just created.




Read Creating custom activity in Workflow Part – 5 for further reading.

1 comment:

Tanmayee said...

All 4 parts of the "Creating custom activity in Workflow" are excellent.It really helped me a lot.
Thank you so much.




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com