aboutsummaryrefslogtreecommitdiffstats
path: root/dox-sequence-diagram-ui/src/main/webapp/lib/ecomp/asdc/sequencer/model/schema/asdc-sequencer-meta-schema.xsd
blob: f75063bed511bb0e0bb10da80ae15d705bee5f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<xs:schema
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://ns.ecomp.com/asdc/sequencer"
        xmlns:s="http://ns.ecomp.com/asdc/sequencer"
        attributeFormDefault="unqualified"
        elementFormDefault="unqualified">

    <!--

        https://github.com/highsource/jsonix-schema-compiler/wiki/JSON-Schema-Generation

        npm install -x-save-dev json-schema-generation

        java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar \
              -generateJsonSchema \
              -d ./src/main/webapp/lib/ecomp/asdc/sequencer/schema/ \
              -p asdc_sequencer_schema \
              ./src/main/webapp/lib/ecomp/asdc/sequencer/schema/asdc-sequencer-meta-schema.xsd

    -->

    <xs:element name="diagram">
        <xs:annotation>
            <xs:documentation>

                Diagram meta-schema, defining what diagram documents may look like.

                The main difference between the metaschema (this) and the schema, is that
                the metaschema describes what's *allowed* rather than what *is*.

                Specific differences:

                1. The metaschema exists primarily to constrain lifelines; to declare any
                    that are predefined, to prescribe cardinality, order and whether or not
                    ad hoc lifelines may be created by the user.
                2. The metaschema doesn't constrain messages at all. This may come along later,
                    but for now they're freetext, and can be defined between any legal pair
                    of lifelines.
                3. The metaschema doesn't have @ref attributes; its @id attributes are the
                    target of @ref attributes in the instance schema.m

            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="metadata" type="s:metadataType"/>
                <xs:element name="lifelines" type="s:lifelinesType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- /////////////////////////////////////////////////////////////////////////////////////// -->

    <xs:complexType name="entityType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                Common attributes, most importantly @id, which every entity must have.
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="notes" minOccurs="0">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="note" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="id" use="required" type="xs:string">
            <xs:annotation>
                <xs:documentation>
                    Schema definition identifier.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="name" use="required" type="xs:string">
            <xs:annotation>
                <xs:documentation>
                    Human-readable name.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <!-- /////////////////////////////////////////////////////////////////////////////////////// -->

    <xs:complexType name="metadataType">
        <xs:annotation>
            <xs:documentation>
                Diagram metadata, including:
                 - Unique ID, referenced by @ref attributes in instance documents.
                 - Human-readable description, displayed on-screen.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="s:entityType"/>
        </xs:complexContent>
    </xs:complexType>

    <!-- /////////////////////////////////////////////////////////////////////////////////////// -->

    <xs:complexType name="lifelineType">
        <xs:annotation>
            <xs:documentation>
                Metadata concerning a single lifeline.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="s:entityType">
                <xs:attribute name="mandatory" type="xs:boolean" use="optional" default="false">
                    <xs:annotation>
                        <xs:documentation>
                            Whether an instance may omit this lifeline. Only takes effect
                            where the lifelines setting is @delete=true.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- /////////////////////////////////////////////////////////////////////////////////////// -->

    <xs:complexType name="lifelinesType">
        <xs:annotation>
            <xs:documentation>
                Metadata concerning allowed lifelines. Somewhat more strict that
                instance data.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="s:entityType">
                <xs:sequence>
                    <xs:element name="lifeline" type="s:lifelineType" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="constraints">
                        <xs:complexType>
                            <xs:attribute name="create" type="xs:boolean" use="required">
                                <xs:annotation>
                                    <xs:documentation>
                                        Whether the user may create their own lifelines.
                                    </xs:documentation>
                                </xs:annotation>
                            </xs:attribute>
                            <xs:attribute name="delete" type="xs:boolean" use="required">
                                <xs:annotation>
                                    <xs:documentation>
                                        Whether declared lifelines may be deleted.
                                        See also @mandatory on lifeline.
                                    </xs:documentation>
                                </xs:annotation>
                            </xs:attribute>
                            <xs:attribute name="reorder" type="xs:boolean" use="required">
                                <xs:annotation>
                                    <xs:documentation>
                                        Whether lifelines may be reordered.
                                    </xs:documentation>
                                </xs:annotation>
                            </xs:attribute>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

</xs:schema>