Validation Rules

For a table overview, see Validation Rules Table.

Rules Listing

AppBaseDependencies rule

name Base dependencies should be added for an application.
group Missing defaults
severity prError
examples
Missing dependency "account" Missing dependency "utils" Missing dependency "validation" Missing dependency "workflow"
description Base dependencies should be added for an application.

AppCircularDependency rule

name No circular dependencies allowed in an application.
group References
severity warning
examples
Circular dependency: first -> second -> first
description No circular dependencies allowed in an application.

AppComponentNameClash rule

name The name of a component is not allowed to be identical to the name of the application.
group Naming
severity error
examples
<Component app> has the same name as its application
description The name of a component is not allowed to be identical to the name of the application.

ConsistentPackageName rule

name Data Element should use one of the existing package names.
group Naming
severity error
examples
<DataElement Beta> is the only element with package name "pkgB"
description Data Element should use one of the existing package names. Data Element is the only one using this package name.

DataChildHasParentReference rule

name Data childs should refer to fields that are link fields to the parent element.
group References
severity error
examples
<DataChild tutorialComp::Order::notPerson> is not a link field to <DataElement Person>
description Data childs should refer to fields that are link fields to the parent element.

skinparam nodesep 60
hide circle
hide methods

rectangle "condition" {
component "tutorialComp" {

class Person {
    <b><color:blue>{child} tutorialComp::Order::person</color></b>
}

class Order

Person -[hidden]> Order
}

skinparam nodesep 60
hide circle
hide methods

skinparam ArrowThickness 2

rectangle "implies" {

    component "tutorialComp" {

    class Person {
        {child} tutorialComp::Order::person
    }

    class Order {
        <b><color:green>person : Person [Ln01/Ln02/Ln03]</color></b>
    }

    Person -{ Order #green
}

DataChildReference rule

name Data childs should refer to existing components, elements, and fields.
group References
severity error
examples
<Component unknownComponent> is missing
description Data childs should refer to existing components, elements, and fields.

DataElementHasInfoField rule

name A data element should have at least one info field.
group Missing defaults
severity warning
examples
<DataElement Invoice> has no isInfoField field
description A data element should have at least one info field.

DataElementNaming rule

name Data elements should start with a capital.
group Naming
severity prError
examples
<DataElement invoice> should be called "Invoice"
description Data Element names should start with a capital letter. Second letter must be lowercase. Good: “Person”, “P3rson” | Bad: “PErson”

skinparam nodesep 60
skinparam ranksep 20
hide circle
hide members

rectangle "examples" {

class "<b><color:red>p</color></b>erson" as person
class "P<b><color:red>E</color></b>RSON" as PERSON
class "<b><color:red>p</color></b>3rson" as p3rson
class "<b><color:red>7</color></b>Person" as 7Person

class "<b><color:green>P</color></b>erson" as Person1
class "P<b><color:green>e</color></b>RSON" as Person2
class "<b><color:green>P</color></b>3rson" as P3rson
class "Person" as Person3

person .> Person1
PERSON .> Person2
p3rson .> P3rson
7Person .> Person3

Person1 -[hidden]-> Person2
Person2 -[hidden]-> P3rson
P3rson -[hidden]-> Person3

DataOptionDisplayName rule

name A displayName property should refer to (a combination of) fields of the data element it is defined in.
group Naming
severity error
examples
<DataOption Person::hasDisplayName> has value "firstName_secondName", but <Field Person::firstName> is missing <DataOption Person::hasDisplayName> has value "firstName_secondName", but <Field Person::secondName> is missing
description A displayName property should refer to (a combination of) fields of the data element it is defined in.

DataOptionHasCountByStatusGraph rule

name Data element with option hasCountByStatusGraph must have a status field.
group References
severity error
examples
<Field Invoice::status> is missing
description Data element with option hasCountByStatusGraph must have a status field.

DataOptionHasCountPerHourGraph rule

name Data element with option hasCountPerHourGraph requires a startedAt field and findByStartedAtEq finder.
group References
severity error
examples
<Field Invoice::startedAt> is missing <Finder Invoice::findByStartedAtEq> is missing
description Data element with option hasCountPerHourGraph requires a startedAt field and findByStartedAtEq finder.

DataOptionHasSearchBar rule

name hasSearchBar option of a Data Element should have value [fieldName]:[op] and a finder findBy[FieldName][op].
group References
severity error
examples
<Operator ux> is not one of #(gt lt eq lk) <Field Customer::firstName> is missing <Finder Customer::findByFirstNameUx> is missing
description A data element with option hasSearchBar should have a value [fieldName]:[op] with “op” being one of the operators gt,lt,eq,lk (like). They should also have a finder findBy[FieldName][op] specified in the corresponding data element and should be of value type String.

DataOptionUniqueKey rule

name A data element with option uniqueKey with value [FieldName] requires a [FieldName] field and findBy[FieldName]Eq finder.
group References
severity error
examples
<Field Invoice::invoiceId> is missing <Finder Invoice::findByInvoiceIdEq> is missing
description A data element with option uniqueKey with value [FieldName] requires a [FieldName] field and findBy[FieldName]Eq finder in the corresponding data element.

DuplicateNames rule

name Elements in the same namespace cannot use the same name.
group Naming
severity error
examples
<Field Invoice::invoiceId> is a duplicate
description No two elements in the same namespace (dataElements/taskElements/flowElements in a component, fields/finders in a dataElement, …) can share the same name.

EmptyComponent rule

name A component should not be empty
group Missing defaults
severity warning
examples
<Component testComp> has no Data Elements
description A component should not be empty.

FieldDate rule

name Fields with names enteredAt or modifiedAt should be Dates.
group Types
severity warning
examples
<Field Item::enteredAt> should be Date type
description Fields with names enteredAt or modifiedAt should be Dates.

FieldNaming rule

name Field names should start with lower case letters.
group Naming
severity error
examples
<Field Person::FirstName> should be called "firstName"
description Two first two letters of a Field should be lowercase. OK: “anInvoice”, “a”, “a3”, “a2Invoice” | Incorrect: “aPerson”, “Invoice”

FieldToUser rule

name Fields with names enteredBy or modifiedBy should be link fields to the class User from net.democritus.usr package.
group References
severity warning
examples
<Field Entry::enteredBy> should be link field to net.democritus.usr::User
description Fields with names enteredBy or modifiedBy should be link fields to the class User from net.democritus.usr package.

FinderDuplicatePairs rule

name Finder should not have duplicate field operator pairs.
group Duplicates
severity error
examples
<Finder Invoice::findByStatusGt> has duplicate operator pair Gt:status
description Finder should not have duplicate field operator pairs. The check is performed on the operator and field, not the pair’s name.

FinderForVectorOpposite rule

name A findBy[Opposite]Eq finder should be defined for “to N” (Ln05, …) relationships.
group Missing
severity error
examples
<Finder Person::findByGroupEq> is missing
description A findBy[Opposite]Eq finder should be defined for “to N” (Ln05, …) relationships. E.g. for Person { group: DataRef } >– Group { persons: Vector<DataRef> } you need findByGroupEq finder on Person element.

skinparam nodesep 60
hide circle
hide methods

rectangle "condition" {
class Person {
    group : Group [Ln01]
}

class Group {
    <b><color:blue>persons : Person [Ln05]</color></b>
}

Person }- Group
}

skinparam nodesep 60
hide circle
hide methods

rectangle "implies" {
class Person {
    group : Group [Ln01]
    --
    <b><color:green>{finder} findByGroupEq</color></b>
}

class Group {
    persons : Person [Ln05]
}

Person }- Group
}

FinderMissingPairs rule

name Operator pairs for findBy* finder are missing.
group Naming
severity prError
examples
<Finder Person::findByNameEq> has no operator pairs
description Operator pairs for findBy* finder are missing.

FinderNaming rule

name The operator pairs do not match the finder’s name.
group Naming
severity error
examples
<Finder Person::findByNameEq> should be called findByOtherNameEq
description The operator pairs of a finder should match its name.

FinderPairReference rule

name Field pairs must refer to existing fields.
group References
severity error
examples
Operator pair Person::findByFirstNameEq::Eq:firstName points to nonexistent field
description All field pairs must refer to existing fields on the associated data element.

FinderPairsNaming rule

name The definition of the field operator pair should match its name.
group Naming
severity warning
examples
Eq:name/Eq:otherField
description The definition of the field operator pair should match its name.

FinderParentForDataChild rule

name A findBy[ParentElement]Eq must be defined on the Data Child’s ChildElement.
group References
severity prError
examples
<Finder TargetEl::findByTargetFieldEq> is missing
description A findBy[ParentElement]Eq must be defined on the Data Child’s ChildElement.

skinparam nodesep 60
hide circle
hide methods

rectangle "condition" {
component "tutorialComp" {

class Person {
    <b><color:blue>{child} tutorialComp::Order::person</color></b>
}

class Order {
    person : Person [Ln01]
}

Person -{ Order
}

}

skinparam nodesep 60
hide circle
hide methods

rectangle "implies" {

    component "tutorialComp" {

    class Person {
        {child} tutorialComp::Order::person
    }

    class Order {
        person : Person [Ln01]
        <b><color:green>{finder} findByPersonEq</color></b>
    }

    Person -{ Order
}

FindersDefaultFinders rule

name Standard finders should be added for each data element.
group Missing defaults
severity prError
examples
<Finder Person::findAllPersons> is missing <Finder Person::findByNameEq> is missing
description Standard finders should be added for each data element.

FlowElementDataElementNaming rule

name There is no data element matching the flow element’s name.
group References
severity error
examples
<DataElement Invoice> is missing for <FlowElement Invoice>
description There is no data element matching the flow element’s name.

FlowNodeNaming rule

name State and Task nodes should start with a capital letter.
group Naming
severity prError
examples
<Task completer> should be called Completer
description State and Task nodes should start with a capital letter.

GeneralNaming rule

name No spaces, underscores, or non-ASCII signs are allowed in names.
group Naming
severity error
examples
<Field Person::non|alpha> contains non-alphanumeric characters
description No spaces, underscores, or non-ASCII signs are allowed in names.

NameNotWantedFinder rule

name When the option nameNotWanted is set, no “name” field or findByNameEq finder should be present.
group Configuration
severity error
examples
<Finder Person::findByNameEq> should not exist <Field Person::name> should not exist
description When the option nameNotWanted is set, no “name” field or findByNameEq finder should be present.

PackageNaming rule

name Package name can only contain lowercase words ([a-z]) separated by dots
group Naming
severity error
examples
Package name "2.nsm.test" of <DataElement Invoice> must be a valid Java package name (([a-zA-Z][a-zA-Z0-9_]+\.)*[a-zA-Z0-9]+)
description Package name can only contain lowercase words ([a-z]) separated by dots. The name cannot start or end with a dot, and a dot cannot be followed by another dot.

PrimaryElementsWithFlows rule

name Data Elements with flows should be in the Primary category.
group Classification
severity warning
examples
<DataElement Invoice> should be primary
description Data Elements with flows should be in the Primary category.

ReservedNameEq rule

name Name cannot be a reserved name.
group Naming
severity error
examples
<DataElement Id> uses a reserved name
description Name cannot be a reserved name.

ReverseLinkField rule

name A reverse link must be defined for Ln04 and Ln05 link fields.
group References
severity error
examples
Ln05 link <Field Customer::invoices> is missing opposite Ln01 link
description A reverse link must be defined for Ln04 (Ln02), Ln05 (Ln01), and Ln06 (Ln03) link fields.

SupportedFieldType rule

name Fields should only be of tested field types.
group Unexpected types
severity warning
examples
<FieldType NotString> for <Field Person::firstName> is not supported
description Fields should only be of tested field types.

TaskBrokenFlow rule

name A task must have a begin state and an end state.
group References
severity error
examples
<Task InvoiceSender> has no end state
description A task must have a begin state and an end state.

TaskDefaultOptions rule

name In a standard setting (in order to simulate flows in a prototype) each task should have the options “includeDelegation” and “includePerform”.
group Options
severity information
examples
<TaskElement Completer> should have <TaskOption includeDelegation> <TaskElement Completer> should have <TaskOption includePerform> <TaskElement Completer> should have <TaskOption includeRemoteAccess>
description In a standard setting (in order to simulate flows in a prototype) each task should have the options “includeDelegation” and “includePerform”.

TaskStatusElement rule

name Each flow (i.e., primary element with a flow defined on it) should have a corresponding [Element]TaskStatus related to it.
group References
severity prError
examples
<DataElement Invoice> has flow, but is missing <DataElement InvoiceTaskStatus>
description Each flow (i.e., primary element with a flow defined on it) should have a corresponding [Element]TaskStatus related to it.

skinparam nodesep 120
hide circle
hide methods
rectangle "condition" {
class Invoice {
    <b><color:blue>// has flow</color></b>
}

skinparam nodesep 120
hide circle
hide methods
rectangle "implies" {

class Invoice {
    // has flow
}

class InvoiceTaskStatus #lightGreen {
    invoice : Invoice
}

Invoice -{ InvoiceTaskStatus


}

UploadUriField rule

name A field with name uploadUri should be of type StringFile.
group Unexpected types
severity warning
examples
<Field Person::uploadUri> should be of type StringFile
description A field with name uploadUri should be of type StringFile.

ValidDataRefTarget rule

name Link field must refer to an existing element in an existing component.
group References
severity error
examples
<Field Invoice::stateTask> links to <DataElement NotStateTask> in <Component workflow>, but <Component workflow> is not in application components <Field Invoice::stateTask> links to <DataElement NotStateTask> in <Component workflow>, but <Component workflow> is not in component dependencies <Field Invoice::stateTask> links to a non-existent <DataElement NotStateTask> in <Component workflow>
description Link field must refer to an existing element in an existing component.