2.2 SpecChange 规格变动
2.2.1 Situation 情景
A company requires approval from three departments, Automation, Manufacturing, and Quality,
for every specification change to its production system. When submitted, the specification
change should immediately appear in Automation's and Manufacturing's 'Inbox's for Approval.
However, the specification change should not appear in Quality's 'Inbox' until the other two
departments have approved it.
对于每个产品系统的规格修改,一个公司需要得到三个部门的批准,自动化,制造和
质量。当规格修改的请求被提交时,规格修改将立即出现在自动化和制造部门的收件箱中
等待批准。然而,规格修改不应该出现在质量部门收件箱中,直到其他两个部门批准它以
后。
To simplify this example, rejecting a specification change will not be required.
为了简化这个例子,不需要否决一个规格。(例子中没有考虑这种情况)
2.2.2 Preparation准备
2.2.2.1 Overview
1) If the PowerFolder Server has not been started, start it now.
如果PowerFolder服务器没有启动,那么启动它。
2) Log into the PowerFolder Console
登录进入PowerFolder控制台.
3) Undeploy all scripts and web pages
卸载所有脚本和页面.
4) Deploy the following script and web pages.
发布下面的脚本和页面
Script:
脚本
- SpecChange
Web Pages:
页面
- AutomationAppr
- AutomationView
- Login
- ManufactAppr
- ManufactView
- QualityAppr
- QualityView
- SubmitResponse
2.2.2.2 How-To怎样做
- Starting the PowerFolder Server. If you configured environment variable 'JAVA_HOME'
during installation, just double-click 'run_with_tomcat.bat' in Windows Explorer. Otherwise,
open a command console and make sure the environment variable 'JAVA_HOME' is set to base
directory of the Java installation. Start the PowerFolder server by going to the directory then go
to the 'jboss' subdirectory then again go to the 'bin' subdirectory. Run program
'run_with_tomcat.bat'.
启动PowerFolder服务器。如果你在安装时配置了环境变量JAVA_HOME,只要在资源
管理中双击run_with_tomcat.bat。否则的话,打开一个命令控制台,设计环境变量
JAVA_HOME到Java安装的根目录。要启动PowerFolder服务器,移动到安装目录,到
jboss子目录,到bin 子目录,运行程序run_with_tomcat.bat。
- Logging into the PowerFolder Console. Open a web browser and go to the address
'http://localhost:8080/powerfolder/login'. Enter 'admin' for the user name and password, and then
press 'Login'.
登录进入PowerFolder控制台:打开一个浏览器,到地址
'http://localhost:8080/powerfolder/login',输入admin作为用户名和口令,按下
Login按钮。
- Undeploying scripts and web pages. To undeploy scripts, from the PowerFolder Console open
'Administer' then open 'Scripts'. Check the boxes next to the scripts you want to undeploy under
the section 'Deployed Scripts' then click 'Remove Checked Scripts'. To undeploy web pages,
from the PowerFolder Console open 'Administer' then open 'Web Pages'. Check the boxes next
to the web pages you want to undeploy under the section 'Deployed Web Pages' then click
'Remove Checked Web Pages'.
卸载所有脚本和页面。为了卸载脚本,从PowerFolder控制台打开Administer,然后
打开Scripts.在'Deployed Scripts'部分,选中你想卸载的脚本前面的选择框,然后单
击'Remove Checked Scripts'。为了卸载页面,从PowerFolder控制台打开
Administer,接着打开Web Pages。在Deployed Web Pages部分选中你要卸在的页面,
然后单击'Remove Checked Web Pages'。
- Deploying scripts and web pages. To deploy scripts, from the PowerFolder Console open
'Administer' then open 'Scripts'. Check the boxes next to the scripts you want to deploy under the
section 'Available Scripts' then click 'Deploy Checked Scripts'. To deploy web pages, from the
PowerFolder Console open 'Administer' then open 'Web Pages'. Check the boxes next to the web
pages you want to deploy under the section 'Available Web Pages' then click 'Deploy Checked
Web Pages'.
发布脚本和页面。为了发布脚本,从PowerFolder控制台打开Administer,接着打开
Scripts.在Available Scripts部分选中你想发布的脚本,接着单击'Deploy Checked
Scripts'。为了发布Web页面,从Administer,接着打开Web Pages。从Available Web
Pages部分选中要发布的页面,接着单击'Deploy Checked Web Pages'。
2.2.3 Technical Overview技术概览
2.2.3.1 Diagram 流程图
2.2.3.2 Workflow Steps 工作流步骤
1) StartHere - this is where the process begins. Simultaneously ('branch') go to
'NotifyAutomation' and 'NotifyManufacturing'.
StartHere--这是流程开始的地方。同时(分支)移动到NotifyAutomation和
NotifyManufacturing
2) NotifyAutomation - tell Automation that it has a specification change to approve.
NotifyAutomation-告诉自动化部门它有一个规格修改待批准。
3) AutomationApproves - wait here until Automation approves. Once this wait has been
externally released (via web page), go to 'Notify Quality' only if 'ManufacturingApproves' has
finished first. Otherwise, go to 'StopHere' (end this 'branch').
AutomationApproves -在此处等待知道自动化部门批准。一旦这个等待被外部释放
(通过Web页面),如果ManufacturingApproves已经完成,那么移动到Notify
Quality,否则移动到StopHere(结束这个分支)
4) NotifyManufacturing - tell Manufacturing that is has a specification change to approve.
NotifyManufacturing--告诉制造部门有一个规格更改待批准
5) ManufacturingApproves - wait here until Manufacturing approves.
ManufacturingApproves--在制造部门同意之前在此等待
6) NotifyQuality - tell Quality that it has a specification change to approve.
NotifyQuality--告诉质量部门它有一个规格更改待批准
7) QualityApproves - wait here until Quality approves. Once this wait has been externally
released (via web page), print a message to indicate that all three departments have approved this
specification change.
QualityApproves—在质量部同意之前在此等待。一旦等待被外部释放(通过Web页
面),打印一个消息来指出三个部门都已经批准了规格的改变
8) StopHere - this is where the process ends.
StopHere—这是流程的结束点
2.2.3.3 User Interface 用户界面
1) AutomationAppr - approve all specification changes checked on the 'AutomationView' web
page.
批准在AutomationView网页上所有选中的规格修改
2) AutomationView - displays all specification changes requiring Automation's approval. In
other words, display all workflows waiting at the 'AutomationApproves' workflow state.
显示所有的需要自动化部门批准的规格修改。或者说,显示所有的等待在
AutomationApproves状态的工作流
3) Login - lets the user login as a member of any of the three departments. Also allows a user to
submit a new specification change.
让用户作为任意三个部门之一的成员来登录。同样也允许用户来提交一个新的规格修
改。
4) ManufactAppr - approve all specification changes checked on the 'ManufactView' web page.
批准所有在ManufactView页面选中的规格修改。
5) ManufactView - displays all specification changes requiring Manufacturing's approval. In
other words, display all workflows waiting at the 'ManufacturingApproves' workflow state.
显示所有的需要制造部门批准的规格修改。或者说,显示所有的等待在
ManufacturingApproves状态的工作流。
6) QualityAppr - approve all specification changes checked on the 'QualityView' web page.
批准所有在QualityView页面选中的规格修改。
7) QualityView - displays all specification changes requiring Quality's approval. In other words,
display all workflows waiting at the 'QualityApproves' workflow state.
显示所有的需要质量部门批准的规格修改。或者说,显示所有的等待在
QualityApproves状态的工作流。
8) SubmitResponse - response page that appears when a user submits a new specification change.
This is the page the starts the process.
当用户提交一个新的规格变化时的响应页面。这是启动流程的页面。
2.2.4 Usage 使用
1) Open a browser (preferably different than the on with PowerFolder Console) and go to
'http://localhost:8080/Login.jsp'. Note the '.jsp' - all web pages in PowerFolder end with '.jsp'
when deployed.
打开一个浏览器(与PowerFolder控制台分别打开比较好),到
'http://localhost:8080/StartPrint10Times.jsp'.页面,注意".jsp",在PowerFolder
中,所有的Web页面在发布以后都以jsp来结尾。
2) Click 'Manufacturing', you should not see any specification changes requiring approval.
单击Manufacturing,你不能看到任何需要批准的规格修改。
3) Click the back button on your browser and then click 'Automation', you should not see any
specification changes requiring approval.
在浏览器上单击back按钮,接着单击Automation,你不能看到任何需要批准的规格修
改。
4) Click the back button on your browser and then click 'Quality', you should not see any
specification changes requiring approval.
在浏览器上单击back按钮,接着单击Quality,你不能看到任何需要批准的规格修
改。
5) Click the back button on your browser and then enter 'This is a test' in the text area and click
'Submit Specification Change'.
在浏览器上单击back按钮,在文本区域输入This is a test,单击Submit
Specification Change。
6) Go look at the command console running 'run_with_tomcat.bat'. You should see a notification
to Manufacturing and Automation regarding the new specification change.
观看运行run_with_tomcat.bat的命令控制台。你可以看到一个给制造和质量的规格
变动通知。
7) Click the back button on your browser and then click 'Quality', you should still not see any
specification changes requiring approval.
在浏览器上单击back按钮,接着单击Quality,你不能看到任何需要批准的规格修
改。
8) Click the back button on your browser and then click 'Automation', you should see the
specification change. Check the box next to it and click 'Approve Specification Changes'.
在浏览器上单击back按钮,接着单击Automation,你可以看到规格编号。选择它附近
的选择框,单击Approve Specification Changes
9) Click the back button twice on your browser and then click 'Quality', you should still not see
any specification changes requiring approval. In addition, go look at the command console
running 'run_with_tomcat.bat'. You should not see a notification to Quality regarding the new
specification change.
在浏览器上单击back按钮,接着单击Quality,你仍然不能看到任何需要批准的规格
修改。另外,观看运行run_with_tomcat.bat'的命令行控制台。你不能看到一个根据新
的规格变化发给质量的通知。
10) Click the back button on your browser and then click 'Manufacturing', you should see the
specification change. Check the box next to it and click 'Approve Specification Changes'.
在浏览器上单击back按钮,接着单击Manufacturing,你可以看到规格编号。选择它
附近的选择框,单击Approve Specification Changes
11) Go look at the command console running 'run_with_tomcat.bat'. You should see a
notification to Quality regarding the new specification change.
观看运行run_with_tomcat.bat'的命令行控制台。你可以看到一个根据新的规格变化
发给质量的通知。
12) Click the back button twice on your browser and then click 'Quality', you should see the
specification change. Check the box next to it and click 'Approve Specification Changes'.
按back按钮两次,单击Quality.你可以看到规格变化。选择它附近的选择框,单击
Approve Specification Changes。
13) Go look at the command console running 'run_with_tomcat.bat'. You should see a general
notice stating that the process is complete (specification change approved).
观看运行run_with_tomcat.bat'的命令行控制台。你可以看到一个一般性通知声明流
程已经完成(规格修改被批准)。
2.2.5 Results结果
Go to the PowerFolder console and open 'Administer'. Under the 'Existing Workflows' section
click the 'Find Workflows' button.
移动到PowerFolder控制台,打开'Administer'.在'Existing Workflows'部分下,
单击'Find Workflows'按钮.
Now that you are at the 'PowerFolder Query Workflows' web page, change the contents of
'Query' to '*APP* = 'SpecChange'' (note that you should surround SpecChange with single
quotes) and 'Output' to '*ID*,*APP*,*STATUS*,?Change?' (pay attention to letter case and
don't use any spaces!), then click 'Submit'.
现在你处于 PowerFolder工作流查询页面,更改'Query'的内容为'*APP* =
'SpecChange''(注意你应当用单引号来环绕SpecChange)而且'Output'的内容为
'*ID*,*APP*,*STATUS*,?Change?',注意字符的大小写而且不要使用任何空格,然后单击
'Submit'(提交).
You should see just one listing - the workflow resulting from the test you just ran. The listing
should contain a unique id (each workflow gets its own), 'SpecChange' for the script name,
'DONE' for its status, and 'This is a test' for Change. 'Change' is an application-specific attribute -
an attribute specific to the 'SpecChange' script. Application-specific attributes are represented by
their name surrounded by '?'.
你应当仅仅看到一个列表—那个你刚刚运行的测试产生的工作流。列表中应当包括一
个唯一的序号(每个工作流都有它自己的),脚本名称是SpecChange,它的状态是DONE,
和This is a test作为Change.'Change'是应用特定的属性-一个特定于'SpecChange'脚
本的属性。应用特定的属性被用?号围绕来表示。
Now click the 'Snapshot' button. This will open a new window which will allow you to get much
more detail about the current state of this workflow.
现在单击'Snapshot'按钮。这样将打开一个新窗口,通过它你可以得到更多的关于这
个工作流的当前状态的细节信息。
Click 'Attributes' to see all system and script-specific attributes and their current values. Under
'Script' click 'View Graph' and 'View Summary' to get a nice pictorial and written summary of
the script. Click 'Trigger' to see the data that actually started the process. This data is the XML
element 'powerfolder' containing the test 'This is a test'. Finally, click 'History' and you should
see 'Trace 1' and 'Trace 2'. SpecChange 'branches' (goes in two directions simultaneously) at
'StartHere'. Only one branch reaches 'NotifyQuality', and it is the branch whose department
approves last. In this case, the branch containing 'ManufacturingApproves' should go to
'NotifyQuality' since Manufacturing was not the first department to approve.
单击'Attributes'来看所有的系统和脚本特定属性和它们的当前值。在Sript下单击
ViewGraph和View Summary来得到一个图形和文本书写的关于脚本的总结。单击Trigger
来看实际启动过程的数据。这个数据是包含This is a test的powerfolderXML元素.最
后,单击'History'你将看到Trace1和Trace2。在StartHere,流程SpecChange分支了
(同时走入了两个方向)。只有一个分支到达NotifyQuality,这是最后批准部门所在的
分支。在这个例子中包含ManufacturingApproves的分支应该到达NotifyQuality,因为
制造部门不是第一个批准的部门