Sharepoint学习笔记—习题系列--70-576习题解析 -(Q121-Q123)

Question  121
 You are designing a SharePoint 2010 workflow that will be used to monitor invoices. The workflow has the following requirements:
.Invoices may have a status of Submitted, Reviewed, Rejected, Returned for Revision, or Approved.
.Not every status applies to every invoice. You need to design the workflow to monitor the status of the invoices as they are processed. Which approach should you recommend?
A. Use Visio 2010 to create the workflow. Select the Set Workflow Status shape and configure it to execute when the status of an invoice changes.
B. Use Visio 2010 to create the workflow. Before each status action, add a Start shape to initiate the workflow action.
C. Use SharePoint Designer 2010 to create a reusable declarative workflow.
D. Use Visual Studio 2010 to create a state machine workflow.

解析:
 你设计一个Sharepoint2010工作流来监控收据清单,需要满足如下要求:
 要求1. 收据清单记录必须有提交,检查,拒绝,退回,修订以及同意等状态。
 要求2. 并非所有的收据清单都有上述的所有状态。你的工作流要能识别和判断出处理过程中清单的各种状态值。
  很明显本题用到状态机工作流,而此类工作流是基于事件驱动的,既然基于事件驱动,你就无法按预定义的方式创建它,换句话说,你必须要通过代码才能创建它,通过代码判断状态并进行相应的处理。在本题的所有备选项中,只有选项D即VS2010才支持代码开发。其它选项(通过Viso或SPD)均无法用来创建状态机工作流。
因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/gg508985(v=office.14).aspx
http://msdn.microsoft.com/en-us/vstudio/ff623023.aspx

 
Question  122
 You are designing a custom workflow for a SharePoint 2010 solution. You need to specify which type of workflow form to use. The requirements for the form are:
.Specify the main list, library, or content type that the workflow will affect.
.Provide a form to display the Add a New Workflow page.
.Provide the form where the administrator can specify settings common to all workflows, such as the workflow definition and initiation conditions, and whether the workflow runs on items or folders, or both. You need to specify which type of workflow form should be used for each phase of the workflow process to meet all these requirements. Which form should you recommend?
A. Association
B. Initiation
C. Modifications
D. Task


解析:
  你设计了一个Sharepoint2010工作流并需要确定此工作流应该使用哪种工作流表单以满足下面要求:
  要求1.需要确定此工作流应用到主要的列表,库与内容类型
  要求2.提供一个表单用于显示添加一个新工作流界面
  要求3.为管理人员确定针对所有工作流的通用设置信息提供表单。这些设置信息诸如:工作流定义,工作流初始化条件,工作流是否运行于列表项或文件夹或两者均可等等。
  你需要确定在工作流处理的哪个阶段使用哪种工作流表单以满足上述要求。
  本题涉及Sharepoint工作流表单相关知识:
  Sharepoint通过向工作流中添加表单,可以使工作流更加动态和灵活。表单使您能够在工作流生命中的预定义时间收集用户的信息,并可让用户与该工作流的任务进行交互。
  Sharepoint工作流表单有如下类型
1.关联(Association)和初始化表单(Initiation)   在任何工作流实际开始之前,将为用户显示关联和初始化表单以供其填写。可以使用这些表单让用户能够在工作流开始之前为其设置参数和其他信息。
   关联表单说明工作流如何应用于特定列表、库或内容类型【见本题要求1】;初始表单说明工作流如何应用于特定的 SharePoint 项目。
2.修改表单(Modifications)   修改是为用户显示的一些选项,以供其在针对某个项目运行工作流时更改此工作流。然后,可以创建使用户能够指定修改参数的修改表单。 
3.任务表单(Task)   也可以为工作流中的任务指定自定义表单。不过,由于任务是分配了内容类型的 SharePoint 项,因此实际上是由内容类型来决定用于任务类型的自定义表单。
  
因此本题答案应该选 A

参考 
http://msdn.microsoft.com/zh-cn/library/ms457061(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms481192(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms480794(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ms438856(v=office.14).aspx

 
Question  123
 You are designing a custom workflow for the Human Resources department. The workflow will add the business logic for hiring approval to a SharePoint 2010 Web application. The requirements specify that the workflow must:
.Be used to manage the hiring approvals for the employee new-hire lists on all department sites.
.Encapsulate all of the required business logic for the approval process.
.Make changes to list data that requires higher privileges than the user initiating the workflow might possess.
You need to design the workflow to meet all these requirements. Which approach should you recommend?
A. Add the business logic to an assembly and deploy it to the global assembly cache.
B. Add the business logic to an assembly and place it in the _app_bin directory of the Web application.
C. Add the business logic as a declarative workflow and run it using the SharePoint system account.
D. Create custom actions that specify the business logic and then add the actions to the Web application.

解析:
  你为人力资源部门创建一个工作流, 此工作流为允许雇用应聘人员添加新的商业逻辑并需要满足如下要求:
  要求1. 可用于管理各部门新聘雇员列表的允许雇用审批流程
  要求2. 封装了全部所需的商业逻辑到审批流程
  要求3. 对列表数据做修改需要比启动工作流更高的操作权限
  你该如何操作?
  根据题干描述, 此工作流为允许雇用应聘人员添加新的商业逻辑(实际就是各种工作流活动 Workflow Activity),这就意味着你不可以创建声明性工作流(declarative workflow)【选项C】。声明性工作流是在 Microsoft SharePoint Designer 中创建的,并保存为一个或多个 XOML 文件而不是编译的 C# 或 Microsoft Visual Basic 代码。然后,该工作流会以 SharePoint 解决方案包(.wsp 文件)的形式保存到网站的“网站资产”库中,可以下载该解决方案包,然后将其作为解决方案安装到任何网站集中。运行时,会将 XOML 标记转换为代码,并对其进行编译和执行,这种工作流无法让你添加新的商业逻辑进去。
   由于工作流的所谓商业逻辑多是通过创建工作流活动实现。当我们创建一个工作流活动后,要想使用,首先要部署到sharepoint上。通常我们将.actions文件copy到 14/template/1033/workflow文件夹下,然后将dll文件添加到GAC,最后在web.config文件中添加   

 <authorizedType Assembly="assemblyname,Version=1.0.0.0,Culture=netural,PublicKeyToken=*********" Namespace="namespace" TypeName='*' Authorized='True' />

    结点到configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes结点下.重启iis,在SPD2010中创建workflow的时候就可以使用这个activity。
    当我们想在多个farm上部署activity时,这是很麻烦的事,最好就是将activity打包成wsp格式进行部署.workflow activity打包成wsp文件需要在原工程(包括.actions文件以及dll文件)基础上添加feature.xml和manifest.xml件。
    所以,从以上描述我们知道,新创建的商业逻辑应该部署到GAC中【选项A】,至于选项B提到的_app_bin目录,通常不会把用户开发的程序集(包括Web Part)部署到这个目录下。而选项D的描述则试图把工作流活动添加到应用程序(而不是工作流)中,这显然是不对的。
因此本题答案应该选 A

参考 
http://msmvps.com/blogs/sundar_narasiman/archive/2010/12/26/develop-custom-workflow-activity-for-sharepoint-2010-workflow.aspx
http://msdn.microsoft.com/zh-cn/library/ms414613(v=office.14).aspx


 

posted @ 2014-01-18 04:20  wsdj  阅读(476)  评论(0编辑  收藏  举报