SharePoint Workflow活动未出现在SP Designer中。部署成功

时间:2012-07-10 07:41:25

标签: c# sharepoint workflow sharepoint-designer

我为SP Designer开发了一个SP工作流程活动。部署成功。在webconfig文件中,正确插入了authorizedType:

<authorizedType Assembly="WorkflowActivity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5c8e215f3e395427" Namespace="AdventureWorksWFs" TypeName="*" Authorized="True" />

源代码:

public static DependencyProperty TestProperty = DependencyProperty.Register("Test", typeof(string), typeof(TestSite));

    [Description("Name of the new Site")]
    [Category("Sites")]
    [Browsable(true)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
    public string Test
    {
        get
        {
            return ((string)(base.GetValue(TestSite.TestProperty)));
        }
        set
        {
            base.SetValue(TestSite.TestProperty, value);
        }
    }

    protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
    {
        using (SPSite siteCollection = new SPSite(Url))
        {
            using (SPWeb web = siteCollection.OpenWeb())
            {
                using (SPWeb testWeb = web.Webs.Add(Test)) 
                {
                    testWeb.Description = "This is a test!";
                    testWeb.Title = Test;
                }
            }
        }
        return ActivityExecutionStatus.Closed;
    }

这是.actions文件:

<WorkflowInfo>
  <Actions Sequential="then" Parallel="and">
    <Action Name="Create New Site" ClassName="TestActivity.TestSite"
        Assembly="TestActivity, Version=1.0.0.0, Culture=neutral, 
        PublicKeyToken=5c25d241f3e851927" AppliesTo="all"
        Category="Sites">
      <RuleDesigner Sentence="Create TestSite">
        <FieldBind Field="Test" Text="test" DesignerType="TextBox" Id="1" />
      </RuleDesigner>
      <Parameters>
        <Parameter Name="Test" Type="System.String, mscorlib" Direction="In" />
      </Parameters>
    </Action>
  </Actions>
</WorkflowInfo>

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

搜索以下参考:

•打开安装软件包的WebApplication的配置文件:C:\ Inetpub \ wwwroot \ wss \ VirtualDirectories [Port Web App] \ web.config

•检查以在适当的位置显示应创建解决方案安装的以下两个配置条目:

 <SafeControl Assembly="TestActivity.TestSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5c25d241f3e851927" Namespace="TestActivity.TestSite" TypeName="*" Safe="True" SafeAgainstScript="False" />

  <authorizedType Assembly="TestActivity.TestSite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5c25d241f3e851927" Namespace="TestActivity.TestSite" TypeName="*" Authorized="True" />

如果您未在适当的位置手动添加它们。

然后验证该文件是否为TestActivity.TestSite.Actions到相应的目录中:

C:\ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 14 \ TEMPLATE \ 1033 \ Workflow \