简体   繁体   中英

How to model the scope of a database transaction within an UML activity diagram?

I need to model a process, the required notation is an UML activity diagram.

An input file is read and for each line a database record would be batch-inserted, but only if all lines of the input file pass some validity checks. If any line violates the validation rules, the entire input file would be rejected.

This seems like a very common pattern, however, the only graphical way of modelling this seems to be modelling begin and end of the transaction as activities. 将事务的开始和结束建模为活动

Isn't there a way to do this more nicely? Is there a UML or SysML language element that corresponds to a looped transaction? The diagram is intended for a non-tech customer who would be very confused by the transaction activites.

Structured Activity Nodes have been around in UML (though I have to admit the completely passed my attention so far). The current 2.5 Spec says on p. 477:

Loop Nodex

A LoopNode is a StructuredActivityNode that represents an iterative loop. A LoopNode consists of a setupPart, a test and a bodyPart, which identify subsets of the ExecutableNodes contained in the LoopNode. Any ExecutableNode in the LoopNode must be included in the setupPart, test or bodyPart for the LoopNode.

On p. 478:

Notation

A StructuredActivityNode is notated with a dashed round cornered rectangle enclosing its nodes and edges, with the keyword «structured» at the top.

在此输入图像描述

No standard notation is defined for ConditionalNodes, LoopNodes or SequenceNodes.

Note the last sentence. The notation for this has been expanded in 2.5. But honestly I would not use it much here and look into BPMN instead, which is a UML based profile that has become more wide spread. I'd rather stay with basic UML notation like this unless you use BPMN:

在此输入图像描述

There are two activities Process File (to the left) and Process Line (as diagram frame to the right). The latter is used as invocation in the first activity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM