Learn how to use CaseFu features
This is the CaseFu reference documentation. It defines all the syntactical features, specifies their usage and presents examples of how to use them.
Start with naming the system that you want to specify.
Add a description of the system and starting points into the FSD.
# systemName ...put system description here... ...put entry points into the documentation here...
Example FSD introduction:
# Acme Ordering system This is the Functional Specification Document for the Ordering system in Acme, Ltd. ## Menu ...
Specify the system's data model.
Define an entity:
## Entity: Entity name `EntityCode` ### Attributes: ...attribute definitions go here...
Entity name
is the name of the entity.EntityCode
can be used to link to this entity.
The EntityCode
is by convention in PascalCase.
The EntityCode
is optional, if omitted, it is derived from the entity name.
Example entity definitions:
## Entity: Customer ## Entity: Order ### Attributes: ...put Order attribute definitions here... ## Entity: Order item `OrderItem`
An entity consist of attributes:
...entity definition... ### Attributes: - Attribute name `attributeCode` (attributeStatus attributeDataType): exampleValue - attributeDescription - ...another attribute here...
Attribute name
is the name of the attribute.attributeCode
can be used to link to this attribute.
The attributeCode
is by convention in camelCase.
The attributeCode
is optional, if omitted, it is derived from the attribute name.
attributeStatus
is one of:
APK
, autoGeneratedPrimaryKey
:
primary key generated automatically by the database
NPK
, naturalPrimaryKey
:
natural (business) key of the entity that serves also as its primary key
FPK
, foreignPrimaryKey
:
foreign key that is at the same time the primary key
PK
, primaryKey
: primary keyFK
, foreignKey
: foreign keyOFK
, optionalForeignKey
: optional foreign keyNK
, naturalKey
: natural key (same as business key),
uniquely identifies the instance (unique and immutable)
BK
, businessKey
: business key (same as natural key),
uniquely identifies the instance (unique and immutable)
U
, unique
: unique valueOU
, optionalUnique
: optional unique valueM
, mandatory
: mandatory valueV
, version
: version for optimistic locking, mandatoryS
, status
: entity status, mandatoryC
, conditional
:
conditional value (optional or mandatory depending on other attribute values)
O
, optional
: optional valueRO
, readOnly
: read-only value1:1
, 1:N
, etc.
More formally, it is composed of 2 relation-side cardinalities separated by colon :
,
where a relation-side cardinality is one of:
1
0..1
1..1
N
0..N
1..N
N
code can also be written as n
or *
.
An M:N
relation cardinality is also supported.
attributeDataType
is the data type of the attribute.
You can put anything here.
enum:
(including the space at the end)
followed by the list of values separated by commas.
exampleValue
is an example of a value that the attribute may hold.
Providing an example value aids the reader in better understanding the attribute.
attributeDescription
is an optional description of the attribute.Example attribute definitions:
## Entity: Customer ### Attributes: - Name - Tax number `taxNo` (M varchar(14)) - The tax identification number of the company. - Mobile (O varchar(30)) - Status (S enum: created, approved, disabled) - Created by (n:1 `#User`)
Create mockups of the screens of the system you are building.
Define a screen:
## Screen: Screen name `/screen/code` ...put screen content here...
Screen name
is the name of the screen./screen/code
can be used to link to this screen.
The /screen/code
is by convention in the form of URI-like
/
‑delimited path.
The /screen/code
is optional, if omitted, it is derived from the screen name.
Example screens:
## Screen: Create order `/orders/create` ...put Create order screen content here... ## Screen: Orders ...put Orders screen content here... ## Screen: Order detail `/orders/detail` ...put Order detail screen content here...
A screen consists of forms and tables. To define a form use:
### Form: Form name ...form's fields go here... or: ### ReadOnlyForm: Form name ...form's fields go here...
Form:
- fields are by default optionalReadOnlyForm:
- fields are by default read onlyForm name
is an optional name of the form.Example form definition:
### Form: Customer ...put form fields here...
A form consists of fields.
Define a field as follows:
...form defined here... - Field name (fieldStatus fieldType: fieldTypeValue, fieldTypeValue, ...): fieldValue, fieldValue, ... - fieldHint - ...another field here...
Field name
is the name of the field.fieldStatus
is one of:
R
, required
: field is marked with a red asteriskO
, optional
RO
, readOnly
: field is not editablefieldType
is one of:
text
: plain text fieldpassword
: text field with the value hiddendate
: field is marked with a calendar icontime
: field is marked with a clock iconmultiLine
: multi-line text fieldcheckbox
: a checkbox field,
value is boolean (true
or false
)
select
:
a dropdown / combobox field that lets the user select a single value
from a list of available values
typeAhead
:
a text field that lets the user type in any value, but suggests values
from a list of available values
radios
:
list of radio buttons to select a single value from a list of fixed values
multiSelect
:
a dropdown / combobox field that lets the user select multiple values
from a list of available values
checkboxes
:
list of checkboxes to select multiple values from a list of fixed values
select
, typeAhead
, radios
,
multiSelect
and checkboxes
specify the field type values / options that will be available in the widget.
The values are separated by comma ,
.
select
or multiSelect
consists only of dashes -
, it will produce a non-selectable "separator".
fieldValue
is the value to pre-fill into the field.
For field types multiSelect
and checkboxes
there can be multiple field values separated by comma ,
.
fieldHint
is a hint to be displayed below the field for the user of the system.Example field definitions:
### Form: - First name - Last name (required text) - Birth date (R date) - Format DD/MM/YYYY. - Gender (radios: Male, Female) - Country (select: USA, Canada, UK, Germany, France): USA - I agree with terms and conditions (R checkbox): true - Agreement is mandatory to proceed. - Registered (RO): 6/7/2016 12:34
You can wrap a set of fields into a card to put them visually together. To define a field set use:
...form defined here... - FieldSet: Field set name - ...field-set fields defined here... - ...other form fields defined here...
Field set name
is an optional name of the field set.A field set can be used in any place a field could be used. This also means that field sets can be nested.
Example field set definition:
### Form: Order - Order number - FieldSet: Customer - Name - Tax number - FieldSet: Contact - Name - E-mail
A screen consists of forms and tables. To define a table use:
### Table: Table name ...table's columns go here...
Table name
is an optional name of the table.Example table definition:
### Table: Order items ...put table columns here...
A table consists of columns. Define a column as follows:
...table defined here... - Column name (fieldStatus fieldType: fieldTypeValue, fieldTypeValue, ...) - columnValue - columnValue - ... - ...another column here...
where fieldStatus
, fieldType
and fieldTypeValue
are defined in the Fields section above.
Example column definitions:
### Table: Order items - Product (R text) - Cigar - Pabst Blue Robot beer 6-pack - BendërBrau ColdFusion Stream Beer Premium - Unit price (R) - 2.35 - 3.24 - 3.49 - Quantity (R) - 8 - 1 - 4 - Item total - 18.8 - 3.24 - 13.96
Within screen mockups you can create notes that specify the functionality of the system.
To distinguish them from the regular screen mockup itself,
use block-quotes. Start the row with greater-than character >
:
> System functionality specification.
The functional notes are displayed with yellow background.
Example link reference definitions:
...an action button is defined here... > On pressing this button > the system will perform such and such action.
To create an actor:
## Actor: Actor name `ActorCode` ...actor description and goals specification go here...
Actor name
is the name of the actor.ActorCode
can be used to link to this actor.
The ActorCode
is by convention in PascalCase.
The ActorCode
is optional, if omitted, it is derived from the actor name.
Example actor definitions:
## Actor: Sales ### Goals - [Create order](#OR-100) - [List orders](#OR-110) ## Actor: Shipping ...goals of Shipping actor go here...
To create a use case:
## UC: `Use-case-code` Use case name - Actors: linksToPrimaryActors - ...other use case properties ### Main success scenario: 1. Step. 2. ...other steps... ### Extensions: - Extension: - Extension step. - ...other extension steps... - ...other extensions...
Use-case-code
can be used to link to this use case.
The Use-case-code
is by convention dash-separated.
The Use-case-code
is optional, if omitted, it is derived from the use case name.
Use case name
is the name of the use case.linksToPrimaryActors
list the primary actors of the use case.Example use case definition:
## UC: `OR-100` Create order - Actors: `#Sales` - Level: User goal ### Main success scenario: 1. User enters order data. 2. User enters order item data. 3. System calculates the `Item total` for each item and `Invoice total` for the whole order. 4. User saves the order. 5. System validates the data. 6. System creates new `#Order`. ### Extensions: - 2a. User wants to order more than 1 item: - 2a1. User adds more item rows and fills them in. - 2b. User wants to remove an item from the order: - 2b1. User deletes the item row. - 5a. [Due date](#Order.dueDate) is in past: - 5a1. System displays error: Must be in future.
References to other items of the FSD can be created via links and buttons.
Define a link referencing to an item of the FSD:
[linkLabel](#referredCode "linkTitle")
linkLabel
is the label of the link.referredCode
is a code of either:
EntityCode.attributeCode
linkTitle
is an optional title of the link.Example link reference definitions:
Links to entities: - [Order](#Order) - [Customer](#Customer) Links to screens: - [List orders](#/orders) - [Display order](#/orders/detail) Links to use cases: - [Create order](#OR-100) - [Delete order](#OR-190) Links to entity attributes: - [Order number](#Order.orderNumber) - [Customer name](#Customer.name)
You can use a shortcut to define a reference link where the link label is the same as the referred item code:
`#referredCode`
referredCode
is a code of a referred item,
see section Links above.
Example auto-reference definitions:
Auto-reference links: - `#Order` - `#Customer` - `#OR-100` - `#OR-190` - `#Order.orderNumber` - `#Customer.name`
To define a button use:
[buttonType: linkLabel](#referredCode "linkTitle")
buttonType
is an optional type of the button, one of:
primary
, secondary
, success
, danger
,
warning
, info
, light
, dark
outline-
,
e.g. outline-primary
etc.
linkLabel
is the label of the button.referredCode
is a code of a referred item,
see section Links above.
linkTitle
is an optional title of the button.Example button definitions:
Buttons: - [:Default]() - [warning: Disable]() - [primary: Save](#/customers/detail)
You can use the following means to format the text.
All the sources are processed by Markdown parser Marked. See Markdown at Wikipedia or Markdown cheatsheet for more details.
### Heading level 3 #### Heading level 4 Paragraphs are separated by a blank line. Two spaces or a backslash at the end of a line leave a\ line break. Text attributes _italic_, *italic*, __bold__, **bold**, `monospace`. Bullet list (use -, * or +): - apples - oranges - pears Numbered list: 1. apples 2. oranges 3. pears A [link](http://example.com).
Output:
Paragraphs are separated by a blank line.
Two spaces or a backslash at the end of a line leave a
line break.
Text attributes italic, italic, bold, bold,
monospace
.
Bullet list (use -, * or +):
Numbered list:
A link.
You can use HTML code directly in Markdown.
This is <span style="color: red;">red</span>.
Output:
This is red.
Bootstrap is available, see Bootstrap documentation for more details.
<div class="alert alert-danger"> This is an <strong>error</strong> alert. </div>
Output:
You can use Font Awesome icons, see Font Awesome icons for more details.
This is correct. <i class="fas fa-check"></i>\ This is wrong. <i class="fas fa-times"></i> [warning: <i class="far fa-trash-alt"></i>]()
Output:
This is correct.
This is wrong.
UML diagrams are supported via PlantUML, see PlantUML documentation for more details.
Create a code block with language set to plant
:
```plant note "Order state diagram" as N1 [*] --> Worksheet : Customer: createOrder Worksheet --> Submitted : Customer: submitOrder Submitted --> Delivered : Delivery: deliverOrder ```
Output: