Author Topic: Code generation from activity diagram does not consider object flows  (Read 211 times)

m.hommen

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hi,

I am trying to generate (C++)code from a very simple activity diagram but the object flow is not considered at all in the generated code.
Below is the link to the diagram (right mouse click / show graphic).


Or the diagram described with words:

My activity "Activity" has 3 integer in parameter "a", "b", "c" and one return parameter "ret"
My activity "Activity" contains to call behaviour action "sumP1" and "sumP2".
The set operation for sumP1 and sumP2 is int Class1::sum (int d, int e).
The return value of the action sumP1 and sumP2 should be via actionPin "target".
Activity.a is connected to sumP1.d
Activity.b is connected to sumP1.e
sumP1.target is connected to sumP2.d
Activity.c is connected to sumP2.e
sumP2.target is connected to Activity.ret
via Object flows


I would have expected something like this:

Code: [Select]
int  Class1::Activity(int c,int b,int a)
{
   // behavior is a Activity
   int tmp = sum(a, b);
   return sum(tmp, c);
}

but I got this generated:

Code: [Select]
void Class1::Activity(int c,int b,int a)
{
   // behavior is a Activity
   sum();
   sum();
}

I know that the ea example model does generate code from an activity diagram but they don't pass parameters (from activity to action, nor form  action to action) along, so it does not answer my question.

What am I doing wrong?
Or should it simply not be possible to generate meaningful code from an ea activty diagram?

thanks in advance

 
« Last Edit: March 21, 2019, 11:09:58 pm by m.hommen »

jfzouain

  • EA User
  • **
  • Posts: 124
  • Karma: +4/-1
    • View Profile
Re: Code generation from activity diagram does not consider object flows
« Reply #1 on: March 21, 2019, 05:16:22 am »
Hi

Can you please share your diagram, to see it and see where is the problem.
Best regards

Jose Zouain

qwerty

  • EA Guru
  • *****
  • Posts: 10582
  • Karma: +232/-191
  • I'm no guru at all
    • View Profile
Re: Code generation from activity diagram does not consider object flows
« Reply #2 on: March 21, 2019, 06:12:08 am »
You need to place the picture on a public server and use the link. This is a 20th century BB.

q.