gpt4 book ai didi

sharepoint - SPWorkflowActivationProperties.Item 在简单 SharePoint 工作流中为 NULL

转载 作者:行者123 更新时间:2023-12-04 19:22:44 24 4
gpt4 key购买 nike

我生成了 C# SharePoint 顺序工作流 项目使用非常方便的 STSDEV tool (它让我绕过了访问 32 位 SharePoint 安装的要求,这是其他工具(如 VSeWSS 1.3)所必需的)。

我添加了一个简单的“修改标题”操作来测试我的基本设置:

public sealed partial class CopyWorkflow : SharePointSequentialWorkflowActivity
{

public CopyWorkflow()
{
InitializeComponent();
workflowProperties = new SPWorkflowActivationProperties();
}

public SPWorkflowActivationProperties workflowProperties;

private void onWorkflowActivated1_Invoked_1(object sender, ExternalDataEventArgs e)
{
workflowProperties.Item["Title"] = workflowProperties.Item["Title"].ToString() + ": Processed by Workflow";
workflowProperties.Item.Update();
}
}

谁,在通过 WSP 将我的工作流安装到 的安装中之后WSS 3.0 ,激活该功能并配置工作流以在为特定列表创建新项目时启动,我在 onWorkflowActivated1_Invoked_1 命中获得断点,但 workflowProperties.Item 始终为 NULL 而不是 SPListItem 代表刚刚添加的项目。

调用此回调时,我需要做什么才能使要填充的项目?

更新:我注意到执行工作流的线程是匿名运行的,而不是以登录用户或系统用户的身份运行,因此无法访问列表数据。此外,SharePoint 日志文件显示以下异常:
Unexpected System.ArgumentNullException: Value cannot be null. Parameter name: uriString at System.Uri..ctor(String uriString) at Microsoft.SharePoint.SPSite..ctor(String requestUrl) at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties.<get_Site>b__0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties....

Unexpected ...get_Site() at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties.get_Web() at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties.get_Item() at BechtelWorkflow.CopyWorkflow.onWorkflowActivated1_Invoked_1(Object sender, ExternalDataEventArgs e) at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e) at System.Workflow.Activities.HandleExternalEventActivity.RaiseEvent(Object[] args) at System.Workflow.Activities.HandleExternalEventActivity.Execute(ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor'1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor'1.Execute(Activity activi...

最佳答案

您是否已将 WorkflowActivationProperties 与 Workflow Designer 绑定(bind)?

WorkflowActivationProperties http://img718.imageshack.us/img718/9703/ss20100305091353.png

关于sharepoint - SPWorkflowActivationProperties.Item 在简单 SharePoint 工作流中为 NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2381327/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com