Add new code new version
[sdc.git] / dox-sequence-diagram-ui / src / main / webapp / lib / ecomp / asdc / sequencer / model / schema / asdc-sequencer-meta-schema.xsd
1 <xs:schema
2         xmlns:xs="http://www.w3.org/2001/XMLSchema"
3         targetNamespace="http://ns.ecomp.com/asdc/sequencer"
4         xmlns:s="http://ns.ecomp.com/asdc/sequencer"
5         attributeFormDefault="unqualified"
6         elementFormDefault="unqualified">
7
8     <!--
9
10         https://github.com/highsource/jsonix-schema-compiler/wiki/JSON-Schema-Generation
11
12         npm install -x-save-dev json-schema-generation
13
14         java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar \
15               -generateJsonSchema \
16               -d ./src/main/webapp/lib/ecomp/asdc/sequencer/schema/ \
17               -p asdc_sequencer_schema \
18               ./src/main/webapp/lib/ecomp/asdc/sequencer/schema/asdc-sequencer-meta-schema.xsd
19
20     -->
21
22     <xs:element name="diagram">
23         <xs:annotation>
24             <xs:documentation>
25
26                 Diagram meta-schema, defining what diagram documents may look like.
27
28                 The main difference between the metaschema (this) and the schema, is that
29                 the metaschema describes what's *allowed* rather than what *is*.
30
31                 Specific differences:
32
33                 1. The metaschema exists primarily to constrain lifelines; to declare any
34                     that are predefined, to prescribe cardinality, order and whether or not
35                     ad hoc lifelines may be created by the user.
36                 2. The metaschema doesn't constrain messages at all. This may come along later,
37                     but for now they're freetext, and can be defined between any legal pair
38                     of lifelines.
39                 3. The metaschema doesn't have @ref attributes; its @id attributes are the
40                     target of @ref attributes in the instance schema.m
41
42             </xs:documentation>
43         </xs:annotation>
44         <xs:complexType>
45             <xs:sequence>
46                 <xs:element name="metadata" type="s:metadataType"/>
47                 <xs:element name="lifelines" type="s:lifelinesType"/>
48             </xs:sequence>
49         </xs:complexType>
50     </xs:element>
51
52     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
53
54     <xs:complexType name="entityType" abstract="true">
55         <xs:annotation>
56             <xs:documentation>
57                 Common attributes, most importantly @id, which every entity must have.
58             </xs:documentation>
59         </xs:annotation>
60         <xs:sequence>
61             <xs:element name="notes" minOccurs="0">
62                 <xs:complexType>
63                     <xs:sequence>
64                         <xs:element name="note" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
65                     </xs:sequence>
66                 </xs:complexType>
67             </xs:element>
68         </xs:sequence>
69         <xs:attribute name="id" use="required" type="xs:string">
70             <xs:annotation>
71                 <xs:documentation>
72                     Schema definition identifier.
73                 </xs:documentation>
74             </xs:annotation>
75         </xs:attribute>
76         <xs:attribute name="name" use="required" type="xs:string">
77             <xs:annotation>
78                 <xs:documentation>
79                     Human-readable name.
80                 </xs:documentation>
81             </xs:annotation>
82         </xs:attribute>
83     </xs:complexType>
84
85     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
86
87     <xs:complexType name="metadataType">
88         <xs:annotation>
89             <xs:documentation>
90                 Diagram metadata, including:
91                  - Unique ID, referenced by @ref attributes in instance documents.
92                  - Human-readable description, displayed on-screen.
93             </xs:documentation>
94         </xs:annotation>
95         <xs:complexContent>
96             <xs:extension base="s:entityType"/>
97         </xs:complexContent>
98     </xs:complexType>
99
100     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
101
102     <xs:complexType name="lifelineType">
103         <xs:annotation>
104             <xs:documentation>
105                 Metadata concerning a single lifeline.
106             </xs:documentation>
107         </xs:annotation>
108         <xs:complexContent>
109             <xs:extension base="s:entityType">
110                 <xs:attribute name="mandatory" type="xs:boolean" use="optional" default="false">
111                     <xs:annotation>
112                         <xs:documentation>
113                             Whether an instance may omit this lifeline. Only takes effect
114                             where the lifelines setting is @delete=true.
115                         </xs:documentation>
116                     </xs:annotation>
117                 </xs:attribute>
118             </xs:extension>
119         </xs:complexContent>
120     </xs:complexType>
121
122     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
123
124     <xs:complexType name="lifelinesType">
125         <xs:annotation>
126             <xs:documentation>
127                 Metadata concerning allowed lifelines. Somewhat more strict that
128                 instance data.
129             </xs:documentation>
130         </xs:annotation>
131         <xs:complexContent>
132             <xs:extension base="s:entityType">
133                 <xs:sequence>
134                     <xs:element name="lifeline" type="s:lifelineType" minOccurs="0" maxOccurs="unbounded"/>
135                     <xs:element name="constraints">
136                         <xs:complexType>
137                             <xs:attribute name="create" type="xs:boolean" use="required">
138                                 <xs:annotation>
139                                     <xs:documentation>
140                                         Whether the user may create their own lifelines.
141                                     </xs:documentation>
142                                 </xs:annotation>
143                             </xs:attribute>
144                             <xs:attribute name="delete" type="xs:boolean" use="required">
145                                 <xs:annotation>
146                                     <xs:documentation>
147                                         Whether declared lifelines may be deleted.
148                                         See also @mandatory on lifeline.
149                                     </xs:documentation>
150                                 </xs:annotation>
151                             </xs:attribute>
152                             <xs:attribute name="reorder" type="xs:boolean" use="required">
153                                 <xs:annotation>
154                                     <xs:documentation>
155                                         Whether lifelines may be reordered.
156                                     </xs:documentation>
157                                 </xs:annotation>
158                             </xs:attribute>
159                         </xs:complexType>
160                     </xs:element>
161                 </xs:sequence>
162             </xs:extension>
163         </xs:complexContent>
164     </xs:complexType>
165
166 </xs:schema>