#!/bin/bash

if [ $# -lt 1 ]
then
	echo "Usage: $0 <umlfile> <output-dir>"
	exit 1
fi

FILE=$1

if [ ! -f $FILE ]
then
	echo "File $FILE doesn't exist or is not a regular file"
	exit 2
fi

GEN_PATH=$PWD/src-gen
if [ ! -z $2 ]
then
	GEN_PATH=$2
fi

acsStartJava org.eclipse.emf.mwe.core.WorkflowRunner alma/acs/sm/workflows/StateMachineCodeGeneration.mwe -pmodelFile=$FILE -pplatformPath=../../ -pgenPath=$GEN_PATH
