I'll investigate the job issue.
And yes, it is a new feature, bundled with the code generator and runtime. If you are eager to try it out, you can find it in an alternative update site:
The new feature is called "Umlrt SDK Feature". The code generator feature should be installed too, as it has some required updates.
I'm attaching pingpong.umlrt as an example, but beware that the generated code won't compile yet, as we still don't have a link to external libraries like the RTS library or the AnsiC library. I'm working on that.
* Usage:
- To activate it you just need to create or open a file with a '.umlrt' extension. It can be in any kind of project. The simplest is a general project.
- To be able to see the outline view, edit in the "Resource" perspective (The "Java" perspective could also work)
- The outline view is very useful to navigate the model and you can fold components that have subcomponents.
- You can also fold the text itself on the Editor by clicking on the (-) or (+) icons on the left margin.
- To generate code: right-click on any element in the outline view and select "UML-RT Generate Code"
- A syntax reference is at the end; the syntax is not space sensitive, but the editor helps with indentation.
- Some caveats:
. Ports and parts must be given a multiplicity.
. Transitions must have an action (even if empty); empty actions are written as "action code { source '' }"; this should be simplified in the future.
. Be careful: code-completion gives you all names but doesn't show them qualified, so if you have, for example a state S1 in some capsule C1 and also a state S1 in another capsule C2 and then you define a transition somewhere, you might get the wrong one, and at this point there is no scoping rules enforced. So code generation could fail. To avoid this, give unique names to everything. In the future this should be resolved.
* Remaining issues:
- No link to the UML-RT RTS model library
- No link to the Ansi C library
- No link to the RtCppProperties profile
- Textual-graphical synchronization (see below)
- No support yet for stand-alone from textual representation
* Synchronization between textual representation and graphical Papyrus representation is not there yet, but we plan working on it.
- We already have a UML2-to-xtUMLrt translator, and Xtext provides a serializer and formatter that can be adapted
- Developing an xtUMLrt-to-UML2 translator should not be too difficult.
- Generating the diagrams (.di and .notation) from a .uml is an unknown. Maybe there's already some support for that.
- On-the-fly synchronization might be tricky but it would be very interesting for the users.
* When Xtend 2.9 comes out, we'll be able to generate:
- Eclipse plugins
- IntelliJ IDEA plugins
- Web-based editor
- Standalone support
* In general the syntax is of the form:
- In the syntax below I use extended BNF notation, including these conventions:
. metavariables are written <metavariable> in italics sans serif
. concrete tokens are written bold fixed-width font
. <_expression_>? means 0 or 1 occurrence of <_expression_>
. <_expression_>* means 0 or more occurrences of <_expression_>
. <_expression_>+ means 1 or more occurrences of <_expression_>
The top element is a model:
model <name>
{
entities { <entities>+ }
protocols { <protocols>+ }
typedefs { <typedef>+ }
}
Entities are either capsules or classes:
- capsules:
capsule <name>
{
<ports>*
<parts>*
<connectors>*
<attributes>*
<operations>*
<behaviour>?
}
- classes:
class <name>
{
<attributes>*
<operations>*
<behaviour>?
}
- protocols:
protocol <name>
{
<message>+
}
- protocol messages:
<kind> message <name> ( <parameter>* ) ;
where <kind> is one of
in, out, inout
- attributes:
<visibility>? static? readonly? attribute <name> : <type> ([<lowerbound>.. <upperbound>])? (= <value>)? ;
where <visibility> is either public, private or protected.
- operations:
<visibility>? static? abstract? query? operation <name> ( <parameter>*) : <returntype> code { source '<source>' }
- parameter:
<kind> <name> : <typename>
- ports:
<visibility>? conjugate? notification? publish? wired? rtport <name>: <protocolname> [<lowerbound> .. <upperbound>] ;
For now, the multiplicity is mandatory.
- parts:
<kind>? part <name> : <capsulename> [<lowerbound> .. <upperbound>] ;
For now, the multiplicity is mandatory.
<kind> is one of: fixed, optional or plugin. The default is fixed.
- connectors:
connect <end1> to <end2> ;
where <end1> and <end2> are either <portname> or <partname>.<portname>
If the <portname> form is used, it must be a port in the capsule itself, either external or internal.
Note that port and part names can easily be confused as there is currently no validation, so it is strongly recommended to use unique names everywhere.
- behaviour:
statemachine <name>
{
top <state>
}
- simple states:
simple <name>
{
(entry <action>)?
(exit <action>)?
(entry points { <name> , ... , <name> })?
(exit points { <name> , ... , <name> })?
}
Note that even if the state has nothing inside, the braces are mandatory, e.g.: simple S {}
- composite states:
composite <name>
{
(entry <action>)?
(exit <action>)?
(entry points { <name> , ... , <name> })?
(exit points { <name> , ... , <name> })?
(initial <name>)?
(history <name>)?
(junction points { <name> , ... , <name> })?
(choice points { <name> , ... , <name> })?
(substates { <state> ... <state> })?
(transitions { <transition> ... <transition> })?
}
Note that even if the state has nothing inside, the braces are mandatory, e.g.: composite S {}
- transitions:
transition <name> from <sourceVertex> to <targetVertex>
(triggers { <trigger>+ })?
(<guard>)?
(<action>)? ;
Note that source and target vertices can easily be confused as there is currently no validation, so it is strongly recommended to use unique names everywhere.
- triggers:
on <message> from { <portname> , ... , <portname> }
- guards:
guard code <name> { source '<source>' }
- actions:
action code <name> { source '<source>' }
- source code is a string enclosed in either single quotes '<text>' or double quotes "<text>". Inside the text, quotes can be used, but they must be escaped, e.g.:
"log.log(\"A message\")"
To avoid such escaping, one can use the other type of quotes:
'log.log("A message")'
But if the code uses both kinds of quotes, escaping characters is unavoidable.
- comments:
/* any text */