Author Topic: Simulating ObjectFlow on Activity Diagram  (Read 4876 times)

PDC

  • EA User
  • **
  • Posts: 109
  • Karma: +4/-0
  • Systems Engineer
    • View Profile
Simulating ObjectFlow on Activity Diagram
« on: March 07, 2023, 11:12:32 pm »
Hi all. I've searched this forum and others but can't find the answer to this question. I'm sure it's something simple that someone can explain to me!

I'm trying to run some simple Activity Diagrams in EA16.1.1625 using the 'Simulate' function.
When I hit 'Start', I can see the AD execute each Action in turn when they are linked by ControlFlows, but whenever it gets to an ObjectFlow the simulation simply ends. The 'Simulation' pane logs "Simulation Ended". This happens regardless of whether or not I use ActionPins.

Is it as simple as I need to actually define the Object that will pass over the ObjectFlow, and then it will be able to simulate the ObjectFlow? (It sounds like the obvious answer, but I thought I wouldn't need to do that because an ObjectFlow is semantically also a ControlFlow, so I hoped it might effectively pass a 'null' object and continue...).

Thanks for any answers :)
Phil

PDC

  • EA User
  • **
  • Posts: 109
  • Karma: +4/-0
  • Systems Engineer
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #1 on: March 13, 2023, 10:21:03 pm »
Hi again. is anybody able to advise on this? Please let me know if the question is unclear.
Phil

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #2 on: March 13, 2023, 10:39:06 pm »
Hi again. is anybody able to advise on this? Please let me know if the question is unclear.
Hi,  I haven't been active recently.
I'm not a UML Simulation guru, but I believe you can't transfer control via an object flow - hence why your simulation is terminating there.

The UML gurus can correct me, but I believe a COntrol flow will allow objects to flow over it, but the reverse is not true.  That's why you have two types.

If you ask ChatGPT, "[UML, can objects flow along a control flow"
;) , you'll get more or less that answer.

HTH,
Paolo
« Last Edit: March 13, 2023, 10:41:39 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

PDC

  • EA User
  • **
  • Posts: 109
  • Karma: +4/-0
  • Systems Engineer
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #3 on: March 13, 2023, 11:23:15 pm »
Thanks for your reply Paulo, much appreciated.
I've gone back to the UML spec and the EA guidance and I think I'd missed the subtlety that control is not passed along ObjectFlow transitions.
Seems to me then that the simplest approach would be to model my Activity using only ControlFlows (to get the sequence of events right in the simulation) and worry about ObjectFlows afterwards, in terms of trying to show when an Object is received or sent by a specific Action.

Thanks again for your answer, you're pointing me in the right direction!
Phil

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #4 on: March 14, 2023, 12:07:22 am »
ontrol is not passed along ObjectFlow transitions
Well, no. A token is passed along ObjectFlow like in ControlFlow, though it's a special one. It well controls the flow of events. That is, when you send something along an ObjectFlow the receiver will accept that and if it has not other incoming edges it will start working.

q.

PDC

  • EA User
  • **
  • Posts: 109
  • Karma: +4/-0
  • Systems Engineer
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #5 on: March 14, 2023, 12:32:58 am »
Well, no. A token is passed along ObjectFlow like in ControlFlow, though it's a special one. It well controls the flow of events. That is, when you send something along an ObjectFlow the receiver will accept that and if it has not other incoming edges it will start working.

q.

Thanks for the reply! But I think I'm now back to where I started! :) What you describe was my original expectation for ObjectFlow - that I could use them to control events as well as passing the 'object'.
This is the bit I can't work out in EA though. I have an AD with 2 Actions connected using an ObjectFlow between ActionPins embedded on the Actions. When the simulation reaches these nodes, it simply stops. So I guess that maybe I need to set up some local objects/variables somehow so that they (and the control token) can be passed from one Action to the next via the ObjectFlow. Am I getting warm..?

Thanks again for your help!
Phil

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #6 on: March 14, 2023, 03:00:08 am »
Well, maybe. I only once used the statemachine simulation and found it easier to go through it in my mind. I would guess that in case of the AD simulation ObjectFlow might not be handled the right way by EA. At least that would not surprise me. Maybe a Sparxian will tell me I'm wrong. Otherwise you are free to send a bug report. I would not put much hope in seeing any progress there in a near future.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #7 on: March 14, 2023, 10:04:18 am »
I'm trying to run some simple Activity Diagrams in EA16.1.1625 using the 'Simulate' function.
When I hit 'Start', I can see the AD execute each Action in turn when they are linked by ControlFlows, but whenever it gets to an ObjectFlow the simulation simply ends. The 'Simulation' pane logs "Simulation Ended". This happens regardless of whether or not I use ActionPins.
I suspect it's just an EA limitation, but I'm not sure of the exact model you're attempting to simulate.

What I can say from UML 2.5.1 is:
  • The description for ObjectFlow says that the object tokens traversing it "may hold values".
  • The class ObjectNode (which is both the source and target for any ObjectFlows) has an attribute isControlType, which says that the ObjectNode is to be treated as a control value that could have traversed a ControlFlow.

The UML gurus can correct me, but I believe a COntrol flow will allow objects to flow over it, but the reverse is not true.  That's why you have two types.

If you ask ChatGPT, "[UML, can objects flow along a control flow" [/size][/font] ;) , you'll get more or less that answer.
From what I'm reading, you've reversed what can happen. An ObjectFlow can have control sent over it (which appears to be what the OP asked) but a ControlFlow can't have an object flowing over it.

PDC

  • EA User
  • **
  • Posts: 109
  • Karma: +4/-0
  • Systems Engineer
    • View Profile
Re: Simulating ObjectFlow on Activity Diagram
« Reply #8 on: March 15, 2023, 08:50:41 pm »
Well, maybe. I only once used the statemachine simulation and found it easier to go through it in my mind. I would guess that in case of the AD simulation ObjectFlow might not be handled the right way by EA. At least that would not surprise me. Maybe a Sparxian will tell me I'm wrong. Otherwise you are free to send a bug report. I would not put much hope in seeing any progress there in a near future.

q.

Yes, I guess that is entirely possible. I may have only joined this forum recently but I've been using EA for a few years and am familiar with people ex-posing corner-case limitations like this. It doesn't put me off, I think EA is a great tool for the price. And if I run into one of these 'limitations' it's not usually a big problem for me technically, it's just good to know so that I can stop working on the assumption that I've made a mistake myself :D really appreciate your responses, thanks.

Quote from: Eve

Thanks for the reply. It's just a simple Activity Diagram - though nobody has checked it so I sort of assumed I could well have done something wrong.
I agree with your summary from the UML spec - I expected that ObjectFlow would pass control too (and could pass a 'null' value Object with that control token). I noticed that the ActionPins have a 'Control' Boolean property, but setting this to 'True' didn't allow EA to simulate the flow. Interestingly (to me) ObjectFlow connectors do NOT have a 'Control' property, which is perhaps how 'Control' should be specified for elements classified under ObjectNode, as we have alluded to in this discussion. Maybe that's the feature to request in order to add this functionality to EA.
« Last Edit: March 15, 2023, 08:53:22 pm by PDC »
Phil