package hu.elte.txtuml.export.uml2.transform.exporters.actions;

import java.util.List;

import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.StartClassifierBehaviorAction;
import org.eclipse.uml2.uml.UMLPackage;

import hu.elte.txtuml.export.uml2.transform.exporters.expressions.Expr;
import hu.elte.txtuml.export.uml2.transform.exporters.expressions.ExpressionExporter;

public class StartActionExporter {

	private final ExpressionExporter<? extends ActivityNode> expressionExporter;

	public StartActionExporter(ExpressionExporter<? extends ActivityNode> expressionExporter) {
		this.expressionExporter = expressionExporter;
	}

	public void export(List<Expr> args) {
		Expr arg = args.get(0);

		StartClassifierBehaviorAction startAction = (StartClassifierBehaviorAction) expressionExporter
				.createAndAddNode("start " + arg.getName(), UMLPackage.Literals.START_CLASSIFIER_BEHAVIOR_ACTION);

		startAction.createObject(arg.getName(), arg.getType());

	}
}

@@ -707,16 +707,34 @@
 .get(0);
+%0A%09%09arg.evaluate();
 %0A%0A%09%09Star
@@ -986,14 +986,117 @@
 ype());%0A
+%09%09expressionExporter.createObjectFlowBetweenActivityNodes(arg.getOutputPin(), startAction.getObject());
 %0A%09%7D%0A%7D%0A

fix for #304