我已成功将自定义操作部署到可在SharePoint Designer中使用的操作列表,但是在打开现有工作流或在Designer中创建新工作流时,会收到消息(当然,我的自定义操作不在动作清单)
服务器上的工作流操作列表引用了一个程序集,该程序集
不存在。某些操作将不可用。组装
强名是{Actual Assembly强名}。与您的服务器联系
管理员以获取更多信息。
我检查了强程序集名称,全局程序集缓存,程序包选项,.ACTIONS文件,web.config ...一切似乎正常。有什么新想法吗?
最佳答案
我假设自定义操作是从System.Workflow.ComponentModel.Activity继承的场部署活动(可能使用子类SequenceActivity,但实际上没关系)
我猜您尚未创建所需的ACTIONS文件,该文件已部署到TEMPLATE \ 1033 \ Workflow
<?xml version="1.0" encoding="utf-8" ?>
<WorkflowInfo>
<Actions Sequential="then" Parallel="and">
<Action Name="Description for SP Designer"
Assembly="$SharePoint.Project.AssemblyFullName$"
ClassName="AssemblyName.ClassName"
AppliesTo="all"
Category="SPD category"
UsesCurrentItem="true"
>
<RuleDesigner Sentence="Line as it appears in SPD workflow" />
<Parameters>
<Parameter Name="__ActivationProperties" Type="Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties, Microsoft.SharePoint" Direction="In" />
</Parameters>
</Action>
</Actions>
</WorkflowInfo>
SPD从ACTIONS文件中读取活动列表。添加文件将使其进入菜单。要将其实际添加到工作流中,还需要按类名称授权自定义工作流活动。
要添加授权类型,我使用具有以下spwebmodification的功能接收器:
private SPWebConfigModification CreateWebConfigModification(string assembly, string assemblyNamespace)
{
return new SPWebConfigModification()
{
Type = (SPWebConfigModification.SPWebConfigModificationType)0,
Name = String.Format("authorizedType[@Assembly='{0}'][@Namespace='{1}'][@TypeName='*'][@Authorized='True']", (object)assembly, (object)assemblyNamespace),
Path = "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes",
Owner = assemblyNamespace,
Sequence = 0U,
Value = String.Format("<authorizedType Assembly='{0}' Namespace='{1}' TypeName='*' Authorized='True' />", (object)assembly, (object)assemblyNamespace)
};
}
这将生成一个SPWebConfigModification,可在安装/卸载期间使用。