Creating a Workflow Activity Library and Activity Part 1

This post has been republished via RSS; it originally appeared at: Core Infrastructure and Security Blog articles.

First published on MSDN on May 12, 2016
This post is based off of the technet article Walkthrough: Create a Logging Custom Activity and Deploy it to the FIM Portal

Creating a Workflow Activity Library and Activity in Visual Studio

The following procedure shows how to create a new workflow activity library in Visual Studio 2008. This library can contain one or more custom activities.

To create a new workflow activity library and activity file

Start Visual Studio - 2012 or greater
Create a new Workflow Activity Library. This example uses Visual C#, but you can also use Visual Basic.
On the File menu, point to New , and then click Project .
New Project
Under the Visual C# project types, select W orkflow . In the Templates pane, select Workflow Activity Library . (Be sure and change the .NET Framework to 3.5)
Select Workflow on the left under templates
Create Workflow Activity
Clear the Create directory for solution check box.
Name the library LoggingActivitiesLibrary , and then click OK .
The following illustration shows the New Project dialog box after you make these selections.

Add references to the FIM assemblies:

If Solution Explorer is not open, on the View menu, click Solution Explorer .
Solution Explorer
In Solution Explorer , right-click the References folder, and then click Add Reference .
Add Reference
In the Add Reference dialog box,
Add Reference 2
click the Browse tab, and browse to folder that contains the Microsoft.ResourceManagement.dll assembly.
Note: The default installation location for this assembly is C:\Program Files\Microsoft Forefront Identity Manager\2010\Service.
Select Microsoft.Resourceanagement.dll Asembly

Select the Microsoft.ResourceManagement.dll assembly, and then click OK .

Reference Manager

Set the application properties:

In Solution Explorer, right-click the Properties folder, and then click Open. This action opens a project properties file in the workspace that has the same name as your project. In this example, the file is named LoggingActivitiesLibrary.
Set application 1
Click the Application tab.
In Assembly name, type LoggingActivitesLibrary.
In Default namespace, type FIM.CustomWorkflowActivitiesLibrary.Activities.
In Target Framework, select .Net Framework 3.5 if its not already selected
Set application 2
Click on Save
Close the LoggingActivitiesLibrary file.
Create a new activity called RequestLoggingActivity:
In Solution Explorer, right-click LoggingActivitiesLibrary, click Add, and then click Activity.
Name the new activity RequestLoggingActivity.cs.
Click Add.
Lets take a look at the Solution Explorer an Examine what we have so far
Solution Explorer 2
Two new files appear in Solution Explorer: RequestLoggingActivity.cs and RequestLoggingActivity.Designer.cs.
In Solution Explorer, right-click Activity1.cs, and then click Delete.
To save the project, on the File menu, click Save All.
To build the project, on the Build menu, click Solution.
Lets take a look at yourj
You now have a Visual Studio project that contains references to FIM assemblies. It also contains two files that you will use to define the new activity: RequestLoggingActivity.cs and RequestLoggingActivity.Designer.cs.

Next, you add FIM out-of-box activities to the Toolbox so that you can specify the sequence of activities that define the custom activity.

Continue to Creating a Creating a Workflow Activity Library and Activity Part 2

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.