Author Topic: Activity Diagram Code Generation  (Read 2686 times)

Yel

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Activity Diagram Code Generation
« on: May 20, 2016, 11:36:18 am »
I need help regarding the source code generation.

We plan to generate source automatically from Activity diagram using EA.
In the FAQ, it is stated that Enterprise Architect can Generate Source Code from Behavioral Diagrams such as Activity diagram.
But I am having a hard time figuring out how to generate source code from Activity Diagram.
Can you please help me or please teach me the procedure on how to generate source code from the activity diagram?

A step by Step procedure will be greatly appreciated.

Hoping for your reply.

Thank you and God bless
« Last Edit: May 20, 2016, 12:44:21 pm by Yel »

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6215
  • Karma: +49/-5
    • View Profile
Re: Activity Diagram Code Generation
« Reply #1 on: May 23, 2016, 09:00:39 am »
  • Check your license type for 'Executable Code Generation from Behavioral Models' at http://sparxsystems.com/products/ea/compare-editions.html
  • Create a Class element
  • Create an Activity nested under the class
  • Create an activity diagram under that activity
  • Model your activity there
  • Generate code from the class
Simon

support@sparxsystems.com

Yel

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Activity Diagram Code Generation
« Reply #2 on: May 23, 2016, 01:14:11 pm »
Thanks for your answer.....

Now I know.... and... our EA liscense is only professional and does not do the  'Executable Code Generation from Behavioral Models'

so we can't do the UML to Code :(

But we can though with class diagram reverse enginneering (code to diagram(

Do you know any other options to do this kind of problem?

Yel

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Activity Diagram Code Generation
« Reply #3 on: May 24, 2016, 06:19:41 pm »
Hello again... I manage to get a trial version of EA Ultimate.... I would like to ask

How to:
- Create an Activity nested under the class
- Create an activity diagram under that activity
- Model your activity there

I have really no idea.... thank you

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2441
  • Karma: +29/-2
    • View Profile
Re: Activity Diagram Code Generation
« Reply #4 on: May 25, 2016, 09:19:14 am »
Right-click a class in the project browser and select "Add > Activity > with Activity Diagram".
The Sparx Team
support@sparxsystems.com

Yel

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Activity Diagram Code Generation
« Reply #5 on: May 31, 2016, 01:03:44 pm »
Hello

I have done the Right-click a class in the project browser and select "Add > Activity > with Activity Diagram".

But still no output.... Please refer to the image... am i doing incorrect diagram or settings that i may have missed.
Please teach me.

Thank you


Yel

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Activity Diagram Code Generation
« Reply #6 on: June 03, 2016, 03:48:06 pm »
I manage to do code generation.

But when I'm doing the IF ELSE IF ELSE statement... it does not output correctly.

Example: [START]→ [DECISION1]→ (YES)
                                                     → [NO]→ [DECISION2]→ (YES)
                                                                                        → [NO]→ [DECISION3]→ (YES)
                                                                                                                           → [NO]→ [END]

With that my interpretation of the output would be
if (DECISION)
{
      YES
}
else if (DECISION]
{
      YES
}
else if (DECISION3)
{
      YES

}
else
{

}

but output of code generation is not right.
Output for this sample is Decision1 Yes only.
No if statement in the code.

Please help me