UML 2 Activity Modeling - Conradbock.org

5 downloads 1143 Views 246KB Size Report
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