State machine notation from UML State machine for WFS locking
OpenGIS
©
Specification OGC 04-094
Copyright © Open Geospatial Consortium, Inc 2005
58
the states. All other state transitions are disallowed and are consider errors if exhibited by a server.
A physical server may support more than one lock. Each of the locks is independent when viewed from the service defined by the WFS specification.
In the state model below, a transition is typically triggered by a request. Following the messaging model, a WFS Request is paired with a WFS Response. Note that a request-
response pair cannot be started while it is active. The request may be cancelled by a HTTP-level command.
LockFeature Request
Lock
Active Lock
Processing Transaction
Some lock requests failed Lock action = All
LockFeature Response
Some lock requests failed Lock action = Some
LockFeature Response All lock requests succeeded
LockFeature Response
Transaction Request Error occurs, e.g., invalid lock
Transaction Response Requesting
Lock
Lock expires
Processing complete, Some features not modified,
Release action = some Set lock ID = valid,
Transaction Response Transaction Request
Set lock ID = invalid, LockFeature Response
Processing complete Release action = all
Transaction Response Processing complete,
All features modified, Release action = some
Transaction Response All lock requests failed
LockFeature Response
Figure 4 –State diagram for a WFS lock
OpenGIS
©
Specification OGC 04-094
Copyright © Open Geospatial Consortium, Inc 2005
59 11.3 Response
The following XML Schema fragment defines the XML encoding of a LockFeature request:
xsd:element name=LockFeatureResponse type=wfs:LockFeatureResponseType
xsd:complexType name=LockFeatureResponseType xsd:sequence
xsd:element ref=wfs:LockId xsd:element name=FeaturesLocked
type=wfs:FeaturesLockedType minOccurs=0 xsd:element name=FeaturesNotLocked
type=wfs:FeaturesNotLockedType minOccurs=0 xsd:sequence
xsd:complexType xsd:complexType name=FeaturesLockedType
xsd:sequence maxOccurs=unbounded xsd:element ref=ogc:FeatureId
xsd:sequence xsd:complexType
xsd:complexType name=FeaturesNotLockedType xsd:sequence maxOccurs=unbounded
xsd:element ref=ogc:FeatureId xsd:sequence
xsd:complexType
In response to a LockFeature request, a web feature service shall generate an XML document. This document will contain a lock identifier that a client application can use
in subsequent WFS operations to operate upon the set of locked feature instances. The response may also contain the optional elements FeaturesLocked and
FeaturesNotLocked depending on the value of the lockAction attribute.
If the lock action is specified as ALL and all identified feature instances can be locked, a WFS must respond with a WFS_LockFeatureResponse element that contains the
FeaturesLocked element and no FeatureNotLocked element since either all identified feature instances can be locked or none at all. If some or all feature instances
cannot be locked, a WFS must response with an exception indicating that the lock request failed because some or all feature instances are locked by other clients.
If the lock action is specified as SOME, then the WFS_LockFeatureResponse element must contain the FeaturesLocked and FeatureNotLocked elements.. The
FeaturesLocked element shall list the feature identifiers of all the feature instances that were locked by the LockFeature request. The FeaturesNotLocked element shall
contain a list of feature identifiers for the feature instances that could not be locked by the web feature service possibly because they were already locked by someone else.
No assumption is made about the format of the lock identifier. The only requirement is that it can be expressed in the character set of the transaction request.
If a lock request results in no features being locked, then a WFS should respond with WFS_LockFeatureResponse document that contains a value for the lockId attribute
but that contains neither a FeaturesLocked element nor a FeatureNotLocked element. In other words, an empty response. After the request is completed, the lockId
OpenGIS
©
Specification OGC 04-094
Copyright © Open Geospatial Consortium, Inc 2005
60
should be immediately released since no resources were locked. If that same lockId is used in a subsequent transaction, an exception should be raised since it no longer exists.