Skip to content

YAKINDU Statechart Tools 3.1.0 (Oct 4, 2017)

This release comes with several bug fixes and the following main features:

  • Using properties and expressions in generator models
  • Named parameter calls
  • Option to skip generation of library files
  • New online documentation

Using properties and expressions in generator models

An generator model may assign values to properties and later use these properties in expressions. The following sample generator model uses the var keyword to declare the properties projectName, version, isBeta, and generateTimerServce with their respective types and default values.

GeneratorModel for create::java {
    
    //Variables can be overridden from command line interface:
    
    var projectName : string = "light_switch_series"
    var version : string = "1.0"
    var isBeta : boolean = true
    var generateTimerServce : boolean = true

    statechart myStateAutomaton {
    
        feature Outlet {
            targetProject = projectName
            targetFolder = "src-gen/" + version + (isBeta ? "beta" : "")
            libraryTargetFolder = "src"
        }
        
        feature GeneralFeatures {
            TimerService = generateTimerServce
        }
    }
}

The model then uses these values in feature clauses by referring to the properties: The values assigned to properties are default values only and can be overridden from the headless code generator like this:

scc -m myGenmodel.sct -v version=2.0;isBeta=false

The name/value pairs specified by the -v option would override the corresponding default values of the properties in the generator model.This is a very flexible way to tailor the code generator within a headless build.

Read more about this feature in our user guide .

Named parameter calls

Now you can can use named parameters when calling an operation. Consider the following operation declaration:

operation myOperation(xValue : int, yValue : int) : void

This can be called with name parameters like this:

myOperation(xValue = 27, yValue = 42)

Named parameters make their order irrelevant. The following call is semantically equivalent to the one above:

myOperation(yValue = 42, xValue = 27)

While an operation call with named parameters is longer than the equivalent call with positional parameters, named parameters are a great means for self-documenting code (especially if the parameter names are more telling than in the example above).

Option to skip generation of library files

The Outlet feature now has an option to skip the generation of library files. This is useful to prevent the generation of a new library file when an existing one should be used:

feature Outlet {
    targetProject = projectName
    targetFolder = "src-gen/"
    libraryTargetFolder = "src"
    skipLibraryFiles = headless ? true : false
}

skipLibraryFiles (Boolean, optional): If you wish to exclude the static files from the code generation, i.e. those that are put into the libraryTargetFolder, you can set this value to true. If the value is false or not specified at all, the files are generated as usual. Currently supported for the Java, C and C++ generators.

Miscellaneous improvements and bug fixes

Usability improvements:

  • Add a checkbox "save automatically" to the save dialog when running a simulation
  • Perspective switch for "Debug As"
  • Error markers of subdiagrams are not propagated to parent diagram
  • “Run As” context menu action available in diagram
  • Implicit imports for active(State) statements

Code generation improvements:

  • “Effective C++” compliant code
  • Removed unused includes for cycle based state machines
  • Provide a constant that provides the maximum number of parallel time events of a state machine

Bug fixes:

  • [Performance] The system still slows down more and more for each successive single-step
  • Content assist on transitions and states shows implicit variable "period"
  • Missing validation rule for top-level regions without entry