2. Overview. ▫ UML for knowledge capture. ▫ Input to UML 2 Activities. ▫ UML 2
Activity elements. ▫ Systems engineering extensions.
UML 2 Activity Modeling for Domain Experts Conrad Bock NIST
[email protected]
1
Overview
UML for knowledge capture. Input to UML 2 Activities. UML 2 Activity elements. Systems engineering extensions.
2
UML For Domain Experts UML began as a language for domain experts to record their knowledge. Experts in electric motors design expressed concepts in diagrams, … … which automatically generated database table definitions. 3000% productivity improvement over informal textual descriptions.
“Model Driven Design,” Cocks, D., Dickerson, M., Oliver, D., Skipper, J., INCOSE INSIGHT, 7:2, July 2004.
3
UML For CIM/Analysis Computation-Independent Modeling = Analysis … … as in “Analysis and Design Task Force”. Early stages of software development capture end-user concepts (“analysis”) ... … before later stages choose how these are represented in software (“design”). Many diagrams shared between analysis and design (class, composition, behavior). 4
UML For System Engineering SE specifications are agnostic about how they are implemented, in organizations, hardware, or software. Capture domain expert requirements, rather than how they will be satisfied. Executable models for over 15 years. UML is increasingly the major modeling language used in SE and military architecture communities. UML Profile for SE submitted.
“Systems Modeling Language (SysML) Specification,” SysML Submission Team, http://doc.omg.org/ad/05-11-01, November 2005. “Systems Engineering in the Product Lifecycle,” Bock, C., International Journal of Product Development, 2:1-2, http://www.nist.gov/msidlibrary/doc/sysmlplm.pdf, 2005. 5 “UML Profile for DoDAF/MODAF (UPDM),” OMG, http://doc.omg.org/dtc/05-09-12, September 2005.
UML For Ontology Ontology languages becoming popular for expressing domain expert concepts. Enable automated consistency checking. UML has significant overlap with OL’s … … eg, classes, properties, subclasses, subproperties, disjointness, and others. Many aspects of OL’s are specialized kinds of constraints. UML Profile for RDFS and OWL submitted.
“Ontology Definition Metamodel,” IBM, Sandpiper, http://doc.omg.org/ad/2005-09-08, November 2005.
6
UML for Business Modeling Foundation concepts for BM – Things ( “classes”, “objects”, “entities”) • For documents, people, resources, etc.
– Structured/assembled things • For organizations, structured entities.
– Dynamics • For processes, collaboration, event monitoring.
Continuity with other UML-based knowledge capture, and with IT implementation.
Business Modeling with UML : Business Patterns at Work, Eriksson, H., Penkerbook, M., Wiley, January 2000.
7
UML for Process Knowledge UML includes three ways to express knowledge about dynamics … … each addressing different aspects: – Output to input dependencies (Activities) – Reaction to events (State Machines) – Message-passing (Interactions)
… but also overlapping: – Sequencing, conditionals, concurrency.
Virtual machines defined for execution. 8
Integrated Models Car
Structure
fa : Axle
front : Wheel : powers
: powers
(assembly, organization, interconnections)
os : AxleOutputShaft
: powers h : Hub
uj : UniversalJoint
t : Tire
: powers ms : MainAxleShaft
4. Function in Multi-exit Construct
Data 1
2. Multi-exit Function
Data 2 [ before third time ] External Input
External Output
1. Serial Function 5. Function in an Iterate
Accept_deposit
e l Data 5 s e ]
Amount Data 3
sd
Amount
[
example
6. Output Function
+
ob1:C1
Get Balance
ob3:C3
3. Function in Concurrency
ob4:C4
Data 4
opti() Set Balance
Account
alt
[x>0] create()
ob2:C2
foo(x)()
doit(z)()
doit(z)()
foo(x)()
[ else ]
bar(x)()
doit(w)()
doit(w)()
Activity / SM (tasks, process, orchestration)
bar(x)()
Activity / SM
more()
more() opti()
Interaction (messages, choreography, collaboration)
9
Integration with UML 1.5 Action / Procedure Model “Action Semantics”. Activities fully executable. Covers the full range of flow models from flow charts to code. More about this later.
OMG Unified Modeling Language Specification, OMG, Version 1.5, http://doc.omg.org/formal/03-03-01, September 2002.
10
More Than Pictures Repository provides – API’s – XML interchange – Support for multiple notations
UML notation stores to repository … and alternate notations can, too. Generate systems from repository: Notation ¼ Repository ¼ System 11
Repository-Centered Accept_deposit Amount Amount
Account
+ Get Balance
Set Balance
Amount function Accept_deposit (a : Account, d : Amount) { Amount nb = a.balance + d; a.balance = nb; return nb; }
Presentation
Parsing
Repository
Model compilation Actual system 12
Input to UML 2 Activities First workflow RFP discussion (HP, FileNet, NIST) SAP, Oracle, IBM EDOC, BPML, WPDL, BPEL (WSFL, XLANG), ebXML CaseWise, Odell and Associates, IntelliCorp. And others. 13
Example from SAP Not visible (no user interface), if multiple planned orders are converted into production orders
Opening / processing production order
Thread is started, iff parts missing
State! Production order is to be changed
Production order is created or changed
[prod. order was not planned (by this lot size) or external services are required]
Usually the planning of production orders should create the purchase req. for external material.
Production order is to be released Preliminary costing for production order
Release of production order
Purchase Requisition [ created ]
Event!
possible result of "Opening / processing production order"
[release is refused]
“Business Process Modeling & Workflow Definition with UML, Deficiencies & Actions to Improve,” Wiegert, O., http://doc.omg.org/ad/9804-04, April 1998.
[parts missing] [production order not to be carried out] production order is to be printed
Production order is (partially) released
printout of production order
production order is to be executed
Planned resources (parts, tools and human labor) are to be freed!
{ Material is not produced }
resulting state
[parts missing]
Backorder processing
Execution of production order { Material is produced }
It might be irrelevant (depending on the responsible person and not on the IT system) whether the backorder processing succeeds in getting the missing parts: Parts may still be missing when the execution of this production order is started. This execution may last for a week, or even longer. In between the missing parts may arrive or be produced.
resulting state
SAP AG 1998 O. Wiegert: BPM & WF Definition with UML
14 03/31/1998 / 14
Example from HP Start
ERR Load
ERR Load Re-do Timer
No action timer
ERR Load error Notify Approver Preapproval Decision
Notify no action No action Timer Check Notify
Submit error Timer Notify error Timer
Cancel Transaction Timer Cancel Timer
Submit for Approval
Cancel Service
Check Decision Service error Timer
Reject Service Approval Check Service
Service error
Check Cancel Handle Cancel error “HP EER Workflow Example,” Matheson. D., http://doc.omg.org/bom-00-01-06, January 2000.
Approval Decision Reject error Timer
Check Reject
Reject error
Notify Reject Notify Reject Timer Check Notify
15 End
Feature
U2P AM
CaseWise
BPML
EDOC
WPDL-XML
WSFL
XLANG
ebXML/ebTWG
General Graphical notation
Y
Y
Not yet
Nonnormative
N
Metamodel
Y
Not yet
Y
Y (not in UML)
XML - any
Y
N (not exportable anyway) N
Y
Y
Y
N (only for explanation in spec) N (but spec is written so that it could) Y
Human usable textual notation.
N
N
Y (XML)
Not yet
Y (tags not too complex)
Y (tags not too complex)
Y (XML)
Control/Data
Control/Data
Message
Data
Control (with parameters)
Message
Data and control on same diagram/model
Y (shown by usage in notation)
N
NA
NA
NA
Control/Data (message data only) NA (shown by solid/dotted in spec)
Business-specific features
N
Y (eg, location)
N
N
Y (eg, responsible party, manual activity, cost, etc)
N (but relates to WSDL)
N (but extends WSDL)
Y (stereotypes)
Activity - actor link
N (but has hook) N (but has hook) Y (well-nested, flowchart)
Y
Y
Y
Y
Y
Y
Y
N
N
Y
Y
N
N
Y
N
N
N
N
N
N
N
Y (a little for branching) N
N
N
N
N
N
N
Y
N (very little)
Y (wellnested, acyclic) Y (timing attributes) N (activities are atomic)
N
Y
Y
Y
N
N
Y
N
N
N
Objectflow "in the middle" model Explicit control constructs
Y
Y
N
N
N
N (uses a single message input/output) N
N
Y
N (guards for conditionals)
Y (uses message consumption for conditionals)
N (uses alternate output sets)
Y/N (part of invocation, guards)
N
Y (switch only, uses "Qname" for conditionals)
Y (UML 1.x semantics) Y (but often uses guards on transitions)
"else" functionality for conditionals Explicit merge construct
Y
N
N
NA
Y
N
N
Y
Y
N
N?
Y? (XOR enforced?)
N
N
Y
Optional inputs
N
N
N
N
N
N
N
Optional outputs
Y (part of asych outputs)
Y (in control only)
N
N (could use alternate input sets) Y (alternate input sets) Y (alternate output sets)
N
N
N
N
Alternative input/output sets Asynchronous inputs/outputs Fork/join functionality
N
N
Y
N
N
N
N
Y
Y (in control only) N
N
Y
N
N
N
N
Y
Y
Y (flexible join using named spawn)
Y
Y (part of invocation, guards)
Y (part of invocation, guards)
Y (wellnested only)
Y (but has semantic problems)
General Process Features Message or control/data flow model?
Activity - artifact link Simplified subsets of functionality defined Simulation-specific information Transaction model
Detailed Process Features Pin model
N
Y (UML 1.x activity graphs)
N
Y(Stereotypes of UML 1.x)
Y
Y (XMI, presumably) N
NA
Control/Data (UML 1.x activities) Y
16
Exclusive/complex join a
a
{a xor b}
b
Feature
{ F(a,b) }
b
U2P AM
CaseW ise
BPML
EDOC
W PDL-XML
W SFL
XLANG
ebXML/ebTW G
Exclusive join functionality
Y, (late flow s N ignored)
N
N
Y? (spec is Y (late flow s N ambiguous) ignored)
N
Complex joins
Y
N
N
N
N
N
Y
N
17
Error handling Handle Error
on cancel
U2P AM
CaseW ise
Y N (exception outputs)
BPML
EDOC
W PDL-XML
Y (compensation Y (exception N for completed outputs) activity called by an aborted activity)
W SFL
Y (as part of data)
XLANG
ebXML/ebTW G
Y (compensation Y for completed activity called by an aborted activity)
18
Asynchronous invocation
U2P AM
Y (for operations, signals, not subactivities)
a
b
c
x
y
z
CaseW ise
N
BPML
Y (implements N synch as tw o asych)
EDOC
W PDL-XML
W SFL
Y (for N subactivities only)
XLANG
ebXML/ebTW G
Y (W SDL Y operations)
19
Process instances Process Execution Process definition
Process instances
. . .
U2P AM
Y (structual features only, but extensible)
CaseW ise
N
BPML
N
EDOC
Y (scenario only)
W PDL-XML
N (but may N through interop standard)
W SFL
XLANG
ebXML/ebTW G
Y (identifier only, N w ith mapping to messages)
20
Activity Modeling Activity modeling emphasizes the output/input dependencies, sequencing, and conditions for coordinating other behaviors. Uses secondary constructs to show which classifiers are responsible for those behaviors. Focus is on what tasks need to be done, with what inputs, in what order, rather than who/what performs each task. 21
Activity Modeling Tasks and ordering …
Receive Order
Fill Order
Close Order
Ship Order
[order accepted]
Send Invoice
Invoice
Make Payment
Accept Payment
22
Activity Modeling
Acctg Department Customer
Order Department
«attribute» performingDept: Department» «external»
… plus resource assignments.
Receive Order
Fill Order
Ship Order
Close Order
[order accepted]
Accept Payment
Send Invoice Invoice Make Payment
Partition (notation is called a “swimlane”)
23
Activity Elements Receive Order
Fill Order
Close Order
Ship Order
[order accepted]
Send Invoice
Invoice
Make Payment
Accept Payment
Object Node (queuing outputs and inputs)
Action (uses of other activities / tasks)
Edge/Flow (execution dependencies)
Control Node (routing control and 24 objects)
“Flow” semantics Receive Order
Fill Order
Close Order
Ship Order
[order accepted]
Send Invoice
(
Invoice
Make Payment
Accept Payment
not UML notation)
Activity execution defined in terms of flow of control and objects/data. 25
Actions and Object Nodes Accept inputs, start behaviors, provide outputs. Send Invoice
Make Payment
Invoice Invoice2345 : Invoice
Invoice2345 : Invoice
Action starts when input arrives. Output provided when action is complete.
Accept Payment
Sequencing: control “flows” when action is complete. 26
Actions and Object Nodes Alternate object node notation (pin). Make Payment
Send Invoice Invoice2345 : Invoice
Invoice2345 : Invoice
Accept Payment
No pins for control (usually).
Action accepts values arriving at pin. Action provides values to output pin. Must use this notation if the output type is different than the input type. The underlying repository stores pins.
27
Queuing Machine Part
Polish Part
Package Part
Tokens can – stack up in “in/out” boxes – backup in network – prevent upstream behaviors from taking new inputs
Applicable to systems with significant resource constraints, such as physical or manual processes. 28
Queuing Machine Part
Polish Part
Part Machine Part
Test Part
Tokens can be – Stored temporarily – Divided between flows
Tokens cannot – Flow in more than one direction, unless copied. 29
Activity Parameter Nodes Accept_deposit Amount Amount
Account
+ Get Balance
Set Balance
Activity Parameter Node (uses of objects/data, a kind of object node)
Parameter nodes accept and provide values to/from whatever behavior uses this activity. 30
Streaming Parameters Values accepted and provided while action is executing. Generate { stream } Leads
Lead { stream }
Process Leads
Inputs Outputs Outputs accepted provided provided Inputs Inputs Outputs accepted accepted provided
Executing Not Executing 31
Time
Exception Parameters Outputs that are exclusive of others, and aborts the activity.
32
Parameter Sets Parameters accepting input or providing output exclusive of each other (for each execution).
33
Control Nodes Route objects/data At beginning and end of activity: Initial Node
Activity Final Flow Final
Gets control when containing activity starts. Flows out immediately.
Accepts input, aborts containing activity. Accepts input, does nothing. 34
Control Nodes Route objects/data In middle of activity: Decision Merge
Flows out in exactly one direction. Flows through immediately. Does not combine the tokens.
Fork
Copies inflow to multiple multiple outflows.
Join
Flows out when all inflows arrive. Combine tokens when 35 possible.
Interruptible Region Flows abort region.
Interrupting Edge
Request Cancel
Receive Order
Fill Order
Cancel Order
Close Order
Ship Order
[order accepted]
Send Invoice
Invoice
Make Payment
Accept Payment
Interruptible Region 36
Reentrant Activities No token interaction. For domains without resource constraint, such as computation. Amount function update_account (a : Account, d : Amount) { Amount nb = a.balance + d; a.balance = nb; send_notice (a.customer, a, nb); return nb; } 37
Reentrant Activities update_account Amount Deposit
Account
+
Get Balance
Get Customer
Set Balance
Send Notice
38
Time Model Can be used to state constraints on processes: Close Doors
Move Elevator
< 2 sec
39
First-class Behavior Model Object-orientation not required to model dynamics … … but supported when needed. Flexibility in using/not using: – Behaviors owned by objects. – Messages and Polymorphism
Integrate with OO for: – Relating internal execution to exchanges with between partners. – Transformation to implementation
40
First-class Behavior Model POEmployee sortMail()
Deliver Mail Check Out Truck
Keys
Put Mail In Boxes
deliverMail()
Deliver Mail resource
HowLong : Time
0..1
Truck 1
Abort() 41
Full Action Model Kinds of actions include: – Invoking behaviors/functions. – Creating/destroying objects. – Getting/setting property values. – Structured nodes (conditionals, etc). – Exception handling.
For fully-executable models and simulations. 42
SE Extensions Control as Data – Enabling and disabling control values. – Output from activities to turn other behaviors “on” and “off”.
Rate of flow, on edges and streaming parameters. Reduce buffering – Overwrite values already in buffer – Turn off buffering
Probability on decisions, parameter sets, competing outflows from object node. 43 Behavior decomposition.
Rate and Buffer Reduction «controlOperator»
{ rate < 1 per 10 minutes }
Monitor Temperature
Heat Air ControlValue { stream }
«controlOperator»
Monitor Temperature
[ above threshold ]
«ValueSpecificationAction»
enable Measure Temperature
ControlValue
{ stream } Temperature
«ValueSpecificationAction»
[ else ]
disable
{ stream }
Measure Temperature Receive Temperature
Receive Humidity
«continuous»
Temperature { rate = 1 per second }
«noBuffer» Calculate Feels-like Temperature
Humidity
Temperature { stream }
44
Activity Decomposition «activity»
Maintain Temperature maintainTemperature [1..1] monitorTemperature [0..1]
maintainTemperature [1..1] heating [0..1]
«activity»
«activity»
Monitor Temperature
Heat Air
monitorTemperature [1..1] calculateTraction [0..1] «activity»
Measure Temperature
«activity»
Monitor Temperature monitorTemperature [0..1] temperature [0..*] «class»
Temperature
monitorTemperature [0..1] humidity [0..*] «class»
Humidity 45
Validation Systems Engineering – UML 2 developed completely separately from SE … – … SE execution semantics matched UML 2 activities almost exactly.
High-throughput data flow applications – Concurrent/pipeline hybrid. – Optimized concurrent flow rate. – Used for coordinating networks and business applications in telecom and financial applications.
46
More Information UML 2 specification: http://doc.omg.org/formal/05-07-04 UML 2 Activity articles: http://www.conradbock.org/#UML2.0 SysML submission: http://doc.omg.org/ad/05-11-01
47