Skip to main content

Custom modelling config

Introduction

The custom modelling configuration allows you to tailor the graphical service design tool to your organization's specific needs. By providing a modelling configuration file at .k5/modelling-config.yaml in your project's git repository, you can customize the available model elements, define custom properties, and configure validation rules that align with your architectural patterns and design methodologies.

For more information on how to use custom modelling configurations, see Graphical service design - Customization.

Default modelling configuration

The following YAML shows the default modelling configuration that is used when no custom configuration is provided:

---
# general
# some very basic model-config settings
structureElements:
# System element is not meant to be changed
- name: SYSTEM
### EVERY (!) object implicitly inherits from here
abstract: true
properties:
- fieldName: uuid
type: system
- fieldName: type
type: system
- fieldName: version
type: system
- fieldName: customFields
type: system
- fieldName: tags
type: system
- fieldName: fileName
type: system
- name: Labeled
abstract: true
properties:
- fieldName: label
type: system
required: true
usedAsHeadline: true
- fieldName: description
displayName: Description
type: system
required: false
- fieldName: summary
displayName: Summary
type: system
required: false
- name: Trackable
abstract: true
# properties have special behavior as the fields are filled automatically
properties:
- fieldName: creationTs
type: system
- fieldName: creator
type: system
- fieldName: creatorId
type: system
- fieldName: lastModifiedTs
type: system
- fieldName: lastModifier
type: system
- fieldName: lastModifierId
type: system
- name: CodeGenReady
abstract: true
properties:
- fieldName: implementationInstructions
displayName: "Implementation instructions"
type: textarea
required: false
semanticHint: "Additional hints for code generation purposes"
- name: BusinessProperties
abstract: true
properties:
- fieldName: businessLogic
displayName: "Business logic"
type: textarea
required: false
semanticHint: "Logic description of what happens in the implementation"
- name: EntityProperties
abstract: true
properties:
- fieldName: properties
displayName: "Properties"
semanticHint: "List of properties, describing the complex object"
type: object
array: true
properties:
- fieldName: name
displayName: "Name"
type: string
required: true
- fieldName: type
displayName: "Type"
type: string
required: true
- fieldName: isRequired
displayName: "Required"
type: boolean
required: false
- fieldName: isList
displayName: "Array"
type: boolean
required: false
- fieldName: description
displayName: "Description"
type: string
required: false
---
## DDD-Modeling
structureElements:
- name: aggregate
displayLabel: Aggregate
icon: DataConnected
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
allowedContainedElements:
- targetType: entity
persistenceProperty: containedEntities
- targetType: valueObject
persistenceProperty: containedValueObjects
- targetType: command
persistenceProperty: commands
diagramOptions:
shape: card
defaultColor: gray
- name: entity
displayLabel: Entity
icon: Data_1
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- EntityProperties
allowedContainedElements:
- targetType: entity
persistenceProperty: containedEntities
- targetType: valueObject
persistenceProperty: containedValueObjects
diagramOptions:
shape: cardWithProperties
defaultColor: teal
properties:
- fieldName: isRoot
displayName: Root Entity
type: checkbox
required: false
semanticHint: "Indicates if entity is the root entity of the aggregate"
- fieldName: isAbstract
displayName: Abstract
type: checkbox
required: false
semanticHint: "Indicates if entity is abstract or not (abstract means, no instance can be created)"
- name: valueObject
displayLabel: ValueObject
icon: object
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- EntityProperties
allowedContainedElements:
- targetType: valueObject
persistenceProperty: containedValueObjects
diagramOptions:
shape: cardWithProperties
defaultColor: green
properties: [] # we could just define additional properties but not for now
- name: command
displayLabel: Command
icon: Function_2
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- BusinessProperties
diagramOptions:
shape: card
defaultColor: cyan
properties:
- fieldName: isFactory
displayName: FactoryCommand
type: checkbox
required: false
semanticHint: "Indicates if command is a factory command, which would mean that it is used to create an instance of the root entity"
- name: domain-service
displayLabel: Domain service
icon: FlowModeler
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- BusinessProperties
diagramOptions:
shape: card
defaultColor: blue
properties: [] # we could just define additional properties but not for now
- name: business-event
displayLabel: Business event
icon: Trigger
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: yellow
properties: [] # we could just define additional properties but not for now
- name: business-error
displayLabel: Business error
icon: IncompleteError
abstract: false
feature: ddd
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: red
properties: [] # we could just define additional properties but not for now
---
## Default Implementation Design
structureElements:
- name: service
displayLabel: Service
icon: Function
abstract: false
feature: implementation
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- BusinessProperties
diagramOptions:
shape: card
defaultColor: blue
properties: [] # we could just define additional properties but not for now
- name: class
displayLabel: Class
icon: Object
abstract: false
feature: implementation
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- BusinessProperties
allowedContainedElements:
- targetType: method
persistenceProperty: methods
- targetType: class
persistenceProperty: containedClasses
diagramOptions:
shape: cardWithAttributes
defaultColor: teal
properties:
- fieldName: attributes
displayName: "Attributes"
type: object
array: true
properties:
- fieldName: name
displayName: "Name"
type: string
required: true
- fieldName: type
displayName: "Type"
type: string
required: true
- fieldName: isRequired
displayName: "Required"
type: boolean
required: false
- fieldName: isList
displayName: "Array"
type: boolean
required: false
- fieldName: description
displayName: "Description"
type: string
required: false
- name: method
displayLabel: Method
icon: Parameter
abstract: false
feature: implementation
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
- BusinessProperties
diagramOptions:
shape: card
defaultColor: cyan
properties: [] # we could just define additional properties but not for now
---
## Integration
structureElements:
- name: provided-rest-api
displayLabel: Provided REST API
icon: Api
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
allowedContainedElements:
- targetType: provided-rest-api-operation
persistenceProperty: operations
diagramOptions:
shape: card
defaultColor: purple
properties: [] # we could just define additional properties but not for now
- name: provided-rest-api-operation
displayLabel: Provided REST operation
icon: CallsIncoming
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: purple
properties: [] # we could just define additional properties but not for now
- name: consumed-rest-api
displayLabel: Consumed REST API
icon: ConvertToCloud
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
allowedContainedElements:
- targetType: consumed-rest-api-operation
persistenceProperty: operations
diagramOptions:
shape: card
defaultColor: purple
properties: [] # we could just define additional properties but not for now
- name: consumed-rest-api-operation
displayLabel: Consumed REST operation
icon: Connect
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: purple
properties: [] # we could just define additional properties but not for now
- name: message-publisher
displayLabel: Message publisher
icon: ConnectionSend
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: orange
properties: [] # we could just define additional properties but not for now
- name: message-listener
displayLabel: Message listener
icon: ConnectionReceive
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: orange
properties: [] # we could just define additional properties but not for now
- name: message-topic
displayLabel: Message topic
icon: MessageQueue
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: yellow
properties: [] # we could just define additional properties but not for now
- name: message
displayLabel: Message
icon: Email
abstract: false
feature: integration
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: yellow
properties: [] # we could just define additional properties but not for now

---
## Persistence
structureElements:
- name: db-collection
displayLabel: DB collection
icon: DataCollection
abstract: false
feature: persistence
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: gray
properties: [] # we could just define additional properties but not for now
- name: db-table
displayLabel: DB table
icon: Table
abstract: false
feature: persistence
inheritsFrom:
- Labeled
- Trackable
- CodeGenReady
diagramOptions:
shape: card
defaultColor: gray
properties: [] # we could just define additional properties but not for now
---
features:
- name: ddd
displayLabel: Domain Driven Design
description: >-
Domain Driven Design (DDD) is a software development approach that focuses on modeling complex business domains.
icon: Area
- name: integration
displayLabel: Integration
description: >-
Integrate your systems with external systems, e.g. through REST APIs, message queues, etc.
icon: Api
- name: implementation
displayLabel: Implementation design
description: >-
Design and model the technical implementation details of your system, including classes, methods, and services.
icon: Code
- name: persistence
displayLabel: Persistence
description: >-
Model your data persistence layer, including database tables, collections, and data storage structures.
icon: DataBase
---