doc-filesestPractice_第1页
doc-filesestPractice_第2页
doc-filesestPractice_第3页
doc-filesestPractice_第4页
doc-filesestPractice_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Change Activity Custom Workflow Assignments Best PracticeName: Change Activity Custom Workflow AssignmentsBy: Bob LachChange History:DateAuthorDescription12/21/2012Bob LachInitial version.1. Best Practice Name and Classification1.1 NameChange Activity Custom Workflow Assignments Best Practice1.2 Cla

2、ssificationsLow level customization.2. Objective2.1 Problem StatementNeed to customize the change activity workflow template so that rework activities are assigned to the users that actually completed the original activities, rather than simply being reassigned to the whole team.2.2 BackgroundThe Wi

3、ndchill out-of-the-box (OOTB) change activity workflow template will assign rework activities to all users specified in the “Assignee” role, regardless of which user(s) actually completed the original assignment. While this is appropriate for a general OOTB workflow template, it may not serve the ne

4、eds of customers who assign groups of people to change activities and allow anyone in the group to complete the task. In this case it may be desirable to assign rework activity to the person who actually did the original task so they can quickly correct the work, rather than assign it to the whole g

5、roup where someone unfamiliar with the original work may pick it up. In addition, a customer may wish to use a different team role for rework activities, such as a “Rework Assignee”.2.3 Scope/Applicability/AssumptionsThis document assumes familiarity with workflow processes for change objects and wo

6、rkflow customization. The techniques described in this document are limited to change object workflow templates.2.4 Intended OutcomeAssume a case where a change task is created with three assigned participants using the OOTB Change Activity Workflow template. When the change task is first created it

7、s process page will show the following.If User 2 actually takes on the task and completes it, then the Tasks for Change Process table will be updated to show the completed work task and a review task.If a problem is found during review, and the task is sent for rework, then a new rework task will be

8、 created for each of the original assignees. Any one of them may now accept the rework task.Creating rework tasks for all original team members may run contrary to a companys standard change process. For example, a change process may dictate that only User 2, who originally performed the work, shoul

9、d be assigned to a special “rework” role. And further, User 2 should be the only person assigned to a rework task. The desired process page should show the following. This is only possible by manually editing the process when using the OOTB Change Activity Workflow template. A customized template is

10、 needed to automatically follow this change process.3. Solution3.1 Solution StatementCustomize the Change Activity Workflow template to automatically determine who completed a work task and assign only that person (or persons) to the rework role.3.2 Prerequisite knowledgeTo apply this best practice,

11、 you need to have an understanding of the following: Workflow Processes for Change Objects Workflow Template Administration and Customization Life Cycle Template Administration and Customization Object Initialization Rules Administration and Customization Enumerated Type Customization Basic Java pro

12、grammingThe See Also section below includes references to many or all of these subjects.4. Customization Points4.1 Create Custom Rework RoleUse the enumCustomize tool to add a new rework role to ject.RoleRB.rbInfo. See the Windchill Customizers Guide for instructions on using this tool. Custom

13、 role “Rework Assignee” will be used in this document. This step can be skipped if a new role is not needed.4.2 Customize Change Activity Workflow Template1) Select Workflow Template Administration from Utilities page of Site, Organization, Product or Library context. 2) Select the “Save As” action

14、for “Change Activity Workflow” template to create a copy for customization. Select suitable name for the customized workflow (e.g., “Custom Change Activity Workflow”) will be used in this document. Always copy a workflow template before changing it; always avoid customizing an OOTB workflow template

15、.3) Select the “Edit” action for “Custom Change Activity Workflow” template and the change activity workflow graph is displayed in Workflow Template Editor. The area of interest for this customization is the rework loop, located in the upper-right portion.4) Double-click on the “Rework Change Notice

16、 Task” to open the editor and select the “Participants” tab. Add the “Rework Assignee” role and remove the “Assignee” role. This step can be skipped if a new role is not needed.5) Create a new expression step in the workflow between the “Set State Implementation” and “Rework Change Notice Task” step

17、s, and name it something meaningful, such as “Set Rework Assignee”. 6) Add Java code to the “Set Rework Assignee” step to automatically obtain the user(s) that completed the prior work task and assign them to the change item team for the rework task. See section 5 for a description of helper methods

18、 that can be called here.Example:ject.Role reworkRole = ject.Role.toRole(REWORK_ASSIGNEE);ject.Role participantsRole = reworkRole;java.util.Map roleToParticipantMap;/ Try to get participants from the rework activity.roleToParticipantMap = com.ptc.windchill.pdmlink.change.server.imp

19、l.WorkflowProcessHelper.getActivityParticipants( (wt.change2.VersionableChangeItem) primaryBusinessObject, Rework Change Notice Task);/ If the map is null then the rework activity has not executed yet.if (roleToParticipantMap = null) participantsRole = ject.Role.toRole(ASSIGNEE); / Try to get

20、participants from the original activity. roleToParticipantMap = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.getActivityParticipants( (wt.change2.VersionableChangeItem) primaryBusinessObject, Complete Change Notice Task);/ Assign participants from original or rework activity to

21、 the rework role on the change team./ By doing so only those participants will get the next rework tasks.wt.fc.collections.WTSet participants = roleToParticipantMap.get(participantsRole);com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setChangeItemParticipants( (wt.change2.Version

22、ableChangeItem) primaryBusinessObject, reworkRole, participants);7) When Java code is complete select the “Check Syntax” button to check for errors. Be sure to correct all errors before using the custom workflow template.8) Save the changes made to the “Custom Change Activity Workflow” template and

23、check it in.4.3 Customize Change Activity Life CycleCreate a custom “Change Activity Life Cycle” template using the Life Cycle Template Administration utility. Specify the custom workflow template created in the previous section:4.4 Customize Change Activity Object Initialization RuleCreate a custom

24、 “Change Activity” object initialization rule (OIR) using the template using the Object Initialization Rules Administration utility. Specify the custom life cycle template created in the previous section:5. Java Helper MethodsSeveral Java helper methods are provided to simplify the code for automati

25、cally making rework assignments (see code Java above). These methods are located in class:com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper5.1 Helper Method getActivityParticipants/* * Get participants of a completed work activity for a change item. If the work activity was * execut

26、ed multiple times (e.g., a rework activity was run several times), then only the * participants from the latest completed execution are returned. * * Supported API: true * * param changeItem Work flow primary business object. * param activityName Work flow activity name. * * return Map of activity r

27、oles to the participants for that role, or null if an * activity with the specified name has not been executed for the change item. * * throws WTException */public static Map getActivityParticipants(VersionableChangeItem changeItem,String activityName) throws WTException5.2 Helper Method getChangeItemParticipants/* * Get all participants of a change item team. * * Supported API: true * *

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论