Skip to content

Commit

Permalink
docs: special types
Browse files Browse the repository at this point in the history
  • Loading branch information
KristianKjerstad authored and KristianKjerstad committed Jun 13, 2023
1 parent 72c267b commit 662f4fa
Showing 1 changed file with 77 additions and 1 deletion.
78 changes: 77 additions & 1 deletion docs/docs/guides/domain-modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,80 @@ sidebar_position: 1

# Domain modeling

## Adding a blueprint
## Adding a blueprint

TODO



## Special types
When creating models, the user has to specify types. There are some types that needs special treatment.

### `object` type
The object type is used to specify that an attribute can be any object.
However, this should only be used as an `attributeType` inside a blueprint. Using it as `type` is not valid.
For example, the following is NOT allowed:
```json
{
"type": "object",
"name": "objectEntity",
"description": "An entity of type object",
"numberValue": 1232,
"booleanValue": false,
"stringValue": "foo"
}
```



Example usage of the object type: The FormBlueprint has an attribute called someEntity, and the entity of type FormBlueprint may
have any object value in its `someEntity` attribute.


```json
{
"type": "dmss://system/SIMOS/Blueprint",
"name": "FormBlueprint",
"attributes": [
{
"attributeType": "string",
"type": "CORE:BlueprintAttribute",
"name": "type"
},
{
"attributeType": "string",
"type": "CORE:BlueprintAttribute",
"name": "name"
},
{
"type": "CORE:BlueprintAttribute",
"name": "someEntity",
"description": "Generic entity",
"attributeType": "object",
"contained": false
}
]
}
````


```json
{
"type": "dmss://DemoDataSource/plugins/form/blueprints/FormBlueprint",
"name": "exampleForm",
"someEntity": {
"type": "dmss://DataSource/objectBlueprint",
"name": "objectEntity",
"numberValue": 1232,
"booleanValue": false
},
...
}
````





### `any` type
The any type is another special type that should only be used internally in DMSS. Using it when modeling is not valid. This type is used in the `BlueprintAttribute` blueprint in DMSS, to make it possible for the `defaultValue` for a blueprint to have any type. Therefore, the `defaultValue` will not be validated in DMSS.

0 comments on commit 662f4fa

Please sign in to comment.