1

I am currently doing support on a SharePoint 2010 intranet.
A functionality has been implemented in a site allowing users to make holiday requests.
A user must fill in an InfoPath form to make an holiday request.
A record is added to a library when an holiday request is made.
And then a workflow is started.
One of the first action in the workflow is sending a mail to the requester's manager for validation.
Then the workflow waits until the manager's validation.

The client would like an alert mail to be sent automatically to the manager when he has not validated/refused a request after a certain number of days.
My first idea was to implement a program using the SharePoint object model and to execute the program as a Windows scheduled task.
But I am a workflow beginner and I am wondering whether it is possible to satisfy my client's need with worflow features.

Any help will be greatly appreciated.

4

2 回答 2

1

启动并行执行 - 类型并行,它将为您提供两个并行执行的块。

在其中一个区块中,您等待批准。

另一方面,您暂停到给定日期(建议:创建一个新的日期变量,将其设置为今天,然后添加必要数量的日期)。暂停后,发送提醒电子邮件。

替代解决方案:

您还可以阅读有关保留阶段的信息。如果您将电子邮件发送日期保存在列表项中,则可以使用信息管理策略来运行计时器作业...自第一封电子邮件发送后经过给定天数后,所述作业将启动另一个工作流程发送。在此工作流程中,您可以发送提醒电子邮件。

于 2013-05-03T21:26:34.587 回答
0

我对 SharePoint 工作流的经验是,您确实希望避免使用暂停,因为有时它们永远不会取消暂停(例如,看看这个)。相反,您需要设置一个每天运行的计时器作业,检查 Rehan 提到的日期变量,并在今天的日期等于您要发送电子邮件的日期时发送电子邮件(如果这是基于任务,您可以只使用创建日期):

DateTime createdDate = (DateTime)item["Created"];
string createdPlus7 = createdDate.AddDays(7).ToShortDateString();
string createdPlus14 = createdDate.AddDays(14).ToShortDateString();
if(DateTime.Today.ToShortDateString() == createdPlus7)
{
    Send7DayEmail();
} else if(DateTime.ToShortDateString() == createdPlus14)
{
    Send14DayEmail();
}

这可能是太多的铸造和重铸,但它应该给你一个开始。

于 2013-05-22T16:52:19.430 回答