HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

ThingML to Kevoree Java bug #70

Closed kgiannakakisATC closed 9 years ago

kgiannakakisATC commented 9 years ago

I am having this ThingML:

import "../Timer/Timer.thingml"

thing fragment NewsMsgs {
    message news_item(newsData : String);
}

thing Sender includes TimerClient, NewsMsgs {
    readonly property period : Integer = 10000
    provided port news
    {
        sends news_item
    }
    statechart behavior init Init {
        state Init {
            on entry do
                timer!timer_start(period)
            end
            transition -> Init
            event timer?timer_timeout

            action do
                news!news_item("hello")
            end
        }
    }
}
configuration Sender {
    instance sender : Sender
}

I create the plain Java and then the Kevoree Java. The following line is created:

final String msg = "{\"message\":\"news_item\",\"port\":\"news_c\", \"newsData\":\" + NewsMsgs_news_item_newsData__var.replace("\n", "\\n") + \"}";

This doesn't compile and needs to be manually edited to:

final String msg = "{\"message\":\"news_item\",\"port\":\"news_c\", \"newsData\":\" + NewsMsgs_news_item_newsData__var.replace(\"\\\n\", \"\\\\n\") + \"}";
brice-morin commented 9 years ago

OK, will fix that in a few minutes

brice-morin commented 9 years ago

Should be fixed now. You can update your HEADS IDE in 15 minutes or so.