Hallo all!
I'm trying to improve the processes in one of my microcontroller-based projects and want to replace a manual coded simple state machine in C (that contains four states) by a generated one, so that we automatically have a nice documentation. In our company, we are using EA corporate licenses. EA is totally new for me!
My goal is to design a state machine in EA and add some few lines of code at the appropriate places, which is working in my project out of the box. In case of a change in design, I would like to generate the source code again, recompile and the new design is applied without a time-consuming merge process (of old code).
As documented in
http://www.sparxsystems.com/enterprise_architect_user_guide/software_development/code_generation___state_machin.html, EA seems to be able to generate code. I tried to load EAExample.eap and searched for an example which is similar to my goal. In the example under
Project Models.System Model.Implementation Model (PSM).Java Model With Behaviors.Order.ProcessOrder.ProcessOrder
I found exactly this example. One level up on "Order", I activated the context menu and clicked on Generate Code. A file Order.java was generated which looks like this
/**
* @author Simon McNeilly
* @version 1.0
* @created 09-Dez-2010 17:59:09
*/
public class Order {
private Date date;
private String deliveryInstructions;
private String orderNumber;
private LineItem m_LineItem;
public Order(){
}
public void finalize() throws Throwable {
}
public void checkForOutstandingOrders(){
doCheckForOutstandingOrders();
}
public Date getDate(){
return date;
}
public String getDeliveryInstructions(){
return deliveryInstructions;
}
public LineItem getLineItem(){
return m_LineItem;
}
public String getOrderNumber(){
return orderNumber;
}
public OrderStatus getStatus(){
return status;
}
/**
*
* @param newVal
*/
public void setDate(Date newVal){
date = newVal;
}
/**
*
* @param newVal
*/
public void setDeliveryInstructions(String newVal){
deliveryInstructions = newVal;
}
/**
*
* @param newVal
*/
public void setLineItem(LineItem newVal){
m_LineItem = newVal;
}
/**
*
* @param newVal
*/
public void setOrderNumber(String newVal){
orderNumber = newVal;
}
/**
*
* @param newVal
*/
public void setStatus(OrderStatus newVal){
status = newVal;
}
} This is not what I expected and differs from the documentation, because it contains the class definition only.
I downloaded the trial version of EA and selected the "ultimate version" to be sure, that an inadequately license is not the reason for that behaviour. It is still the same!
I'm curious as well, how I'm able to generate the code for the Activity diagram under
Project Models.System Model.Implementation Model (PSM).Java Model With Behaviors.Account.doValidateUser :Boolean.doValidateUser
Am I expecting to much from EA? Can someone help me with my problems?
Thank you so much!!
Best regards,
Sven Lübke