Skip to content

Services & operations

Services group operations callable from components.

Complete example

cmn
package com.example.customer

import org.joinedworkz.facilities.common.base

platform Base

type Customer {
    id**: Id
    name*: Name
}

service CustomerService {
    find(id*: Id): Customer
    search(name: String): Customer[]
}

Operation structure

An operation is declared directly by its name; there is no operation keyword.

  • id*: Id is a mandatory parameter.
  • name: String is optional because it has no mandatory *.
  • : Customer is a single return value.
  • : Customer[] is a collection return value.
  • Stereotypes and properties can add platform-specific metadata.

The CMN 1.3.80 grammar does not define a separate error-response list for service operations. HTTP response codes belong to resource methods and method types instead.