{"id":453,"date":"2011-09-13T05:11:38","date_gmt":"2011-09-13T04:11:38","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=453"},"modified":"2011-09-13T05:11:38","modified_gmt":"2011-09-13T04:11:38","slug":"workflow-activity-part-2","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/","title":{"rendered":"Workflow Activity &#8211; Part 2"},"content":{"rendered":"<p>This is the second part of the custom workflow activity creation tutorial.  For the first part please go <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-1\/\" title=\"Workflow Activity \u2013 Part 1\">here<\/a>.<\/p>\n<p>Now that we have a workflow activity defined, the next step is to add a new project to Visual Studio.<\/p>\n<p><div id=\"attachment_458\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-458\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project-300x206.png\" alt=\"\" title=\"Create SharePoint Project\" width=\"300\" height=\"206\" class=\"size-medium wp-image-458\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project-300x206.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project-435x300.png 435w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project.png 952w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-458\" class=\"wp-caption-text\">Create SharePoint Project<\/p><\/div><br \/>\n<!--more--><br \/>\nNext, add a project reference to the activity project.<\/p>\n<div id=\"attachment_462\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Project-Reference.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-462\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Project-Reference-300x77.png\" alt=\"\" title=\"Activity Project Reference\" width=\"300\" height=\"77\" class=\"size-medium wp-image-462\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Project-Reference-300x77.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Project-Reference.png 465w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-462\" class=\"wp-caption-text\">Activity Project Reference<\/p><\/div>\n<p>Now to create the workflow.  Add a <em>new item<\/em> to the project and select a <em>Sequential Workflow<\/em>.<\/p>\n<div id=\"attachment_463\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-Sequential-Workflow.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-463\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-Sequential-Workflow-300x206.png\" alt=\"\" title=\"New Sequential Workflow\" width=\"300\" height=\"206\" class=\"size-medium wp-image-463\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-Sequential-Workflow-300x206.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-Sequential-Workflow-436x300.png 436w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-Sequential-Workflow.png 952w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-463\" class=\"wp-caption-text\">New Sequential Workflow<\/p><\/div>\n<p>Give the workflow a name and set it as a list type.<\/p>\n<div id=\"attachment_464\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-List-Workflow.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-464\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-List-Workflow-300x237.png\" alt=\"\" title=\"New List Workflow\" width=\"300\" height=\"237\" class=\"size-medium wp-image-464\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-List-Workflow-300x237.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-List-Workflow-379x300.png 379w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/New-List-Workflow.png 598w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-464\" class=\"wp-caption-text\">New List Workflow<\/p><\/div>\n<p>Next, select the option for associating with libraries and lists.  You can of course opt to not auto associate and this is something I&#8217;d generally do as it allows you to control where and what the workflow is associated to when activating the feature, but that&#8217;s a different topic altogether.<\/p>\n<p>While the new workflow is opened, hover over the <em>toolbox<\/em> pane and you should see the custom activity that was created in the first part of this post.<\/p>\n<div id=\"attachment_465\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Toolbox.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-465\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Toolbox-300x85.png\" alt=\"\" title=\"Activity Toolbox\" width=\"300\" height=\"85\" class=\"size-medium wp-image-465\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Toolbox-300x85.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Toolbox-500x141.png 500w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Activity-Toolbox.png 743w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-465\" class=\"wp-caption-text\">Activity Toolbox<\/p><\/div>\n<p>Before adding the activity, add the <em>ApplyActivation<\/em> activity to the designer.<\/p>\n<div id=\"attachment_467\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Apply-Activation-Activity.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-467\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Apply-Activation-Activity.png\" alt=\"\" title=\"Apply Activation Activity\" width=\"300\" height=\"209\" class=\"size-full wp-image-467\" \/><\/a><p id=\"caption-attachment-467\" class=\"wp-caption-text\">Apply Activation Activity<\/p><\/div>\n<p>To configure the apply activation activity, we first need to create and associate a workflow context property.  To do this, select the activity in the designer, bring up the properties pane and edit the __Context property.<\/p>\n<div id=\"attachment_469\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Edit-Context-Property.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-469\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Edit-Context-Property-300x138.png\" alt=\"\" title=\"Edit Context Property\" width=\"300\" height=\"138\" class=\"size-medium wp-image-469\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Edit-Context-Property-300x138.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Edit-Context-Property.png 335w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-469\" class=\"wp-caption-text\">Edit Context Property<\/p><\/div>\n<p>Switch to the <em>Bind to a new member tab<\/em> and create a new field.<\/p>\n<p>The difference between a property and a field is that the former creates a dependency property while the latter is a simple .NET property with no such binding.<\/p>\n<p>Do the same for the _WorkflowProperties property, only this time instead of binding to a new member, select the <em>workflowProperties<\/em> item that already exists.<\/p>\n<div id=\"attachment_470\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Bind-Workflow-Properties.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-470\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Bind-Workflow-Properties-300x228.png\" alt=\"\" title=\"Bind Workflow Properties\" width=\"300\" height=\"228\" class=\"size-medium wp-image-470\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Bind-Workflow-Properties-300x228.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Bind-Workflow-Properties-394x300.png 394w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Bind-Workflow-Properties.png 507w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-470\" class=\"wp-caption-text\">Bind Workflow Properties<\/p><\/div>\n<p>Next, add the custom activity to the workflow, immediately after the <em>ApplyActivation<\/em> activity.<\/p>\n<div id=\"attachment_468\" style=\"width: 147px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Custom-Activity1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-468\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Custom-Activity1-137x300.png\" alt=\"\" title=\"Custom Activity\" width=\"137\" height=\"300\" class=\"size-medium wp-image-468\" \/><\/a><p id=\"caption-attachment-468\" class=\"wp-caption-text\">Custom Activity<\/p><\/div>\n<p>Switch to the code behind for the workflow and add the following property.<\/p>\n<pre lang=\"csharp\">\r\npublic SPItemKey ListItemId\r\n{\r\n    get\r\n    {\r\n        return new SPItemKey(workflowProperties.ItemId);\r\n    }\r\n}\r\n<\/pre>\n<p>This will be used to convert the item id for the workflow to an SPItemKey object.<\/p>\n<p>Head back to the designer window and bring up the properties pane for the custom activity.  Here you want to bind __Context to applyActivation1_Context1 (or whatever you called the context field property).  You should also bind the __ListId property to the ListId child property of applyActivation1_Context1.<\/p>\n<div id=\"attachment_473\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Associate-List-Id-Property.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-473\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Associate-List-Id-Property-300x115.png\" alt=\"\" title=\"Associate List Id Property\" width=\"300\" height=\"115\" class=\"size-medium wp-image-473\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Associate-List-Id-Property-300x115.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Associate-List-Id-Property-500x192.png 500w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Associate-List-Id-Property.png 507w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-473\" class=\"wp-caption-text\">Associate List Id Property<\/p><\/div>\n<p>Next, you should now associate the __ItemId property with the ListItemId property, which we created via code behind.<\/p>\n<div id=\"attachment_475\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Property-Assignments.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-475\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Property-Assignments-300x53.png\" alt=\"\" title=\"Property Assignments\" width=\"300\" height=\"53\" class=\"size-medium wp-image-475\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Property-Assignments-300x53.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Property-Assignments-500x89.png 500w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Property-Assignments.png 835w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-475\" class=\"wp-caption-text\">Property Assignments<\/p><\/div>\n<p>Lastly, you should enter a valid email address for the EmailTo property.<\/p>\n<div id=\"attachment_476\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Specify-Email-Address.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-476\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Specify-Email-Address-300x57.png\" alt=\"\" title=\"Specify Email Address\" width=\"300\" height=\"57\" class=\"size-medium wp-image-476\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Specify-Email-Address-300x57.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Specify-Email-Address.png 343w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-476\" class=\"wp-caption-text\">Specify Email Address<\/p><\/div>\n<p>If this were a workflow for a live system this would definitely not be the way to go, you&#8217;d want to dynamically set the value here either from the parent workflow or by retrieving the value from one of the workflow item&#8217;s fields.<\/p>\n<p>We&#8217;re now finished with the workflow.  Next, open the feature editor &#8211; as this is a new project and we only added one workflow there should only be one feature present.  To have SharePoint automatically register this workflow change the <em>receiver assembly<\/em> to <em>Microsoft.Office.Workflow.Feature, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c<\/em> and the <em>receiver class<\/em> to <em>Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver<\/em>.<\/p>\n<div id=\"attachment_477\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-477\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver-300x67.png\" alt=\"\" title=\"Feature Receiver\" width=\"300\" height=\"67\" class=\"size-medium wp-image-477\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver-300x67.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver-1024x229.png 1024w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver-500x112.png 500w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Feature-Receiver.png 1367w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-477\" class=\"wp-caption-text\">Feature Receiver<\/p><\/div>\n<p>Before we deploy the solution, there is one last thing we need to do and that&#8217;s ensure the assembly for the workflow activity is deployed along with the SharePoint solution.  To do this open the package editor and click on the Advanced link.<\/p>\n<div id=\"attachment_478\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Advanced-Package.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-478\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Advanced-Package-300x152.png\" alt=\"\" title=\"Advanced Package\" width=\"300\" height=\"152\" class=\"size-medium wp-image-478\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Advanced-Package-300x152.png 300w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Advanced-Package-500x254.png 500w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Advanced-Package.png 752w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-478\" class=\"wp-caption-text\">Advanced Package<\/p><\/div>\n<p>Click the <em>Add<\/em> button and then <em>Add assembly from Project Output&#8230;<\/em>.<\/p>\n<p>From the popup, select the workflow activity project and ensure the deployment target is set to the GAC.<\/p>\n<div id=\"attachment_479\" style=\"width: 282px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Add-Project-Assembly.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-479\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Add-Project-Assembly-272x300.png\" alt=\"\" title=\"Add Project Assembly\" width=\"272\" height=\"300\" class=\"size-medium wp-image-479\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Add-Project-Assembly-272x300.png 272w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Add-Project-Assembly.png 450w\" sizes=\"auto, (max-width: 272px) 100vw, 272px\" \/><\/a><p id=\"caption-attachment-479\" class=\"wp-caption-text\">Add Project Assembly<\/p><\/div>\n<p>Deploy the solution, activate the feature and bob&#8217;s your uncle.  You should now be able to associate the workflow with any list or library and receive an email after creating a new item.  Ensure that your server has an outgoing email server configured and the email address set in the workflow is valid, otherwise you will get errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the second part of the custom workflow activity creation tutorial. For the first part please go here. Now that we have a workflow activity defined, the next step is to add a new project to Visual Studio.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[3,82],"tags":[81,6,30],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-sharepoint","category-workflow","tag-sharepoint","tag-workflow","tag-workflow-activity"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"Guide on creating custom SharePoint workflow activity and adding it to a workflow\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Stu\"\/>\n\t<meta name=\"keywords\" content=\"sharepoint,sps,sp,workflow,activities,activity,workflow activity\" \/>\n\t<link rel=\"canonical\" href=\"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_GB\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Stuart Roberts | SharePoint &amp; M365 Development | Practical development guides, solutions and lessons learned across SharePoint, Microsoft 365 and modern development tools\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint &amp; M365 Development\" \/>\n\t\t<meta property=\"og:description\" content=\"Guide on creating custom SharePoint workflow activity and adding it to a workflow\" \/>\n\t\t<meta property=\"og:url\" content=\"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2011-09-13T04:11:38+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2011-09-13T04:11:38+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@SharePointStu\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint &amp; M365 Development\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Guide on creating custom SharePoint workflow activity and adding it to a workflow\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@SharePointStu\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#article\",\"name\":\"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint & M365 Development\",\"headline\":\"Workflow Activity &#8211; Part 2\",\"author\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/wp-content\\\/uploads\\\/2011\\\/09\\\/Create-SharePoint-Project.png\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#articleImage\",\"width\":952,\"height\":656,\"caption\":\"Create SharePoint Project\"},\"datePublished\":\"2011-09-13T05:11:38+01:00\",\"dateModified\":\"2011-09-13T05:11:38+01:00\",\"inLanguage\":\"en-GB\",\"commentCount\":3,\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#webpage\"},\"articleSection\":\"SharePoint, Workflow, SharePoint, Workflow, Workflow Activity\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.stuartroberts.net\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/#listItem\",\"name\":\"SharePoint\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/#listItem\",\"position\":2,\"name\":\"SharePoint\",\"item\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/workflow\\\/#listItem\",\"name\":\"Workflow\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/workflow\\\/#listItem\",\"position\":3,\"name\":\"Workflow\",\"item\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/workflow\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#listItem\",\"name\":\"Workflow Activity &#8211; Part 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/#listItem\",\"name\":\"SharePoint\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#listItem\",\"position\":4,\"name\":\"Workflow Activity &#8211; Part 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/category\\\/sharepoint\\\/workflow\\\/#listItem\",\"name\":\"Workflow\"}}]},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\",\"name\":\"Stu\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"Stu\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"Stu\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"Stu\"}},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#webpage\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/\",\"name\":\"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint & M365 Development\",\"description\":\"Guide on creating custom SharePoint workflow activity and adding it to a workflow\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#website\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/2011\\\/09\\\/13\\\/workflow-activity-part-2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/index.php\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2011-09-13T05:11:38+01:00\",\"dateModified\":\"2011-09-13T05:11:38+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#website\",\"url\":\"http:\\\/\\\/www.stuartroberts.net\\\/\",\"name\":\"Stuart Roberts on all things SharePoint\",\"description\":\"Practical development guides, solutions and lessons learned across SharePoint, Microsoft 365 and modern development tools\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.stuartroberts.net\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint & M365 Development","description":"Guide on creating custom SharePoint workflow activity and adding it to a workflow","canonical_url":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/","robots":"max-image-preview:large","keywords":"sharepoint,sps,sp,workflow,activities,activity,workflow activity","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#article","name":"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint & M365 Development","headline":"Workflow Activity &#8211; Part 2","author":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"publisher":{"@id":"http:\/\/www.stuartroberts.net\/#person"},"image":{"@type":"ImageObject","url":"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2011\/09\/Create-SharePoint-Project.png","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#articleImage","width":952,"height":656,"caption":"Create SharePoint Project"},"datePublished":"2011-09-13T05:11:38+01:00","dateModified":"2011-09-13T05:11:38+01:00","inLanguage":"en-GB","commentCount":3,"mainEntityOfPage":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#webpage"},"isPartOf":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#webpage"},"articleSection":"SharePoint, Workflow, SharePoint, Workflow, Workflow Activity"},{"@type":"BreadcrumbList","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/#listItem","position":1,"name":"Home","item":"http:\/\/www.stuartroberts.net\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/#listItem","name":"SharePoint"}},{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/#listItem","position":2,"name":"SharePoint","item":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/#listItem","name":"Workflow"},"previousItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/#listItem","position":3,"name":"Workflow","item":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#listItem","name":"Workflow Activity &#8211; Part 2"},"previousItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/#listItem","name":"SharePoint"}},{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#listItem","position":4,"name":"Workflow Activity &#8211; Part 2","previousItem":{"@type":"ListItem","@id":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/#listItem","name":"Workflow"}}]},{"@type":"Person","@id":"http:\/\/www.stuartroberts.net\/#person","name":"Stu","image":{"@type":"ImageObject","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g","width":96,"height":96,"caption":"Stu"}},{"@type":"Person","@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author","url":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/","name":"Stu","image":{"@type":"ImageObject","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/503cb376bab10c66a6bde71d1514dcab2eab4ec44a2f82ef597ca87af61bf1cd?s=96&d=retro&r=g","width":96,"height":96,"caption":"Stu"}},{"@type":"WebPage","@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#webpage","url":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/","name":"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint & M365 Development","description":"Guide on creating custom SharePoint workflow activity and adding it to a workflow","inLanguage":"en-GB","isPartOf":{"@id":"http:\/\/www.stuartroberts.net\/#website"},"breadcrumb":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/#breadcrumblist"},"author":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"creator":{"@id":"http:\/\/www.stuartroberts.net\/index.php\/author\/admin\/#author"},"datePublished":"2011-09-13T05:11:38+01:00","dateModified":"2011-09-13T05:11:38+01:00"},{"@type":"WebSite","@id":"http:\/\/www.stuartroberts.net\/#website","url":"http:\/\/www.stuartroberts.net\/","name":"Stuart Roberts on all things SharePoint","description":"Practical development guides, solutions and lessons learned across SharePoint, Microsoft 365 and modern development tools","inLanguage":"en-GB","publisher":{"@id":"http:\/\/www.stuartroberts.net\/#person"}}]},"og:locale":"en_GB","og:site_name":"Stuart Roberts | SharePoint &amp; M365 Development | Practical development guides, solutions and lessons learned across SharePoint, Microsoft 365 and modern development tools","og:type":"article","og:title":"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint &amp; M365 Development","og:description":"Guide on creating custom SharePoint workflow activity and adding it to a workflow","og:url":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/","article:published_time":"2011-09-13T04:11:38+00:00","article:modified_time":"2011-09-13T04:11:38+00:00","twitter:card":"summary","twitter:site":"@SharePointStu","twitter:title":"Custom Workflow Activity - Part 2 | Stuart Roberts | SharePoint &amp; M365 Development","twitter:description":"Guide on creating custom SharePoint workflow activity and adding it to a workflow","twitter:creator":"@SharePointStu"},"aioseo_meta_data":{"post_id":"453","title":"Custom Workflow Activity - Part 2 | #site_title","description":"Guide on creating custom SharePoint workflow activity and adding it to a workflow","keywords":[{"label":"SharePoint","value":"SharePoint"},{"label":"SPS","value":"SPS"},{"label":"SP","value":"SP"},{"label":"Workflow","value":"Workflow"},{"label":"Activities","value":"Activities"},{"label":"Activity","value":"Activity"},{"label":"Workflow Activity","value":"Workflow Activity"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-08-03 13:50:56","updated":"2026-10-15 18:43:18","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.stuartroberts.net\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/\" title=\"SharePoint\">SharePoint<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/\" title=\"Workflow\">Workflow<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWorkflow Activity \u2013 Part 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"http:\/\/www.stuartroberts.net\/"},{"label":"SharePoint","link":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/"},{"label":"Workflow","link":"http:\/\/www.stuartroberts.net\/index.php\/category\/sharepoint\/workflow\/"},{"label":"Workflow Activity &#8211; Part 2","link":"http:\/\/www.stuartroberts.net\/index.php\/2011\/09\/13\/workflow-activity-part-2\/"}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=453"}],"version-history":[{"count":12,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":1171,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions\/1171"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}