Isis Script - Updated (alpha) version available

September 5, 2015
isis dsl eclipse xtext

As mentioned in my previous post a formal description of the Isis Script DSL can be found on GitHub. An updated implementation of the Isis Script Eclipse editor is available as well.

Isis Script DSL Editor

Now the following features are support:

This feature set allows us to implement the entity and the repository service of the domain object SimpleObject from the Apache Isis Maven archetype SimpleApp. The corresponding Isis Scripts (based on the new version of the DSL) are as follows:

package domainapp.dom.modules.simple

import javax.jdo.annotations.Column
import javax.jdo.annotations.DatastoreIdentity
import javax.jdo.annotations.IdGeneratorStrategy
import javax.jdo.annotations.IdentityType
import javax.jdo.annotations.PersistenceCapable
import javax.jdo.annotations.Queries
import javax.jdo.annotations.Query
import javax.jdo.annotations.Unique
import javax.jdo.annotations.Version
import javax.jdo.annotations.VersionStrategy
import org.apache.isis.applib.annotation.Action
import org.apache.isis.applib.annotation.BookmarkPolicy
import org.apache.isis.applib.annotation.DomainObject
import org.apache.isis.applib.annotation.DomainObjectLayout
import org.apache.isis.applib.annotation.Editing
import org.apache.isis.applib.annotation.Parameter
import org.apache.isis.applib.annotation.ParameterLayout
import org.apache.isis.applib.annotation.Property
import org.apache.isis.applib.annotation.Title

@DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="id")
@Version(strategy=VersionStrategy.VERSION_NUMBER, column="version")
	@Query(name = "find", language = "JDOQL",
		value = "SELECT FROM domainapp.dom.modules.simple.SimpleObject"),
	@Query(name = "findByName", language = "JDOQL",
		value = "SELECT FROM domainapp.dom.modules.simple.SimpleObject WHERE name.indexOf(:name) >= 0")
@Unique(name="SimpleObject_name_UNQ", members = #["name"])
@DomainObject(objectType = "SIMPLE")
@DomainObjectLayout(bookmarking = BookmarkPolicy.AS_ROOT)
entity SimpleObject {

	@Column(allowsNull="false", length = 40)
	@Property(editing = Editing.DISABLED)
	property String name

	@Action(domainEvent = UpdateNameDomainEvent)
	action SimpleObject updateName {
		@Parameter(maxLength = 40)
		@ParameterLayout(named = "New name")
		parameter String newName {
			default {
		body {
		validate {
			if (newName.contains("!"))"Exclamation mark is not allowed")
			else null
		event UpdateNameDomainEvent

	title {"Object: {name}", "name", name)
package domainapp.dom.modules.simple

import org.apache.isis.applib.annotation.DomainServiceLayout
import org.apache.isis.applib.annotation.DomainService
import org.apache.isis.applib.annotation.Action
import org.apache.isis.applib.annotation.SemanticsOf
import org.apache.isis.applib.annotation.BookmarkPolicy
import org.apache.isis.applib.annotation.ActionLayout
import org.apache.isis.applib.annotation.MemberOrder
import org.apache.isis.applib.annotation.ParameterLayout
import org.apache.isis.applib.query.QueryDefault
import java.util.List

@DomainService(repositoryFor = SimpleObject)
@DomainServiceLayout(menuOrder = "10")
service SimpleObjects {

	@Action(semantics = SemanticsOf.SAFE)
	@ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT)
	@MemberOrder(sequence = "1")
	action List<SimpleObject> listAll {
		body {

	@Action(semantics = SemanticsOf.SAFE)
	@ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT)
	@MemberOrder(sequence = "2")
	action List<SimpleObject> findByName {
		parameter String name
		body {
			container.allMatches(new QueryDefault(SimpleObject, "findByName", "name", name))

	@MemberOrder(sequence = "3")
	action SimpleObject create {
		parameter String name
		body {
			val obj = container.newTransientInstance(SimpleObject) = name

If you’re interested in giving the updated version of the Eclipse editor for Isis Script a try then you can find the corresponding information here.

How to use Isis Script in a Maven build is described in this post.

Veloedit - Now available on GitHub

January 5, 2016
eclipse velocity

Enabling TemplateVariableResolver for Xbase imports in Xtext editor

October 4, 2015
eclipse xtext xbase

Isis Script DSL Description

September 1, 2015
isis dsl xtext
comments powered by Disqus