私は、オプションのパラメータを渡そうとしているカスタムSharePointサンドボックスワークフローアクティビティを持っています。しかし、ULSは私に次の例外メッセージが表示されます:タイプのカスタムサンドボックスワークフローアクティビティの問題
"SJW.SPDActivities.SendEmailWithAttachment.SendEmailWithAttachmentActivityを" "SendEmailAttachment" に失敗しました。このメソッドには "RecipientCC"という名前のパラメータが含まれていますが、パラメータ辞書にはこのパラメータの値は含まれていません。
私の推測では、SPUserCodeWorkflowActionWrapperはサンドボックスワークフローメソッドにパラメータをバインドするために何らかのリフレクションを使用していると思います。しかし、それらのうちの1つが、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)