如何在没有关联表单的情况下将默认关联数据添加到Sharepoint工作流

时间:2016-07-22 15:47:31

标签: visual-studio-2012 sharepoint sharepoint-2013 sharepoint-workflow

我想知道如何将默认关联数据添加到Visual Studio中开发的Sharepoint Workflow,而不需要任何关联表单。

问题是我有2个订阅同一个工作流程的不同列表,我想为每个订阅添加不同的默认参数值。

是否可以直接在Elements.xml文件中执行此操作?

我当前的XML文件看起来如此:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Workflow" Url="wfsvc/c7f7e1db60fe427084c8b9f1720b613e">
    <File Url="Workflow.xaml" Type="GhostableInLibrary" Path="Workflow\Workflow.xaml" DoGUIDFixUp="TRUE">
      <Property Name="ContentType" Value="WorkflowServiceDefinition" />
      <Property Name="Libreria" Value="List1" />
      <Property Name="isReusable" Value="true" />
      <Property Name="RequiresInitiationForm" Value="False" />
      <Property Name="RequiresAssociationForm" Value="False" />
      <Property Name="WSPublishState" Value="3" />
      <Property Name="WSDisplayName" Value="Workflow" />
      <Property Name="WSDescription" Value="Description" />
      <Property Name="RestrictToType" Value="List" />
      <Property Name="RestrictToScope" Value="{$ListId:List1;}" />
      <Property Name="InitiationUrl" Value="_layouts/15/Pages/WorkflowRedirect.aspx" />
    </File>
    <File Url="WorkflowStartAssociation" Path="Workflow\WorkflowStartAssociation" Type="GhostableInLibrary">
      <Property Name="WSDisplayName" Value="Workflow" />
      <Property Name="ContentType" Value="WorkflowServiceSubscription" />
      <Property Name="WSPublishState" Value="3" />
      <Property Name="WSEventType" Value="WorkflowStart" />
      <Property Name="WSEnabled" Value="true" />
      <Property Name="WSGUID" Value="88ae7a57-4a2c-4fa5-8488-71e6f504002f" />
      <Property Name="WSEventSourceGUID" Value="{$ListId:List1;}" />
      <Property Name="Microsoft.SharePoint.ActivationProperties.ListId" Value="{$ListId:List1;}" />
      <Property Name="HistoryListId" Value="{$ListId:Lists/Workflow History;}" />
      <Property Name="StatusColumnCreated" Value="1" />
    </File>
  </Module>
  <Module Name="Workflow" Url="wfsvc/8EF78D6856824F36B1EC2014E89413B1">
    <File Url="Workflow.xaml" Type="GhostableInLibrary" Path="Workflow\Workflow.xaml" DoGUIDFixUp="TRUE">
      <Property Name="ContentType" Value="WorkflowServiceDefinition" />
      <Property Name="Libreria" Value="List2" />
      <Property Name="isReusable" Value="true" />
      <Property Name="RequiresInitiationForm" Value="False" />
      <Property Name="RequiresAssociationForm" Value="False" />
      <Property Name="WSPublishState" Value="3" />
      <Property Name="WSDisplayName" Value="Workflow" />
      <Property Name="WSDescription" Value="Description" />
      <Property Name="RestrictToType" Value="List" />
      <Property Name="RestrictToScope" Value="{$ListId:List2;}" />
      <Property Name="InitiationUrl" Value="_layouts/15/Pages/WorkflowRedirect.aspx" />
    </File>
    <File Url="WorkflowStartAssociation" Path="Workflow\WorkflowStartAssociation" Type="GhostableInLibrary">
      <Property Name="WSDisplayName" Value="Workflow" />
      <Property Name="ContentType" Value="WorkflowServiceSubscription" />
      <Property Name="WSPublishState" Value="3" />
      <Property Name="WSEventType" Value="WorkflowStart" />
      <Property Name="WSEnabled" Value="true" />
      <Property Name="WSGUID" Value="B9DAA949-99BD-46C0-9942-3D74F6CCDAD1" />
      <Property Name="WSEventSourceGUID" Value="{$ListId:List2;}" />
      <Property Name="Microsoft.SharePoint.ActivationProperties.ListId" Value="{$ListId:List2;}" />
      <Property Name="HistoryListId" Value="{$ListId:Lists/Workflow History;}" />
      <Property Name="StatusColumnCreated" Value="1" />
    </File>
  </Module>
  <ListInstance FeatureId="{2c63df2b-ceab-42c6-aeff-b3968162d4b1}"
                TemplateType="4501"
                Title="wfsvc"
                Description="This list instance is used by SharePoint to keep track of workflows. Do not modify."
                Url="wfsvc"
                RootWebOnly="FALSE" />
</Elements>

1 个答案:

答案 0 :(得分:0)

您可以在WorkflowStartAssociation中添加任何属性,然后使用GetConfigurationValue活动在工作流中读取它们