Actifsource Environment
Table of Contents
Actifsource Eclipse Plugin
Actifsource is shipped as Eclipse Plugin. Please make sure to install Eclipse first. Choose Help/Install new Software… to install Actifsource from one of the following Eclipse Update Sites:
- www.actifsource.com/updates (Community Edition)
- www.actifsource.com/updates-enterprise (Enterprise Edition: password protected)
If you are not familiar with the Eclipse environment, please consult the Installing Actifsource.
Memory Usage
The Actifsource technology allows you to track any keystroke in real-time. As a result of this feature the memory consumption might be quite high for larger models. Make sure to adopt the memory given to Eclipse if necessary in the eclipse.ini
file in the Eclipse directory. We suggest at least 4 GB of ram.
To observe the memory while working with Actifsource enable Window/Preferences/General/Show heap status
.
Make sure to enable Show Max Heap
to track the maximum memory usage by using the context menu on the heap status display.
Perspectives
Since Eclipse is a general software development tool, you must be able to select different perspectives. Make sure that the Actifsource Perspective is selected when working with Actifsource.
Actifsource Preferences
The preferences dialog (Window/Preferences/Actifsource) provides the following configuration options.
Statistics
Selecting the Actifsource menu shows a statistic of the resources.
- Reources The number of resources in the project.
- RootResources The number of root resources in the project. A root resource is a non-aggregated resource.
- Statements The number of statements in the project. The statement declares three resources as follows: Subject-Predicate-Object.
Generator
- Always clear generator console before generate Actifsource cleans the console output before generating code. This makes it easier to scroll to the top of the output to find error messages.
Style Configuration
The style configuration let you define your own colors.
- Profile Shows all built-in and user-defined profiles.
- Edit Edit user-defined profiles. Note that you cannot edit built-in profiles.
- Copy Copy built-in or user-defined profiles. Use copy on a built-in profile to create a user-defined profile.
- Remove Removes user-defined profiles. Note that you cannot remove built-in profiles.
Validator
- Revalidation Delay (ms) Actifsource validates every keystroke. The validation might lead to a high CPU load for large models. For this reason you can configure the delay between validations.
Project Wizard
The project wizard allows you to create a new Actifsource project from scratch. Select File/new/Actifsource Project.
Project Name and Location
- Project name This is the name of the new project. We suggest that the project name is given in the eclipse-like manner: com.company.project.subproject. Note that the dotted name automatically leads to a corresponding package structure.
- Location This is the location of the project. The default location is in the workspace.
- Working Set You might add the project to an existing working set. A working set is a dedicated view to the projects of the workspace.
Resource Paths
All Actifsource resources are saved in Resource Files with the ending
.asr
in an xml format. The resource path defines where to find the
model resources.
- Add Resource Path Adds a new resource path to the project.
- Edit… Edits an existing resource path.
- Remove Removes an existing resource path.
- Generate javamodel Actifsource builds internal Java classes to handle your model. Do not switch off this option unless you know exactly what you do.
Target Folder
Generated code is written to target folders. You might specify any existing or new folder in your project as a target folder.
-
Add Target Folder… Adds a new target folder to your project.
-
Add Build Config Adds a new build configuration to your target folder.
A build configuration is kind of a make file that tells actifsource which templates to build. If no build configuration is defined, Actifsource automatically generates code for all templates from the current project, combined with all matching resources from the current project (see Build Config, see Template Editor). -
Add Package… Adds a new package to your build configuration. Code is only generated for matching resources found in the specified packages.
com.actifsource.statemachine.specific.*
(all resources in the package)com.actifsource.statemachine.specific.**
(all resources in the package and its subpackages)
If no package is defined, Actifsource generates code for all matching resources found in all packages of the current project.
Note that you need to reference packages from other projects explicitly. Set the project dependencies first accordingly.
- Add Resource… Adds a single resource to your build configuration. If no resource is defined, Actifsource generates code for all matching resources found in all packages of the current project.
Note that you need to reference resources from other project explicitly. Set the project dependencies first (see Chapter 2.5.5 Project Dependencies).
- Edit… Edits the current entry.
- Remove Removes the current entry.
- Ignore Whitespaces Actifsource calculates a checksum (MD5 hash) for every generated file.
If this option is checked, Actifsource will ignore whitespaces when calculating the checksum. - Execute Save Actions Eclipse supports so called Save Actions after a file has been saved (i.e. code formatting). If this option is checked, save actions are executed after generating the files.
Template Folders
This feature is for beta users and developers only and might be used to reference folders for templates of third party products.
Project Dependencies
Use the project dependencies if you like to split your model in different Actifsource projects. Note that you have to set the project dependencies, before you might reference packages and resources from other projects in the target folder.
- Add Project Adds a new project dependency.
- Edit… Edits the current project dependency.
- Remove Removes the current project dependency.
Built-in Dependencies
Use the built-in dependencies to reference any Actifsource built-in models.
Built-In | Description |
---|---|
CORE | The Actifsource core model (do not remove) |
DIAGRAM | Domain Diagram |
CIP | Embedded real-time state engine |
DEC | Modelling I/O connection and scheduling for embedded systems |
OCUMENTATION_METAMODEL | Creates meta-model documentation from class diagrams |
JAVAMODEL | Creates Java classes for model access (shipped with Core built-in) |
GRAPHVIZ | Generator for graphviz |
WORKSPACE | File/folder operations and generating Eclipse projects |
DATATYPE | Common data type meta-model |
UML UML | state engine and code generator |
ECORE | ECore meta-model |
MODVIS | Visualization and animation of domain diagrams in the web browser |
FREEMARKER | Generator for freemarker templates |
XPAND | Generator for xpand templates |
- Add Builtin Adds a new built-in project dependency.
- Edit… Edits the current built-in project dependency.
- Remove Removes the current built-in project dependency.
Project Properties
All settings shown in Chapter 2.5 Project Wizard can be found in Project/Properties/Actifsource.
Standard Package Structure
We suggest the following package structure.
- Generic The generic package contains the meta-model.
- Specific The specific package contains the domain model.
- Template The template package contains the code templates.
Project Menu
Use the project menu to control the build system of Eclipse and Actifsource.
-
Build Automatically If Build Automatically is switched on, Eclipse will build the project automatically after changed files have been saved.
Actifsource also generates Java classes for internal use. Generating these internal classes is also switched off by Build Automatically and you can’t expect Actifsource to work correctly. Therefore, please make sure that Build Automatically is switched on.
Please make yourself familiar with the Eclipse Builder concept. See Project/Properties/Builders to see the active builders for your project and their execution order (see Chapter 7.7 Eclipse Builder).
-
Generate Automatically If Generate Automatically is switched on, Actifsource will generate code after saving changed files. If Generate Automically is not switched on, you have to trigger code generation manually (Right-click on the Eclipse project and select Generate Code).
Actifsource also generates Java classes for internal use. Generating these internal classes is not switched off by Generate Automatically.
-
Enable External Builder This feature is for beta users and developers only. Since Actifsource is developed by Actifsource, we must be able to build ourselves with the current version. The external builder is compiled at development time and ensures that every change in the Actifsource workspace affects the next code generation run.
Toolbar
The Actifsource toolbar provides you with two important tools.
-
New Actifsource Resource
The new resource tool lets you create a new Actifsource resource in the selected package. The new resource tool only allows creating so called root classes.
-
Open Actifsource Resource
This tool shows all resources and allows filtering by name. Please note that this operation might be slow for a large amount of resources.
Project Explorer
The project explorer let you access your resource files. Resources are stored as xml files and named by the GUID (Globally Unique Identifier) of the resource. Since this format is incomprehensible for humans, the Project Explorer shows the name for named resources.
Link with Editor
Switch on the option Link with Editor to synchronize the project explorer with the currently active editor.
Actifsource Presentation
Actifsource allows you to show aggregated resources sorted by relation or just by their occurrence in the containing class.
Package Presentation
-
Flat Package Presentation Using the flat package presentation, all packages are shown as a flat list.
-
Hierarchical Package Presentation Using the hierarchical package presentation, the hierarchy is preserved. Note that folders which do not contain files are shown flat anyhow. This might lead to problems if you like to add new files or folders in a collapsed package. Just switch to the flat package presentation to solve this problem.
Drag and Drop
Use drag and drop to move resources between packages. All references to the resource are kept automatically.
Project Explorer Context Menu
The context menu of the project explorer supports several important operations on packages and resources.
New Dialog
The new/Actifsource dialog creates different types of actifsource files. For some types of resources, you can create new resources based on existing resources.
- New Actifsource Project Creates a new Actifsource project in the current workspace with the project wizard, as shown in Chapter 2.5 Project Wizard.
- New BuildConfig Creates a new BuildConfig which can be referenced in target folders (see Chapter 2.5.3 Target Folder and Chapter 7 Build Config).
- New Class Diagram Creates a new class diagram for UML-like Meta-Model design. The class diagram is the easiest way to create Meta-Models.
- New Diagram Type Creates a new diagram type which defines a user specific domain diagram. Creating a new diagram type on an existing class preselects this class as the RootClass.
- New Domain Diagram Creates a new domain diagram. Domain diagrams are based on diagram types.Creating a domain diagram on an existing resource preselects this resource as the singleRoot. The diagram type is automatically selected by the type of the singleRoot. If no singleRoot is defined, it is created automatically with the type defined by the diagram type.
- New FunctionSpace Creates a new function space (see Chapter 9.2 Function Space).
- New Package Creates a new package.
- New Resource Creates a new resource of any type.
- New Resource Folder Creates a new resource folder (see Chapter 2.5.2 Resource Paths).
- New Template Creates a new code template (see Chapter Template Editor). Creating a new template on an existing class preselects this class as the base type.
Open with
The Open with dialog forces eclipse to open files with a specific editor. The first element in the Open With list is the default editor. Once opened with another than the default editor Eclipse reminds this setting when double clicking the file to open. Just select Open With/Default Editor to restore the settings.
Actifsource supports the following editor types:
- Resource Editor The Actifsource Resource Editor is the standard editor which opens all types of Actifsource resources.
- Class Diagram Editor The Actifsource Class Diagram Editor opens resources of type ClassDiagram.
- Domain Diagram Editor The Actifsource Domain Diagram Editor opens resources of type DomainDiagram.
- Template Editor The Actifsource Template Editor opens resources of type Template.
Rename Resources and Packages
You may rename any resource or package via the context menu/rename or by pressing F2 (Windows).
Generic Refactoring
If you change your meta-model, any depending domain model might become invalid. Actifsource lets you register a piece of Java code, which transforms all existing domain models to fit the new meta-model.
Actifsource also uses this feature intensely if there are changes in the core model (meta meta-model). Please make sure to check the release notes to see if you need to run a Generic Refactoring after updating to a new Actifsource Version.
Compare With
Working together in a team, you might have collisions when checking Actifsource resource files (.asr) into your version control system (i.e. CVS, SVN, GIT etc.).
Actifsource lets you compare resources and resolve conflicts in the compare view of the Resource Editor.
Show Resource Dependencies
In the context menu of the selected resource you will find the following commands to show specific dependencies.
- Show Instances
Shows all instances of the selected resource. Note that a resource must be of type Class to have instances. See also Chapter 2.12.2.
- Show Types
Shows all types of the selected resource (typeof statement). See also Chapter 2.12.2.
- Show Subclasses
Shows all sub classes of the selected resource (extend statement). Note that a resource must be of type Class to have sub classes. See also Chapter 2.12.2.
- Show Superclasses
Shows all super classes of the selected resource (extend statement). Note that a resource must be of type Class to have super classes. See also Chapter 2.12.2.
- Show References
Shows all resources that are referencing the selected resource. See also Chapter 2.12.6.
- Sot Property
Sorts resources referenced by a relation. Note that you can sort according to any literal attribute (i.e. name).
Note that you have to switch on Group Aggregation By Relation (see Chapter 2.10.2 Actifsource Presentation) to see the relations.
Actifsource Views
AQL Query
The Actifsource Query Language let you query the model.
Hierarchy
Shows the hierarchy between resources.
Model Inconsistencies
Shows all model inconsistencies calculated by the validator. Make sure that this view is always visible to check whether your model is valid or not. Note that the code generator could throw an exception if your model is invalid.
Model Navigator
The model navigator shows all resources sorted by projects, packages and types. Use the model navigator to find classes outside your project.
Protected Regions
Shows all protected regions from a generated file. Click on the entry to navigate to the protected region in the selected file.
References
Shows all references to a specific resource in the form Subject-Predicate-Object while object is the referenced resource.