Base model example
This example demonstrates the common-base facility in action:
- one OpenAPI YAML document
- its OpenAPI HTML viewer
- datatype diagrams
This example requires Java 21 and Maven 3.9+.
The model and Maven build are authoritative inputs. The generated OpenAPI and diagram trees are replaceable and must not be edited manually; see the ownership matrix.
1. Model
package com.example.joinedworkz.quickstart
import org.joinedworkz.facilities.common.base.api
platform Base
resource /hello as Greeting {
create()
read()
}
type Greeting {
message: String
}2. Generated artifacts
The exact model above generates:
src/generated/resources/openapi/com.example.joinedworkz.quickstart.yamldiagram/api/com.example.joinedworkz.quickstart.htmldiagram/types/com.example.joinedworkz.quickstart_cmn.htmldiagram/types/org.joinedworkz.facilities.common.base.api_cmn.html
The exact one-model example has no component, application or process and therefore produces no diagrams for those model elements. More generally, the Base profile defines these user-facing default outlet patterns:
src/generated/resources/openapi/*.yaml– OpenAPI documentsdiagram/api/*.html– interactive OpenAPI viewersdiagram/**/*.html– type, component, application and process diagrams, depending on the modeled elements
Screenshots in the documentation show examples.
3. How to generate
mvn clean packageRun this in a JoinedWorkz project containing the model and the Base facility dependency. The joinedworkz-quickstart repository on release/1.3.81 is the canonical source project for this JoinedWorkz Quickstart. The step-by-step Quickstart contains the matching POM, model and build instructions.
This Base-only example generates specifications and diagrams. It does not generate Java sources or a runnable server application.
4. Next steps
- add more resources
- add pseudocode for process/call flow diagrams
- use with other facilities (Java, SpringBoot)
