1

我想知道如何將默認關聯數據添加到在Visual Studio中開發的Sharepoint工作流程,而無需任何關聯表單。如何將默認關聯數據添加到沒有關聯表單的Sharepoint工作流程

問題是,我有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> 

回答

0

您可以在WorkflowStartAssociation在工作流程中使用的GetConfigurationValue活動

+0

這並不提供答案的問題添加任何屬性,然後閱讀。要批評或要求作者澄清,請在其帖子下方留言。 - [來自評論](/ review/low-quality-posts/13553777) – lmo

+0

我是那個讓原帖發問的人,這正是我所要求的! –