如何获取在SharePoint工作流中工作的参数

时间:2020-03-05 18:40:28  来源:igfitidea点击:

我正在尝试使用输出参数创建自定义工作流操作以进行错误处理。通过各种示例进行工作,我无法使Parameter Direction =" Out"正常工作。一切似乎都正确,但是当我尝试将输出分配给SharePoint Designer中的"错误"变量时,它会在其周围放置星号并将其标记为工作流错误。这是动作XML的样子:

<Action Name="Create Folder"
  ClassName="ActivityLibrary.CreateFolderActivityTest"
  Assembly="ActivityLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxx"
  AppliesTo="all"
  CreatesInList="ListId"
  Category="Custom">
  <RuleDesigner Sentence="Create a folder %1 in the %2 base folder. If an error occurs it will be output to %3.">
    <FieldBind Field="FolderName" Text="folder name" Id="1"  />
    <FieldBind Field="BaseFolderPath"  Text="folder path" Id="2"/>
    <FieldBind Field="OutError" DesignerType="ParameterNames" Text="out error" Id="3"/>
  </RuleDesigner>
  <Parameters>
    <Parameter Name="FolderName" Type="System.String, mscorlib" Direction="In" />
    <Parameter Name="BaseFolderPath" Type="System.String, mscorlib" Direction="In" />
    <Parameter Name="OutError" Type="System.String, mscorlib" Direction="Out" />
  </Parameters>
</Action>

解决方案

回答

我们确定问题出在参数上,而不是SPD中的变量上吗?当然,XML看起来没有问题。

我一直讨厌SPD和工作流使我们在工作流中创建一个变量,并在页面中创建另一个变量以与工作流变量分配相同的值。

回答

我认为我们可能需要绑定外观中的Direction =" InOut"

回答

你有什么办法吗?我怀疑问题很可能出在逻辑代码中,而不是此xml(.actions)文件中。这对我来说似乎完全可以接受。