2008年8月21日星期四

BPMSuite_002:使用Oracle BPM Studio 10gR3 流程建模

开发工具:Oracle BPM Studio 10.3.0.0。
运行环境:Oracle BPM Studio 10.3.0.0 + Oracle Database 10g Express Edition。
实验目的:通过亲自动手操作,更好地理解XPDL,掌握XPDL。

实验1. 实验内容介绍


实验2. 创建业务流程
1. Interactive Activity Property 介绍
(1) Runtime
Suspendable
Specifies if you can suspend a process instance sitting in this activity. When you suspend a process instance, the process execution engine ignores its due transitions and the process deadline. When you resume the process instance, the process execution engine recalculates due transitions and process deadlines, adding the time it spent suspended.
User Selects Transition
Specifies if the user can decide which transition to follow. The user can choose from a list of all the transitions that apply to the current process instance.
If you enable this property, the process designer allows you to add multiple unconditional transitions to an Interactive activity.
Auto Complete
Specifies if the instance flows to the next activity immediately after the user executes the mandatory main task or non read-only task.
Abortable
Specifies if the user can eliminate instances from the process. When you eliminate a process instance it flows directly to the end of the process.
Assignable
Specifies if the user can assign the instance in this activity to another user. According to the permissions and categories granted to the user, the following assignment operations are available:
Reassign
Peer assign
Escalate
Delegate
Advanced
In the Advanced section, you can configure the following properties for an Interactive activity.
Property

Description
Unlimited Concurrent Executions
Specifies if the amount of instances that can sit in an Interactive activity at a given time is unlimited.
Number of Concurrent Executions
Specifies the number of instances that can sit at the Interactive activity at a given time. If the number of instances exceeds this limit, the remaining instances are queued.
Generate Events
Specifies if running this activity generates events. The information in the audit trail and BAM tables is based on these events. Possible values are:
Default
Generate events
Do not generate events
Specifies if you can suspend a process instance sitting in this activity. When you suspend a process instance, the process execution engine ignores its due transitions and the process deadline. When you resume the process instance, the process execution engine recalculates due transitions and process deadlines, adding the time it spent suspended.
User Selects Transition
Specifies if the user can decide which transition to follow. The user can choose from a list of all the transitions that apply to the current process instance.
If you enable this property, the process designer allows you to add multiple unconditional transitions to an Interactive activity.
Auto Complete
Specifies if the instance flows to the next activity immediately after the user executes the mandatory main task or non read-only task.
Abortable
Specifies if the user can eliminate instances from the process. When you eliminate a process instance it flows directly to the end of the process.
Assignable
Specifies if the user can assign the instance in this activity to another user. According to the permissions and categories granted to the user, the following assignment operations are available:
Reassign
Peer assign
Escalate
Delegate

附加作业1:After checking the credit, shipping clerks should ship the order.
提示:在“Check Credit”Activity后面增加“Ship Order”Activity。

附加作业2:If the customer is not extended credit terms, it has been decided to simply terminatethe order in this version of the process.
提示:在“Check Credit”Activity后面增加条件Transition“Failed Credit Check”。

附加作业3:If the customer is not paying using credit (P.O. or FOB 30), there is no need to checkthe credit.
提示:修改“Check Freight”Activity到“Check Credit”Activity的无条件Transition为条件Transition“Credit Order”。
同时增加一条“Check Freight”Activity到“Ship Order”Activity的无条件Transition。

实验3. 变量与映射


附加作业1:New orders sometimes come in with a freight charge. Is it necessary to change to the process to allow this information to be stored?
提示:不需要。

实验4. 定义组织结构
需要掌握的要点:
1. Organizational Units 可以定义层级式的组织结构,如不同的地区和部门。

Once the organizational units have been defined, participants may be assigned to one of the organizational units in the hierarchy. Processes can be deployed for one of the organizational units defined so that only participants in that organizational unit and in lower levels within the hierarchy are able to perform tasks in a process.
2. Role定义不同的用户职能。
3. Group是不同Role的聚合,Group可以嵌套。
4. Participants可以属于不同的Organizational Units、Role、Group。

实验5. 激活流程

实验6. 使用工作平台
附件的download功能有问题,会在下一版本中修正。

实验7. 仿真

注:绿色方块中的数字表示正在处理的实例数,红色方块中的数字表示等待处理的实例数。

Decision Activity 的用途
Decision activities allow you to decide the next action to take based on statistics that show you how this situation was solved in the past.
The following is a typical example of the use of a Decision activity: You can classify car insurance policies into low, medium or high risk based on certain variables. The age of the insured, the geographic area and the model of the car are some of the variables that determine the risk. You can model this classification with a Decision activity. After some time the system learns and suggest the most appropriate answer for each new insurance policy you need to evaluate.

实验8. 屏幕流
Screenflows help developers create the flow of forms or presentations interactions for a given interactive activity.

Process变量与ScreenFlow参数的映射关系:

注意,Screenflows并不能自动获得主调流程Process的Context,也就是说,要想获取Process的实例变量必须通过参数传递到Screenflows中来,并通过传出参数修改Process实例变量。
图中上部分在Process中的order变量和下部分在Screenflows中的order变量,虽然名称相同,但并不是同一个变量,二者的变量范围也不同,二者没有直接关系。

课堂答疑:What's the Difference between Process Activities andScreenflow Tasks?
Screenflow tasks are typically lower level and usually associated to specific Userinteractions with the end user like showing a form page. It is very common tosee tasks named:
• “List Customers”
• “Pick Customer from List”
• “Detail Claim”
• “Update Remarks Field”
Process activities are more business oriented higher level actions and you seethem named:
• “Update Customer”
• “Deny Claim”
• “Verify Provider”
• “Check Credit Score”
The other obvious difference is that the many steps (tasks) in a Screenflow constitute the tasks that occur during the execution of a single Process activity.
教材说明 Task8-6 P171 是修改 Check Inventory 活动的Main Task 也为屏幕流Review the Order Screens。注意,这里需要重新设置参数映射关系(因为不同的活动使用相同的屏幕流需要重新设置参数映射关系)。

附加作业1:The customer needs to see the Order BPM Object’s Order Informationpresentation when creating an order. Create a screenflow that does this. Use thepresentation Order_Information in your screenflow.
提示:把Create Order活动的实现方式设置为屏幕流,并创建相应的屏幕流Create Order Screens。

附加作业2:shown below, it has been decided to show a more meaningful description forinstances in the WorkSpace. Make a change to the process so that end users see the description shown below based on the order number.
提示:修改Begin活动的In参数Description="Order: " + orderArg.number。
附加作业3:Run an instance through the process. Set its status to “Backorder Product(s)”.
提示:设置Backorder Product(s)条件分支的条件为:order.status == "Backorder Product(s)"。

实验9. 动态业务规则

实验10. 分支与合并活动
附加作业1:In the Check Credit activity there is currently no way for the Finance Clerk to set acredit status. This is needed to add the logic for the conditional transition called“Failed Credit Check” shown below.
提示:
(1)为Order对象增加creditStatus属性。
(2)在Check Credit活动中,设置代码 activitycreditStatus = "Failed"。(仅仅用于测试目的)
(3)修改 “Failed Credit Check”条件分支条件。
(4)修改Join活动,增加order.creditStatus = copy.order.creditStatus;。

实验11. 子流程

提示:别忘为用户添加Freight Clertk角色,否则无法看到子流程“Marine Supply Freight Calculator Process”。

附加作业1:The called subprocess has an Interactive activity Calculate Freight. When usingthe Workspace, determine why you cannot see instances that reach this activity and theyappear to be lost.
提示:用查询方式可以看到。

附加作业2:Add a display statement in the activity Ship Product to display the freight charge.Note that the freight charge is not being passed to the Ship Product activity. Determinewhy this value seems to be lost.
提示:修改Join活动的代码,增加
case "CalculateFreightCost":
order.freightCharge = copy.order.freightCharge;
break;

实验12. 仪表板

实验13. 抓取流程实例

实验14. 异步子流程

实验15. 调用Java

实验过程中常见问题

问题1:安装Oracle BPM Studio 10gR3的硬件需求?
• 2 GB RAM
• 4 GB
• 1.8 GHz CPU

问题2. 如何修改Studio使用的JVM ?
打开文件 /eclipse/eclipse.ini,
增加参数
-vm C:\Java\JDK\1.6\bin\javaw.exe
修改参数
-Xbootclasspath/a:C:\Java\JDK\1.6\lib\ext\tools.jar

问题3. 如何修改Studio的语言环境
英文:eclipse.exe -nl en_US
中文:eclipse.exe -nl zh_CN

问题4. 如何修改泳道的布局方式(水平/垂直)?
选择Project,右键选择Project Preferences,选择Processes,修改Lane Layout。

问题5. Process和Procedure的区别?
Process中可以包含人工Activity和自动Activity。
Procedure只包含自动Activity,因此只能由一个单独的participant来执行。
一个Procedure可供多个Process使用。

问题6. Screenflows和Sub-processes的区别?
Screenflows 表示流程Process中一个单独的任务,该任务中的所有步骤(屏幕流)是由一个单独的participant来完成的。
这也就是为什么在设计Screenflows时,没有角色泳道可供选择。
并且由于Screenflows主要用来表示人机交互,因此也没有message wait/wait notification activity, no process creation activity等等。
Subprocess本身也是一个流程Process,具有流程的所有特征,只不过当它被别的流程调用时,我们称之为子流程。
两者的共同点是它们都能通过参数映射,传入主调流程Process的实例变量。

问题7. OR Split活动和AND Split活动的区别?


如图所示,OR Split和AND Split的区别有两点:
1. 通过默认途径(unconditional transition )"Review Order"的条件是其它途径都无法通过(conditional transitions evaluate false)
2. 有且只有一条默认途径从Or Split活动出来。

没有评论: