[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Management pack monitoring can be used with Windows Workflow Foundation to provide workflow logic to the management pack. A workflow can be integrated into the management pack by using the WorkflowSubscription subscription action. The following table describes the two key fields required to link the workflow binary with the subscription action.

Field Description Example value

AssemblyName

The name of the assembly installed on the Service Manager server.

WorkflowPackageRequest

WorkflowTypeName

The fully-qualified name of the class inside the assembly.

WorkflowPackageRequest.PackageInitial

The workflow can be customized by providing parameters. The name and type of a parameter correspond to the name and type of the desired property on the class instance specified by the subscription action WorkflowTypeName setting. The only valid parameter types are those defined by the WorkflowParameterType enumeration.

Important
The release version of Service Manager requires that a subscription containing a workflow action be associated with a category to appear in the Service Manager console.

To specify parameters on the workflow

  1. Create an instance of the WorkflowSubscription class.

  2. Set the AssemblyName and WorkflowTypeName properties.

  3. Enable the workflow by setting the Enabled property to true.

  4. Add any workflow parameters needed by the workflow.

  5. Insert the subscription by using the enterprise management group’s subscription API.

  6. Have the management pack accept the changes.

The following example demonstrates how to create a workflow subscription action by using instance criteria and setting two workflow parameters.

C#  Copy Code
string managementPackName = "RePackaging.Library";
string managementClassName = "RePackaging.Request";

ManagementPackCriteria searchCrit = new ManagementPackCriteria("$Name='" + managementPackName + "'$");
foreach (var mp in mg.ManagementPacks.GetManagementPacks(searchCrit))
{
	InstanceTypeSubscription subCriteria = new InstanceTypeSubscription(OperationType.Add, mp.GetClass(managementClassName).Id, "");
	subCriteria.BatchSize = 100;
	subCriteria.PollingIntervalInSeconds = 60;

	WorkflowSubscription subAction = new WorkflowSubscription("WF_AcceptPackageRequest", "Accepts the package request.", subCriteria);
	subAction.AssemblyName = "WorkflowPackageRequest";
	subAction.WorkflowTypeName = "WorkflowPackageRequest.PackageInitial";
	subAction.Enabled = true;
	subAction.Parameters.Add(new KeyValuePair<string, IWorkflowParameterValueBase>("InternalID", new WorkflowParameterValue(WorkflowParameterType.GuidType, "$Data/BaseManagedEntityId$")));
	subAction.Parameters.Add(new KeyValuePair<string, IWorkflowParameterValueBase>("ClassGUID", new WorkflowParameterValue(WorkflowParameterType.GuidType, "$MPElement[Name='RePackaging.Request']$")));

	mg.Subscription.InsertSubscription(mp.Id, subAction);
	mp.AcceptChanges();

	break;
}

Namespaces

Microsoft.EnterpriseManagement

Microsoft.EnterpriseManagement.Configuration

Microsoft.EnterpriseManagement.Subscriptions

Assemblies

Microsoft.EnterpriseManagement.Core

See Also