WSS 3.0 工作流程 - 如何从连接列表中获取数据

发布于 2024-08-04 00:03:25 字数 964 浏览 4 评论 0原文

我在使用连接列表的 WSS 3.0 工作流程时遇到问题。描述如下:

我正在创建一个简单的工作假期请求/预订应用程序。这仅供内部部门使用,以便员工可以预订年假并获得各自经理的授权。

为此,我有两个列表:第一个列表称为“员工”,包含人员的姓名、电子邮件地址和经理姓名。经理姓名由同一列表中的下拉菜单填充。

第二个列表称为 HolidayRequest,包含姓名字段(基于员工列表的下拉列表)、开始日期和结束日期。

当向 HolidayRequest 列表添加新条目时,我想触发一个工作流程,该工作流程将向该人的经理发送电子邮件以通知他们进行批准。我遇到的问题是将经理的姓名和电子邮件地址纳入工作流程。我看到的问题是,此信息是通过联接列表获取的:

       HolidayRequest                          Staff
StartDate, EndDate, Name  ----------------->   Name, EmailAddress, Manager
                                                 /\                   |
                                                  |                   |
                                                  +-------------------+  

所以我需要的是工作流使用 HolidayRequest 中的 Name 字段,在 Staff 列表中找到相同姓名的记录,然后获取从该记录中获取经理的姓名,获取经理的员工记录,从而获取经理的电子邮件地址。这并不完全是火箭科学,但我只是无法在工作流程中弄清楚它(使用 Sharepoint Designer)。

我想第一个问题是工作流程是否是正确的工具,其次如果是,那么有没有办法实现我需要的东西?

感谢您的阅读。

I am having problems with WSS 3.0 Workflow using joined lists. Here is the description:

I am creating a simple work-holiday request/booking app. This is just for internal department use so that staff can book annual leave and have it authorised by their respective manager.

To that end, I have two lists: The first list is called 'Staff' and contains the person's name, email address, and manager name. The manager name is populated by a drop-down on the same list.

The second list is called HolidayRequest and has fields for name (a drop-down based on the staff list), start date and end date.

When ever a new entry is made to the HolidayRequest list I want to trigger a workflow that will send an email to that person's manager to notify them for approval. The problem I have is getting the manager's name and email address into workflow. The problem as I see it is that this information is obtained through a joined list:

       HolidayRequest                          Staff
StartDate, EndDate, Name  ----------------->   Name, EmailAddress, Manager
                                                 /\                   |
                                                  |                   |
                                                  +-------------------+  

So what I need is for the workflow to use the Name field from HolidayRequest, to locate the record for the same name in the Staff list, and then get the manager's name from that record, get the manager staff record and thereby the manager's email address. Its not exactly rocket-science, but I just can't figure it out in workflow (using Sharepoint Designer).

I guess the first question is whether workflow is the correct tool for this, and secondly if it is, then is there a way I can achieve what I need?

Thanks for reading.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与酒说心事 2024-08-11 00:03:25

好吧,事实证明我走在正确的轨道上(正如我所想的),但还没有完全理解工作流的查找方式。答案如下:

假设您有两个列表“HolidayRequest”和“Staff”。 HolidayRequest 包含“Name”(在员工列表中查找)、StartDate 和 EndDate 字段。员工列表包含“姓名”、“电子邮件”和“经理”(这是对员工列表的查找 - 引用回同一列表但不同的记录)。

因为它涉及双重查找,所以有必要创建一个工作流变量来存储中间结果。因此,我创建了 Variable:ManagerName 来存储第一次查找中的经理姓名,然后使用它作为第二次查找的密钥来提取经理的电子邮件地址。

我最终弄清楚工作流查找的关键是了解它如何进行连接 - 说实话,我认为 SPD 中的“定义工作流查找”不是很清楚。 DWL 有两个部分 - 第一个部分的标题为“查找详细信息”,在这里您可以告诉它数据的来源(源列表和该列表中的字段),第二部分的标题为“查找列表项” (这是我出错的地方)-您使用它来创建两个列表之间的链接。条目“Field”是您告诉它数据源列表中的字段的位置(例如,Staff:Name),“Value”条目是您从其他列表中给出相应字段的位置(因此,“在我的示例中为变量:ManagerName”)。

因此,现在,当收到新的假期请求时,工作流程使用假日请求中的名称作为对员工列表的查找,从员工列表中提取经理姓名,然后使用该名称对员工列表进行第二次查找 - 这次为经理 - 并提取电子邮件地址。

完美的。

现在我可以使用该电子邮件地址请求经理批准或拒绝该请求。

Well, it turns out that I was on the right track (as I thought) but hadn't quite got my head around the way that Workflow does it's lookups. Here is the answer:

Suppose that you have two lists "HolidayRequest" and "Staff". The HolidayRequest has fields for "Name" (which is a lookup on the Staff list), StartDate, and EndDate. The Staff list has "Name", "Email", and "Manager" (which is a lookup on the Staff list - a reference back to the same list but to a different record).

Because it involves a double lookup it is necessary to create a Workflow Variable to store the intermediate result. So I created Variable:ManagerName to store the manager name from the first lookup and then used that as my key for the second lookup to extract the email address for the manager.

My key to finally figuring the workflow lookup was to understand how it does the join - and to be honest I don't think that the "Define Workflow Lookup" in SPD is very clear. The DWL has two sections - one titled "Lookup Details" and here you tell it where you want the data to come from (a Source list, and a field in that list), and the second section is titled "Find the List Item" (this is where I was going wrong) - you use this to create the link between the two lists. The entry "Field" is where you tell it the field in the Data Source list (so Staff:Name, for my example), and the entry for "Value" is where you give the corresponding field from the other list (so, "Variable:ManagerName" in my example).

So now, when a new Holiday Request is received the workflow uses the name from the HolidayRequest as a lookup into the Staff list, extracts the manager name from the staff list and then uses that to do a second lookup on the staff list - this time for the manager - and extracts the email address.

Perfect.

Now I can use that email address to request the manager to authorise, or reject, the request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文