How to get out parameters working in SharePoint workflows

强颜欢笑 提交于 2019-12-10 14:14:02

问题


I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction="Out" to work. Everything seems right, but when I try to assign the output to the "error" variable in SharePoint Designer, it places asterisks around it and flags it as a workflow error. Here is what the action XML looks like:

<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>

回答1:


I think you may want Direction="InOut" from the looks of the binding




回答2:


Are you sure the issue is with the parameters and not maybe the variable in SPD? Certainly nothing looks wrong with your XML.

I always hated the way SPD and workflows make you create a variable within the workflow and another within the page to assign to the same value as the workflow variable.




回答3:


Did you get anywhere with this? I suspect the problem was more likely in your logic code rather than this xml (.actions) file. It looks perfectly acceptable to me.



来源:https://stackoverflow.com/questions/15053/how-to-get-out-parameters-working-in-sharepoint-workflows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!