0

currently i am trying to design an executable activity where a logical component send a request to several other logical components to start initialization. The usual way in activity diagram is to create for each block a swimline. But, as the number of LCs are high in this case the diagram will be extremely big and also later its modification will be a hurdle.

In programming, the solution to this problem is polymorphism where the objects are casted as the mother class and pushed into a vector and then within the loop the abstract function of the mother class is called.

I wonder if there is any similar solution to this problem in sysml or not?

I tried to assign one swimline to the all the LCs which recevie the request but it seems each swimline can only be assigned to a block.

1 Answers1

0

Yes, there is a similar solution. Actually, it is even easier. Just let the ActivtyPartition represent a property with a multiplicity greater than 1. Any InvocationAction in this partition will then mean a concurrent invocation on all instances held in this property.

The UML specification says about this:

section 15.6.3.1 Activity Partitions

If the Property holds more than one value, the invocations are treated as if they were made concurrently on each value and the invocation does not complete until all the concurrent instances of it complete.

Typical InvocationActions are CallActions and SendSignalActions. So, you could call the initialize() operation in a partition representing the property myLogicalComponents:LC[1..*].

If you don't already have defined such a property, you can derive it, by making it a derived union and then define all existing properties with components to be initialized as subsets of it:

/myLogicalComponents:LC[1..*]{union}
LC1:LC {subsets myLogicalComponents}
LC2:LC {subsets myLogicalComponents}

Of course, this assumes, that all your logical components are specializing LC, so that they all inherit and redefine the initialize() operation.

In SysML you also have AllocateActivityPartitions. No clear semantics is described for it, so I think you are better served with the UML ActivityPartitions, which are also included in SysML.

Axel Scheithauer
  • 2,758
  • 5
  • 13
  • Hello Axel, thanks a lot for your reply. It seems that at least there is a solution, but i cannot realize it in Rhapsody. I wonder if you can give more hints how this solution can be realized for activity diagrams in Rhapsody? – Hossein Apr 08 '22 at 09:26
  • My Rhapsody Version is expired, so I can't test it myself. You say, a swimlane can only represent a Block. If that is the case, Rhapsody is not following the standard. Any named element can be represented by a swimlane. So, it should be possible to let it represent `myLogicalComponents`. What does it even mean, when it represents a block? Which instance of the block is being adressed by this? Bear in mind, that there may be many instances, but only those in a certain subsystem should be initialized. – Axel Scheithauer Apr 08 '22 at 14:10
  • Another possiblity is to send an init-signal to a port and connect all components to this port. The signal will be forwared to all of them. Of course, another question is, whether a simulation will use this information. That really depends on the tool. Do you plan to simulate the activity? – Axel Scheithauer Apr 08 '22 at 14:10