Author Topic: Activity element does not generate code  (Read 6190 times)

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Activity element does not generate code
« on: July 14, 2021, 02:36:26 pm »
Hi,
While generating code from Activity diagram, code is generated from an action element.
But if there is an activity element connected to a child diagram, no code is generated for the child diagram.
What could be the reason?
regards,

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Activity element does not generate code
« Reply #1 on: July 14, 2021, 06:02:26 pm »
Only actions create code. You might use the activity as call behavior which is an action classified by an activity.

q.

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #2 on: July 15, 2021, 12:47:13 am »
 :'(
That means the activity diagrams will be huge.

How about the conditional nodes?

thanks,

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2860
  • Karma: +49/-3
    • View Profile
Re: Activity element does not generate code
« Reply #3 on: July 15, 2021, 08:20:11 am »
:'(
That means the activity diagrams will be huge.

How about the conditional nodes?

thanks,

If I understand what you're saying, the diagrams will be the same size. Activities don't appear on Activity diagrams, so replace each Activity with a CallBehaviorAction that links to it (right-click > Advanced > Convert to Invocation)
The Sparx Team
support@sparxsystems.com

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #4 on: July 15, 2021, 03:01:59 pm »
But now I don't see add a child diagram, only child element, e.g. Expansion node.
Whereas, in a child diagram there can be a full blown sub routine.
regards,

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #5 on: July 19, 2021, 02:43:50 pm »
The purpose of purchasing the "unified" version of EA over "professional" was to get activity diagram coding.
But there seems to some limitations or "gotchas"!

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Activity element does not generate code
« Reply #6 on: July 19, 2021, 05:12:17 pm »
But now I don't see add a child diagram, only child element, e.g. Expansion node.
Whereas, in a child diagram there can be a full blown sub routine.
regards,
UML is not about diagraming. A diagram is what makes a model readable to humans. The value is in the model.

q.

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #7 on: July 19, 2021, 11:36:46 pm »
But now I don't see add a child diagram, only child element, e.g. Expansion node.
Whereas, in a child diagram there can be a full blown sub routine.
regards,
UML is not about diagraming. A diagram is what makes a model readable to humans. The value is in the model.

q.

Indeed, documentation is for humans. and I think UML is a great way to do it.
This thread is all about generating code.
To make just "pretty pictures" I have been using flowchart and then UML tools for nearly 2 decades.
I want to move onto generating the code also.
Just for documentation, there are far cheaper tools available.
Besides free tools, Visual Paradigm has a far more user friendly UI/ UX.
But it can only do upto generating code for a class diagram.
That is far simpler than code for operations (methods).

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2860
  • Karma: +49/-3
    • View Profile
Re: Activity element does not generate code
« Reply #8 on: July 20, 2021, 08:28:36 am »
But now I don't see add a child diagram, only child element, e.g. Expansion node.
Whereas, in a child diagram there can be a full blown sub routine.
regards,

Where are you looking? You don't add the child diagram to the action. You have an activity that defines the sub-routine on its composite diagram, and a call behavior action calls the activity.
The Sparx Team
support@sparxsystems.com

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #9 on: July 20, 2021, 02:21:42 pm »
Of course action cannot have a sub diagram.
I was referring to the sub diagram connected to an activity element.
Pl see my OP.
Not clear why do I again need a composite sub diagram for an activity element; a sub activity diagram should be sufficient. It is just for encapsulation of a chunk of actions related to one another.
E.g. check an opened file for a set of errors.
thanks,
« Last Edit: July 20, 2021, 02:32:18 pm by KalpakD »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2860
  • Karma: +49/-3
    • View Profile
Re: Activity element does not generate code
« Reply #10 on: July 20, 2021, 02:59:43 pm »
Not clear why do I again need a composite sub diagram for an activity element; a sub activity diagram should be sufficient.

Same thing
The Sparx Team
support@sparxsystems.com

KalpakD

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Activity element does not generate code
« Reply #11 on: July 20, 2021, 07:21:12 pm »
Same thing
The way I am doing it right is put in an activity element and right clicking to select a child diagram.
Is that the correct way?