У меня есть пользовательский рабочий процесс с изолированной обработкой SharePoint, с которым я пытаюсь передать необязательный параметр. Тем не менее, ULS дает мне следующее сообщение об исключении:Нестандартные проблемы с обработкой рабочего процесса
"SJW.SPDActivities.SendEmailWithAttachment.SendEmailWithAttachmentActivity" типа "SendEmailAttachment" не удалось. Метод содержит параметр «RecipientCC», но словарь параметров не содержит значения этого параметра.
Я предполагаю, что SPUserCodeWorkflowActionWrapper использует какое-то отражение для привязки параметров к моему методу рабочего процесса с песочницей. Однако, поскольку один из них объявлен как необязательный в моем файле Elements.xml (RecipientCC), он не может найти значение для привязки и, таким образом, исключает исключение.
Любая идея, как обойти это неудобное поведение? Должен ли я объявлять все мои параметры обязательными?
Мой Elements.xml файл:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<WorkflowActions>
<Action Name="Send an Email with an Attachment"
SandboxedFunction="true"
Assembly="$SharePoint.Project.AssemblyFullName$"
ClassName="SJW.SPDActivities.SendEmailWithAttachment.SendEmailWithAttachmentActivity"
FunctionName="SendEmailAttachment"
AppliesTo="all"
Category="SJW Custom Actions">
<RuleDesigner Sentence="Email %1 with attachment %2">
<FieldBind Field="RecipientTo,RecipientCC,Subject,Body" Text="these people" Id="1" DesignerType="Email"/>
<FieldBind Field="AttachmentListID,AttachmentListItem" Text="file" Id="2" DesignerType="ChooseDoclibItem"/>
</RuleDesigner>
<Parameters>
<Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In" DesignerType="Hide"/>
<Parameter Name="RecipientTo" Type="System.Collections.ArrayList, mscorlib" Direction="In"/>
<Parameter Name="RecipientCC" Type="System.Collections.ArrayList, mscorlib" Direction="Optional"/>
<Parameter Name="Subject" Type="System.String, mscorlib" Direction="In"/>
<Parameter Name="Body" Type="System.String, mscorlib" Direction="In"/>
<Parameter Name="AttachmentListID" Type="System.String, mscorlib" Direction="In"/>
<Parameter Name="AttachmentListItem" Type="System.Int32, mscorlib" Direction="In"/>
</Parameters>
</Action>
</WorkflowActions>
</Elements>
Мой метод декларации:
public Hashtable SendEmailAttachment(SPUserCodeWorkflowContext context,
ArrayList RecipientTo,
ArrayList RecipientCC,
string Subject,
string Body,
string AttachmentListID,
int AttachmentListItem)