Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: KalpakD on July 14, 2021, 02:36:26 pm

Title: Activity element does not generate code
Post by: KalpakD 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,
Title: Re: Activity element does not generate code
Post by: qwerty 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.
Title: Re: Activity element does not generate code
Post by: KalpakD on July 15, 2021, 12:47:13 am
 :'(
That means the activity diagrams will be huge.

How about the conditional nodes?

thanks,
Title: Re: Activity element does not generate code
Post by: KP 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)
Title: Re: Activity element does not generate code
Post by: KalpakD 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,
Title: Re: Activity element does not generate code
Post by: KalpakD 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"!
Title: Re: Activity element does not generate code
Post by: qwerty 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.
Title: Re: Activity element does not generate code
Post by: KalpakD 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).
Title: Re: Activity element does not generate code
Post by: KP 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.
Title: Re: Activity element does not generate code
Post by: KalpakD 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,
Title: Re: Activity element does not generate code
Post by: KP 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
Title: Re: Activity element does not generate code
Post by: KalpakD 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?