SysML to Java code

413 views
Skip to first unread message

Bender

unread,
Apr 20, 2011, 8:54:30 PM4/20/11
to SysML Forum
Hi,
I'm modelling my SysML model system on Topcased(4.3.0) and I would
like to translate this on Java code, it's possible?

Best regards,

Bender

FAUDOU Raphael

unread,
Apr 21, 2011, 2:39:01 AM4/21/11
to sysml...@googlegroups.com
Hi Bender,

I have forwarded your question to Topcased user list, which is more appropriate for this kind of question (tool oriented).
Regards
raphaël

-----Message d'origine-----
De : sysml...@googlegroups.com [mailto:sysml...@googlegroups.com] De la part de Bender
Envoyé : jeudi 21 avril 2011 02:55
À : SysML Forum
Objet : [SysML Forum] SysML to Java code

Best regards,

Bender

--
You received this message because you are subscribed to the Google
Groups "SysML Forum" group.
Public website: http://www.SysMLforum.com
To post to this group, send email to sysml...@googlegroups.com
To unsubscribe from this group, send email to
sysmlforum+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sysmlforum?hl=en_US?hl=en

________________________________


Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

Dragos DOBRE

unread,
Apr 21, 2011, 4:52:18 AM4/21/11
to sysml...@googlegroups.com
Hello,

I think that would be possible. As UML profile, it should be possible
to transform a SysML model into executable code. I think that Topcased
has UML to Java generator.

For example, we use IBM Rational Rhapsody to build SysML models and we
verify these models by executing the State Machine Diagrams and
Sequence Diagrams. This tool is generating C++ code from the State
Machine Diagrams (the behavior of the system) and, with Harmony
methodology, the transformation allows to visualize this behavior on a
Sequence Diagram. Besides, you can access the generated code.

Best regards,

===========
Dragos DOBRE
CRAN, Nancy University

2011/4/21 Bender <minzoni.a...@gmail.com>:

Alessandro Minzoni

unread,
Apr 21, 2011, 6:47:00 AM4/21/11
to SysML Forum
"Hi,
The current code generation from TOPCASED is matching .uml extension file, Modifying the matching is not really complicated can you open a Feature Request to trace your request ? (Tristan FAURE)"
 
Thanks for answer, do you think that now is not possible to do this matching?
 
Regards,
 
Bender

GP

unread,
Apr 21, 2011, 1:55:44 PM4/21/11
to SysML Forum
Hi Alessandro

Why do you want to generate JAVA from SysML ? The correct step should
be a SysML->UML transformation (using ATL for example) and then
generate code from UML.

Direct transformation of SysML to code is not correct (unless you'd
like to do simulations, like Artisan and Rhapsody does) - but in this
case how do you manage non-UML standard elements (such as flow
ports) .. ? This is why is better to have a SysML->UML M2M
trasformation.

Regards

Guido

On Apr 21, 12:47 pm, Alessandro Minzoni <minzoni.alessan...@gmail.com>
wrote:

Alessandro Minzoni

unread,
Apr 22, 2011, 5:58:01 AM4/22/11
to sysml...@googlegroups.com
Thanks Dragos,
yes, Topcased has UML to Java generator but for my purpose I need to transform my SysML model into Java (even C++) code. I think to migrate to IBM Rational Rhapsody from several time, but I should begin with another tool!
What do you say about transformation in Modelica code on IBM RR?
 
Regards,
 
Bender
2011/4/21 Dragos DOBRE <dobre....@gmail.com>

Alessandro Minzoni

unread,
Apr 22, 2011, 6:17:07 AM4/22/11
to sysml...@googlegroups.com
Hi Guido,
thanks for your answer.
Can you give me a procedure to transform SysML in UML by M2M transformation (e.g. with ATL)?
Regards,
 
Alessandro
2011/4/21 GP <guido.p...@gmail.com>

Michael Jesse Chonoles

unread,
Apr 22, 2011, 7:05:10 AM4/22/11
to sysml...@googlegroups.com
Generally, attempting to produce from SysML any code other than simulation code is a waste of time as it mixes level of abstractions. it would be like generating code from a blueprint -- a confused attempt to say the least.

Michael


From: Dragos DOBRE <dobre....@gmail.com>
To: sysml...@googlegroups.com
Sent: Thu, April 21, 2011 4:52:18 AM
Subject: Re: [SysML Forum] SysML to Java code

> For more options, visit this group at
> http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>

--
You received this message because you are subscribed to the Google
Groups "SysML Forum" group.
Public website: http://www.SysMLforum.com
To post to this group, send email to sysml...@googlegroups.com
To unsubscribe from this group, send email to

Dragos DOBRE

unread,
Apr 22, 2011, 8:31:22 AM4/22/11
to sysml...@googlegroups.com
Hello,

As I know, you can use Modelica code syntax in Parametric Diagrams
which are calculated with Matlab or Maxima. I didn't heard of Modelica
code transformation in IBM RR. Do you have any info about this?

Regards,

===========
Dragos DOBRE


2011/4/22 Alessandro Minzoni <minzoni.a...@gmail.com>:

Alessandro Minzoni

unread,
Apr 22, 2011, 9:22:04 AM4/22/11
to sysml...@googlegroups.com
Hi,
in IBM RR I have read some interesting papers about SysML to Modelica
code transformation with the logic of stereotypes and I'm aiming for
this goal!
Now I'm working with Papyrus that allows to generate Modelica code
from UML stereotyped by ModelicaML (a Modelica Profile) for simulate
my model.

Regards,

Alessandro


2011/4/22 Dragos DOBRE <dobre....@gmail.com>

Dan George

unread,
Apr 23, 2011, 12:20:15 PM4/23/11
to SysML Forum
Perhaps Michael meant to say that generating code from the SysML
model, alone, is unlikely to succeed. Blueprints lead to a physical
product but realization also requires standards to cover construction
details not expressed in the model.

It would be great if we could do something like this:

v-------------------------------------------------\
SysML Model -> simulation -> validate -^ |
| |
|-----------------------|----------| |
code gen <- STANDARDS -> HW gen specifications |
| ^ | |
| \--------------------| v |
\-> physical product ----------> verify -----> validate

This process is not yet practical for me but still seems worth
pursuing. Neither SysML nor the standards are mature enough yet.
Sounds like Dragos has achieved some level of success.

Dan
P.S. - I guess I didn't really contribute anything with this comment
but having made the ASCII art, I had to share it. :)

On Apr 22, 4:05 am, Michael Jesse Chonoles <mjchono...@yahoo.com>
wrote:
> Generally, attempting to produce from SysML any code other than simulation code
> is a waste of time as it mixes level of abstractions. it would be like
> generating code from a blueprint -- a confused attempt to say the least.
>
> Michael
>
> ________________________________
> From: Dragos DOBRE <dobre.dra...@gmail.com>
> To: sysml...@googlegroups.com
> Sent: Thu, April 21, 2011 4:52:18 AM
> Subject: Re: [SysML Forum] SysML to Java code
>
> Hello,
>
> I think that would be possible. As UML profile, it should be possible
> to transform a SysML model into executable code. I think that Topcased
> has UML to Java generator.
>
> For example, we use IBM Rational Rhapsody to build SysML models and we
> verify these models by executing the State Machine Diagrams and
> Sequence Diagrams. This tool is generating C++ code from the State
> Machine Diagrams (the behavior of the system) and, with Harmony
> methodology, the transformation allows to visualize this behavior on a
> Sequence Diagram. Besides, you can access the generated code.
>
> Best regards,
>
> ===========
> Dragos DOBRE
> CRAN, Nancy University
>
> 2011/4/21 Bender <minzoni.alessan...@gmail.com>:
>
>
>
>
>
>
>
>
>
> > Hi,
> > I'm modelling my SysML model system on Topcased(4.3.0) and I would
> > like to translate this on Java code, it's possible?
>
> > Best regards,
>
> > Bender
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "SysML Forum" group.
> > Public website:http://www.SysMLforum.com
> > To post to this group, send email to sysml...@googlegroups.com
> > To unsubscribe from this group, send email to
> > sysmlforum+...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "SysML Forum" group.
> Public website:http://www.SysMLforum.com
> To post to this group, send email to sysml...@googlegroups.com
> To unsubscribe from this group, send email to
> sysmlforum+...@googlegroups.com

GP

unread,
Apr 23, 2011, 12:27:03 PM4/23/11
to SysML Forum
Hi Alessandro

Yes, ATL is a good choice, using Topcased.

The point in M2M transformations such as the one you are mentioning
(SysML->UML) is the need to adapt model elements conceived to model
non SW-things to SW. As said, a good example are Flow Ports ....
suppose you have a block with a flow port to model the power supply.
Transform this to UML and the to code is somewhat difficult .... thus
in doing this kind of trasformations you should define a set of
stereotypes to manage this kind of problems.

Regards

Guido

On 22 Apr, 12:17, Alessandro Minzoni <minzoni.alessan...@gmail.com>
wrote:
> Hi Guido,
> thanks for your answer.
> Can you give me a procedure to transform SysML in UML by M2M transformation
> (e.g. with ATL)?
> Regards,
>
> Alessandro
> 2011/4/21 GP <guido.penne...@gmail.com>
> > Public website:http://www.SysMLforum.com<http://www.sysmlforum.com/>

Dan George

unread,
Apr 23, 2011, 12:56:09 PM4/23/11
to SysML Forum
In my experience, I don't need the SysML->UML transformation because I
have already worked out the mappings to C++. I already know what the C+
+ looks like when I drop a flow port on a block. I used SysML to
design the mappings but I don't bother to generate the intermediate
model.

I have found I really don't need to stray outside the bounds of SysML
profile. I can decompose a flow port into blocks that become the C++
classes involved in realizing the flow port. UML has too many nuances
that lead to misunderstandings and mistakes. UML is a political
creation based on a merge of many competing languages. SysML is a
practical subset that can evolve based on technical success.

Dan

Apollo Sande

unread,
Apr 24, 2011, 6:43:32 AM4/24/11
to sysml...@googlegroups.com
Hello Dan George,

How can one acquire the skill to do similar Sysml -> C++ mapping for simulation purposes? 
What is their fidelity?
Would you be willing to offer a tutorial?

One another thought, I wish to map SysML-based simulations (created from SysML models) to Google Sketchup models to simulate virtual prototypes.

With ease of use and free Sketchup and SysML as an systems engineering standard, the potential synergy seems very useful at the very
least, for next generation system engineering education. Anyone with an idea how this can be accomplished? I'm looking at a collaborative 3D SysML simulation tool, an evolution of thinglab (http://wiki.squeak.org/squeak/607)

Sketchup is already integrated with the Newton SDK (c++) in a module called Sketchy Physics.


Regards,

A.Y.Sande.

--
You received this message because you are subscribed to the Google
Groups "SysML Forum" group.
Public website: http://www.SysMLforum.com

Dan George

unread,
Apr 26, 2011, 10:06:44 AM4/26/11
to SysML Forum
The mappings I developed are very specific to my platform. My only
goal was to ensure that the model had concrete representation in
source code. For example, I have several serial ports and I model them
as a stereotyped flow port. Just by dropping that port on the diagram
I know how to include the code that accesses a serial port. In some
cases the protocol is the same so I can also mark the port with the
protocol using a tag. With that, I can specify many hundreds of lines
of code with minimal effort in the model. With this approach,
simulation or real are just different configurations. Developing this
takes significant up-front work to create the framework for the
platform.

Michael Jesse Chonoles

unread,
Apr 26, 2011, 5:48:11 PM4/26/11
to sysml...@googlegroups.com
Of course, this would mean that your flow ports don't actually flow anything interesting -- such as fuel, ammunition, torgue. If you limit yourself to using SysML for a completely S/W system and ignore the fact that you can't implement anything in pure software (w/o computing platforms, and physical ports, power, people,etc.) you might get away with it.

If you model a system using SysML, and wish to generate Java (or any language) code for the generally small part of the system that uses pure software you may be able to do this -- if you're willing to be very specific about the software details -- generally more specific than necessary from a strict SysEng POV (the specificness can be supplied in the model (that is,by using UML like details, or by a set of detailed transformation rules)), you're just not doing System Engineering, you're using a modeling language to write code. Of course, you may find it useful.

Michael


From: Dan George <dgeorg...@gmail.com>
To: SysML Forum <sysml...@googlegroups.com>
Sent: Tue, April 26, 2011 10:06:44 AM
Subject: [SysML Forum] Re: SysML to Java code

> > For more options, visit this group at
> >http://groups.google.com/group/sysmlforum?hl=en_US?hl=en

--
You received this message because you are subscribed to the Google
Groups "SysML Forum" group.
Public website: http://www.SysMLforum.com
To post to this group, send email to sysml...@googlegroups.com
To unsubscribe from this group, send email to

Dan George

unread,
Apr 28, 2011, 1:05:05 AM4/28/11
to SysML Forum
Micheal,
flow ports that flow information are also useful abstractions. I am
modeling systems in which software/hardware interactions are required
for the system to operate. Why do you say that information flow within
a system is not interesting?

Your comments don't seem to apply to my situation.

Dan

On Apr 26, 2:48 pm, Michael Jesse Chonoles <mjchono...@yahoo.com>
wrote:
> Of course, this would mean that your flow ports don't actually flow anything
> interesting -- such as fuel, ammunition, torgue. If you limit yourself to using
> SysML for a completely S/W system and ignore the fact that you can't implement
> anything in pure software (w/o computing platforms, and physical ports, power,
> people,etc.) you might get away with it.
>
> If you model a system using SysML, and wish to generate Java (or any language)
> code for the generally small part of the system that uses pure software you may
> be able to do this -- if you're willing to be very specific about the software
> details -- generally more specific than necessary from a strict SysEng POV (the
> specificness can be supplied in the model (that is,by using UML like details, or
> by a set of detailed transformation rules)), you're just not doing System
> Engineering, you're using a modeling language to write code. Of course, you may
> find it useful.
>
> Michael
>
> ________________________________
> From: Dan George <dgeorge83...@gmail.com>
> > > sysmlforum+...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "SysML Forum" group.
> Public website:http://www.SysMLforum.com
> To post to this group, send email to sysml...@googlegroups.com
> To unsubscribe from this group, send email to
> sysmlforum+...@googlegroups.com

Remy

unread,
Apr 28, 2011, 3:06:35 AM4/28/11
to SysML Forum
All that seems to me jumping the gun twice or even more, as if there
was nothing worth to think about between requirements (SysML),
analysis and design (UML) and code implementation.
In particular, the semantics of entry points, channels and flows is
surely not the same before and after architectural decisions are
made.

Michael Jesse Chonoles

unread,
Apr 28, 2011, 12:39:55 PM4/28/11
to sysml...@googlegroups.com
No, of course, flow ports that flow information are useful and interesting. Just that if you could code the entire system in SysML, you're probably just using SysML as a better UML (which it is, in some areas).

Michael


From: Dan George <dgeorg...@gmail.com>
To: SysML Forum <sysml...@googlegroups.com>
Sent: Thursday, April 28, 2011 1:05 AM
Subject: Re: [SysML Forum] Re: SysML to Java code
> > > sysmlforum+unsub...@googlegroups.com

> > > For more options, visit this group at
> > >http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "SysML Forum" group.
> Public website:http://www.SysMLforum.com
> To post to this group, send email to sysml...@googlegroups.com
> To unsubscribe from this group, send email to

> For more options, visit this group athttp://groups.google.com/group/sysmlforum?hl=en_US?hl=en

--
You received this message because you are subscribed to the Google
Groups "SysML Forum" group.
Public website: http://www.SysMLforum.com
To post to this group, send email to sysml...@googlegroups.com
To unsubscribe from this group, send email to

Dan George

unread,
Apr 29, 2011, 12:40:39 AM4/29/11
to SysML Forum
I don't really use SysML to program. I use it to depict abstractions
that represent elements of an implementable system. I do find SysML
more useful because it provides just the necessary vocabulary. I can
use SysML for every level of abstraction and transformation.

Many of the hardware blocks I include in the model have a known
implementation just like the code I described. The known
implementations provide the context to work out the right design of
the new stuff. It would be cool to be able to generate real code for
the software parts and sim code for the hardware parts. With that you
could do lots of system level testing w/o putting a dime into mfg
tooling or handling physical items. That testing doesn't replace final
verification of the realized system but would enable iteration through
some initial builds that would otherwise involve scrap.

So, in my opinion, SysML to Java is a worthwhile endeavor. You have to
design the transformations to get from nice high level abstractions to
actual implementations. If the system isn't a one-off, you'll get to
take advantage of having the model over the life of the product.

Dan

On Apr 28, 9:39 am, Michael Jesse Chonoles <mjchono...@yahoo.com>
wrote:
> No, of course, flow ports that flow information are useful and interesting. Just that if you could code the entire system in SysML, you're probably just using SysML as a better UML (which it is, in some areas).
>
> Michael
>
> ________________________________
> > > > sysmlforum+...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "SysML Forum" group.
> > Public website:http://www.SysMLforum.com
> > To post to this group, send email to sysml...@googlegroups.com
> > To unsubscribe from this group, send email to
> > sysmlforum+...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "SysML Forum" group.
> Public website:http://www.SysMLforum.com
> To post to this group, send email to sysml...@googlegroups.com
> To unsubscribe from this group, send email to
> sysmlforum+...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages