How to draw send signal action and accept event action in activity diagram?

0 votes
asked Sep 26, 2022 in Question / help by Zuza
edited Sep 26, 2022

Hi,

I wonder how how to draw send signal action and accept event action in activity diagram, like below?

 

Regards, Zuza

4 Answers

0 votes
answered Apr 30 by Marcelo

Hello,

The way of drawing is currently presented in the official PlantUML activity diagram beta documentation.

https://plantuml.com/activity-diagram-beta#7420c7766a064a28

There's an issue with respect to the direction of the AcceptEventAction representation, though.

For PlantUML contributors:

The official UML 2.5.1 specification describes the correct form (which would be compatible to strictuml skinparam). Please refer to Section 16.10.4 Notation, Figure 16.40 AcceptEventAction notations: "In general, it is notated with a concave pentagon symbol (see Figure 16.40, left)."

It would be "just" a matter of flipping the node horizontally. :)

commented May 4 by Marcelo
Should I report it as a bug in a separate thread?
0 votes
answered May 4 by Marcelo

(I hope I didn't post it already in another thread, sorry if I did)

While the AcceptEventAction itself is already available, there is also the wait time action (i.e., an AcceptEventAction with a single TimeEvent trigger), mentioned in this question: https://forum.plantuml.net/19247/support-interrupt-region-action-especially-accept-action (I cross-referenced it here). It is currently not available on PlantUML.

If the occurrence is a time event occurrence, the result value contains the time at which the occurrence transpired. Such an action is informally called a wait time action.

For PlantUML contributors:

From the official UML 2.5.1 specification: A wait time action (i.e., an AcceptEventAction with a single TimeEvent trigger) is notated with an hour glass symbol (see Figure 16.40, right).

--

While it is not officially implemented, here's the workaround I've been using, also including the original request on how to draw the other actions. Warning: since it's a ASCII sprite, it gets really ugly when scaled. :)

@startuml

'THE SIGNAL RECEIPT SHOULD BE FLIPPED HORIZONTALLY,
'I'M CURRENTLY FIXING IT IN AN IMAGE TEXT EDITOR

' AcceptTimeEventAction
sprite $acceptTimeEventAction [16x16/16] {
0000000000000000
FFFFFFFFFFFFFFFF
0FF0000000000FF0
00FF00000000FF00
000FF000000FF000
0000FF0000FF0000
00000FF00FF00000
000000FFFF000000
0000000FF0000000
000000FFFF000000
00000FF00FF00000
0000FF0000FF0000
000FF000000FF000
00FF00000000FF00
0FF0000000000FF0
FFFFFFFFFFFFFFFF
}


:Separate products;
:  <<signal sending>>\nRequest payment; <<output>>
:  <<signal receipt>>\nPayment confirmed; <<input>>
:Deliver product;

kill

<style>
  .acceptTimeEvent {
    LineColor: #FFFFFF
    BackgroundColor #FFFFFF
  }
</style>

:        <$acceptTimeEventAction{scale=2}>\nEnd of month; <<acceptTimeEvent>>

:Send order reports;

@enduml

I hope that helps. :)

0 votes
answered May 7 by The-Lu (85,440 points)

Hello Z., and M.,

I can make some proposals and a PR in order to manage this kind of shape.

Now, the main issue is: 

  • How to name the corresponding plantuml stereotypes?

Here are some proposals:

UML Shape Name Plantuml Stereotype Proposal
(on Activity diagram)
ObjectNode<<object>>
(already implemented)
ObjectNode
typed by signal
<<objectSignal>> or <<object-signal>>
AcceptEventAction
without TimeEvent trigger
<<acceptEvent>> or <<accept-event>>
AcceptEventAction
with TimeEvent trigger
<<timeEvent>> or <<time-event>>
SendSignalAction
SendObjectAction
with signal type
<<sendSignal>> or <<send-signal>>
Trigger<<trigger>>


- Do you agree?
- Or have you other proposals?

Perhaps we could also do a broader survey...

Regards,
Th.

0 votes
answered May 17 by The-Lu (85,440 points)

Hello Z., and M.,

With:

And with last snapshot, we can have all those new UML shapes:

Then here is a proposal for the first Activity Diagram:

@startuml

:Listen Shipment Request; <<Accept-Event>>
:Process Request;
:Request Pickup; <<Send-Signal>>
:Wait for Pickup; <<Accept-Event>>
:Arrange Delivey;
stop

@enduml

And for the `Time-event` also:

@startuml

:Separate products;
:  <<signal sending>>\nRequest payment; <<Send-Signal>>
:  <<trigger>>\nPayment confirmed; <<trigger>>
:Deliver product;
-[#transparent]->

:\t\t\t\tEnd of month; <<Time-Event>>
:Send order reports;

@enduml

Enjoy,
Feedback is welcome,
Regards,
Th.

commented Oct 8 by Marcelo
Oh, I lost this, sorry. I think I wasn't notified by e-mail, I'll double check later.

Sorry for not providing feedback about the stereotypes. UML uses the CamelCase pattern AFAIK, but I think it's best to keep consistency between these and other stereotypes. I know I'm late, so don't mind, just sharing my thoughts.

I saw the example rewritten and it's UML-standard-correct now. I cannot thank you enough for providing such flexibility! I also saw the discussions on GitHub. That's such a great work! Thank you!!
...