Bug 531359 - [runtime] --controllers command-line option ignored in generated program
Summary: [runtime] --controllers command-line option ignored in generated program
Status: NEW
Alias: None
Product: Papyrus-rt
Classification: Modeling
Component: runtime (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Mac OS X
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-19 17:11 EST by Ernesto Posse CLA
Modified: 2018-02-20 09:08 EST (History)
1 user (show)

See Also:


Attachments
Sample model (8.63 KB, application/zip)
2018-02-19 17:11 EST, Ernesto Posse CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ernesto Posse CLA 2018-02-19 17:11:21 EST
Created attachment 272740 [details]
Sample model

In the generated executable there is a command-line option to specify an alternative "controller assignment" providing a <TopCapsuleName>.controllers file as described in the command-line help:

[-c <controllers-file>]  or [--controllers=<controllers-file>]  Specify a capsule-to-controller map file.

This option however, appears to be ignored. See the attached model. This model consists of three capsules Top, Capsule1 and Capsule2. Top has two parts capsule1:Capsule1 and capsule2:Capsule2. The model comes with a Top.controllers file with the following assignment:

Top = P
Top.capsule1 = Q
Top.capsule2 = R

Code is generated correctly, and produces the following correct output:

[-bash|vagrant@precise32:src] > ./TopMain 
Controller "Q" running.
Controller "R" running.
[Capsule2|capsule2|Top.capsule2|R]
[Capsule1|capsule1|Top.capsule1|Q]
Controller "P" running.
[Top|(no role)|Top|P]
^C

Now, if we copy Top.controllers to the same folder as the executable, and change it to the following:

Top = A
Top.capsule1 = B
Top.capsule2 = C

If we execute, *without rebuilding*, we would expect to obtain

[-bash|vagrant@precise32:src] > ./TopMain -c Top.controllers 
Controller "C" running.
Controller "B" running.
Controller "A" running.
[Capsule1|capsule1|Top.capsule1|B]
[Capsule2|capsule2|Top.capsule2|C]
[Top|(no role)|Top|A]
^C


But this is not the output we get. Instead we get:

[-bash|vagrant@precise32:src] > ./TopMain -c Top.controllers 
Controller "R" running.
Controller "Q" running.
Controller "P" running.
[Capsule1|capsule1|Top.capsule1|Q]
[Capsule2|capsule2|Top.capsule2|R]
[Top|(no role)|Top|P]
^C

So the new assignment is ignored.

Note that the names of the controllers have not changed according to the new assignment.