Add new code new version
[sdc.git] / dox-sequence-diagram-ui / src / main / webapp / lib / ecomp / asdc / sequencer / model / schema / asdc-sequencer-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-schema.xsd
19
20     -->
21
22     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
23
24     <xs:element name="diagram">
25         <xs:annotation>
26             <xs:documentation>
27                 Diagram state.
28             </xs:documentation>
29         </xs:annotation>
30         <xs:complexType>
31             <xs:sequence>
32                 <xs:element name="metadata" type="s:metadataType"/>
33                 <xs:element name="lifelines" type="s:lifelinesType"/>
34                 <xs:element name="steps" type="s:stepsType"/>
35             </xs:sequence>
36         </xs:complexType>
37     </xs:element>
38
39     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
40
41     <xs:complexType name="entityType" abstract="true">
42         <xs:annotation>
43             <xs:documentation>
44                 Stuff common to all entities; an identifier, a name, an optional
45                 schema reference, and some optional notes.
46             </xs:documentation>
47         </xs:annotation>
48         <xs:sequence>
49             <xs:element name="notes" minOccurs="0">
50                 <xs:complexType>
51                     <xs:sequence>
52                         <xs:element name="note" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
53                     </xs:sequence>
54                 </xs:complexType>
55             </xs:element>
56             <xs:element name="annotation" minOccurs="0">
57                 <xs:annotation>
58                     <xs:documentation>
59                         Optional annotations; non-structural information attached to any entity.
60                     </xs:documentation>
61                 </xs:annotation>
62                 <xs:complexType>
63                     <xs:sequence>
64                         <xs:any minOccurs="0"/>
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                     Entity identifier.
73                 </xs:documentation>
74             </xs:annotation>
75         </xs:attribute>
76         <xs:attribute name="ref" use="optional" type="xs:string">
77             <xs:annotation>
78                 <xs:documentation>
79                     Optional reference to schema definition, where this entity
80                     corresponds to (and is constrained by) a schema entity.
81                 </xs:documentation>
82             </xs:annotation>
83         </xs:attribute>
84         <xs:attribute name="name" use="required" type="xs:string">
85             <xs:annotation>
86                 <xs:documentation>
87                     Human-readable name.
88                 </xs:documentation>
89             </xs:annotation>
90         </xs:attribute>
91         <xs:attribute name="externalId" use="optional" type="xs:string">
92             <xs:annotation>
93                 <xs:documentation>
94                     ID of entity in originating system. For external use; not
95                     used by the sequencer widget.
96                 </xs:documentation>
97             </xs:annotation>
98         </xs:attribute>
99
100     </xs:complexType>
101
102     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
103
104     <xs:complexType name="metadataType">
105         <xs:annotation>
106             <xs:documentation>
107                 Diagram metadata, including name, identifier and schema reference.
108             </xs:documentation>
109         </xs:annotation>
110         <xs:complexContent>
111             <xs:extension base="s:entityType"/>
112         </xs:complexContent>
113     </xs:complexType>
114
115     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
116
117     <xs:complexType name="lifelineType">
118         <xs:annotation>
119             <xs:documentation>
120                 Definition of a single lifeline.
121             </xs:documentation>
122         </xs:annotation>
123         <xs:complexContent>
124             <xs:extension base="s:entityType"/>
125         </xs:complexContent>
126     </xs:complexType>
127
128     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
129
130     <xs:complexType name="lifelinesType">
131         <xs:annotation>
132             <xs:documentation>
133                 A set of lifelines. May be top-level or in a fragment.
134             </xs:documentation>
135         </xs:annotation>
136         <xs:complexContent>
137             <xs:extension base="s:entityType">
138                 <xs:sequence minOccurs="0" maxOccurs="unbounded">
139                     <xs:element name="lifeline" type="s:lifelineType"/>
140                 </xs:sequence>
141             </xs:extension>
142         </xs:complexContent>
143     </xs:complexType>
144
145     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
146
147     <xs:complexType name="occurrencesType">
148         <xs:annotation>
149             <xs:documentation>
150                 An occurrence at one or other end of a message.
151             </xs:documentation>
152         </xs:annotation>
153         <xs:attribute name="start" use="optional">
154             <xs:simpleType>
155                 <xs:list itemType="xs:token"/>
156             </xs:simpleType>
157         </xs:attribute>
158         <xs:attribute name="stop" use="optional">
159             <xs:simpleType>
160                 <xs:list itemType="xs:token"/>
161             </xs:simpleType>
162         </xs:attribute>
163     </xs:complexType>
164
165     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
166
167     <xs:complexType name="fragmentType">
168         <xs:annotation>
169             <xs:documentation>
170                 A fragment directive.
171             </xs:documentation>
172         </xs:annotation>
173         <xs:attribute name="start" type="xs:boolean" use="optional" default="false">
174             <xs:annotation>
175                 <xs:documentation>
176                     Whether fragment starts; fragment activated when @start=true.
177                 </xs:documentation>
178             </xs:annotation>
179         </xs:attribute>
180         <xs:attribute name="stop" type="xs:string" use="optional">
181             <xs:annotation>
182                 <xs:documentation>
183                     Indication of the last message in this fragment.
184                 </xs:documentation>
185             </xs:annotation>
186         </xs:attribute>
187         <xs:attribute name="operation" use="optional" default="alt">
188             <xs:annotation>
189                 <xs:documentation>
190                     Fragment operation. Start with the three everybody knows, but
191                     there are others.
192                 </xs:documentation>
193             </xs:annotation>
194             <xs:simpleType>
195                 <xs:restriction base="xs:string">
196                     <xs:enumeration value="alt"/>
197                     <xs:enumeration value="opt"/>
198                     <xs:enumeration value="loop"/>
199                 </xs:restriction>
200             </xs:simpleType>
201         </xs:attribute>
202         <xs:attribute name="guard" type="xs:string" use="optional">
203             <xs:annotation>
204                 <xs:documentation>
205                     Guard condition.
206                 </xs:documentation>
207             </xs:annotation>
208         </xs:attribute>
209     </xs:complexType>
210
211     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
212
213     <xs:complexType name="messageType">
214         <xs:annotation>
215             <xs:documentation>
216                 A message between lifelines.
217             </xs:documentation>
218         </xs:annotation>
219         <xs:complexContent>
220             <xs:extension base="s:entityType">
221                 <xs:sequence>
222                     <xs:element name="occurrences" type="s:occurrencesType" minOccurs="0" maxOccurs="1"/>
223                     <xs:element name="fragment" type="s:fragmentType" minOccurs="0" maxOccurs="1"/>
224                 </xs:sequence>
225                 <xs:attribute name="to" type="xs:string" use="required"/>
226                 <xs:attribute name="from" type="xs:string" use="required"/>
227                 <xs:attribute name="type">
228                     <xs:simpleType>
229                         <xs:restriction base="xs:string">
230                             <xs:enumeration value="request"/>
231                             <xs:enumeration value="response"/>
232                         </xs:restriction>
233                     </xs:simpleType>
234                 </xs:attribute>
235                 <xs:attribute name="asynchronous" type="xs:boolean" default="false"/>
236             </xs:extension>
237         </xs:complexContent>
238     </xs:complexType>
239
240     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
241
242     <xs:complexType name="guardType">
243         <xs:annotation>
244             <xs:documentation>
245                 Guard condition within a fragment. Some fragments have more than
246                 one section, each with their own guard condition.
247             </xs:documentation>
248         </xs:annotation>
249         <xs:sequence>
250             <xs:element name="guard" type="xs:string"/>
251             <xs:element name="steps" type="s:stepsType"/>
252         </xs:sequence>
253     </xs:complexType>
254
255     <!-- /////////////////////////////////////////////////////////////////////////////////////// -->
256
257     <xs:complexType name="stepsType">
258         <xs:annotation>
259             <xs:documentation>
260                 An ordered set of messages and subsequences.
261             </xs:documentation>
262         </xs:annotation>
263         <xs:complexContent>
264             <xs:extension base="s:entityType">
265                 <xs:sequence maxOccurs="unbounded">
266                     <xs:choice>
267                         <xs:element name="message" type="s:messageType"/>
268                     </xs:choice>
269                 </xs:sequence>
270             </xs:extension>
271         </xs:complexContent>
272     </xs:complexType>
273
274 </xs:schema>