OCUP 2 Intermediate · OMG · StateMachines & Use Cases · Bank updated 2026-11-03
OCUP 2 Intermediate practice questions: StateMachines & Use Cases
5 free questions from 49 on this area · answer and explanation for each · no sign-up
These 5 questions come from the StateMachines & Use Cases section of our OCUP 2 Intermediate bank (49 questions on this area, which carries 13% of the real exam). Every question is original, with the correct answer explained and linked to the source it is drawn from.
Free: 6 questions in study mode, no card. All 49 StateMachines & Use Cases questions and the full OCUP 2 Intermediate bank: $15 one-time.
1/5 · StateMachines & Use Cases
Composite state Online has a transition disconnect / closeAll() to state Offline. Its active substate Uploading has a transition disconnect / pauseUpload() to state Paused, which is also inside Online. Neither transition has a guard, and Online has a single region. Which transition fires when a disconnect event is dispatched?
AOnline's transition: closeAll() runs, and Offline becomes active
BUploading's transition: pauseUpload() runs, and Paused becomes active
CBoth in one step: closeAll() runs first, then Uploading's pauseUpload()
DEither one of them; UML leaves the choice of Offline or Paused undefined
Answer: B. Subclause 14.2.3.9.3 (PDF p. 359) says two transitions conflict when the sets of states they exit intersect, and that only transitions in mutually orthogonal regions may fire simultaneously. Subclause 14.2.3.9.4 (PDF p. 359) defines priority by source state: a transition originating from a substate has higher priority than a conflicting transition originating from any of its containing states, so the selection algorithm (14.2.3.9.5, PDF pp. 359-360) picks Uploading's transition.
Source: OMG UML 2.5.1 specification
2/5 · StateMachines & Use Cases
A modeler gives state Streaming the behaviors entry / openPort(), do / pump() and exit / closePort(). The signal tick triggers an internal transition of Streaming with the effect count(); the signal reset triggers an external self-transition of Streaming with the effect clear(). While pump() is still running, tick is dispatched, and some time later reset is dispatched. What does UML 2.5.1 imply for pump()?
Atick and reset both abort pump(), which starts again once the effect of that transition has completed.
Btick and reset both leave pump() running, since the active state does not change in either case.
Ctick leaves pump() running; reset aborts it before closePort() runs and starts it again after openPort() completes.
Dtick leaves pump() running; reset runs closePort() first, then aborts pump(), and starts it again after openPort() completes.
Answer: C. The execution of a doActivity is not affected by the firing of an internal transition, and an internal transition executes no exit or entry behavior, so tick leaves pump() running. An external self-transition exits and re-enters the State, because every transition except internal and local ones exits its source and enters its target (14.2.3.9.6). On exit, a doActivity that is still executing is aborted before the exit behavior commences (14.2.3.4.6), so pump() ends before closePort() runs. After the effect clear() the State is entered again, openPort() runs, and the doActivity commences once the entry behavior has completed. Source: OMG UML 2.5.1 (formal/17-12-05), clause 14.2.3.4.3, p. 351
Source: OMG UML 2.5.1 specification
3/5 · StateMachines & Use Cases
A reviewer inspects a ProtocolStateMachine owned by class Printer. Which of the following cannot be defined in it according to UML 2.5.1?
AOrthogonal regions expressing a protocol with several simultaneously active states
BA doActivity behavior that starts when a protocol state is entered
CA submachine state used to factorize a complex protocol
DA guard on a protocol transition acting as the pre-condition
Answer: B. Behavioral state machine features such as compound transitions, submachines and orthogonal regions can also be used in ProtocolStateMachines, but the States of a ProtocolStateMachine cannot have defined entry, exit, or doActivity Behaviors.
Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 14.4.3.1, p. 384
Source: OMG UML 2.5.1 specification
4/5 · StateMachines & Use Cases · hard
Composite state Diagnostics has a single region with the substates Quick and Full. The region has no initial pseudostate and no history pseudostate. A transition from Idle terminates on the outer edge of Diagnostics. What does UML 2.5.1 prescribe for this default activation?
AThe substate drawn first in the region becomes active as the default entry point
BNo one approach is defined; the model may be ill defined or the state treated as a leaf
CThe most recently active substate is restored, or the first-declared substate on a first visit
DThe transition is disabled and its triggering event occurrence is deferred in the event pool
Answer: B. With default activation and no initial Pseudostate, UML 2.5.1 defines no specific approach (14.2.3.2). One option is to deem the model ill defined; another is to leave the Region inactive so the composite State is treated as a simple (leaf) State (14.2.3.4.5).
Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 14.2.3.2 Regions, p. 349
Source: OMG UML 2.5.1 specification
5/5 · StateMachines & Use Cases
State machine Order has the orthogonal composite state Fulfilment with the regions Billing and Shipping. Both regions contain a state named Pending. A guard on a transition inside Shipping must be true only while Billing is in its Pending state. Which guard form does UML 2.5.1 support for this?
A[in Order::Fulfilment::Pending]
B[in Fulfilment::Shipping::Pending]
C[in Fulfilment::Billing::Pending]
D[in Billing::Pending::Fulfilment]
Answer: C. A guard constraint may test orthogonal states of the current state machine, written like "in State1". When the same state name occurs in different regions, the name can be fully qualified by the containing states and regions, producing a pathname. Qualifying with Billing selects the intended Pending.
Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 14.2.3.8.3, p. 356-357
Source: OMG UML 2.5.1 specification
Other OCUP 2 Intermediate areas
The same kind of free sample for every other section of the OCUP 2 Intermediate bank:
Practise OCUP 2 Intermediate with instant feedback
6 free questions in study mode · no card · full OCUP 2 Intermediate bank with area filters and the error log: $15 one-time · no dumps, no ads.
Start OCUP 2 Intermediate free →
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by OMG. OCUP 2 Intermediate and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official OMG materials (as of October 2026); always confirm current details with the vendor before booking.