Updating a Scheduled Task

160 Copyright © 2011 Open Geospatial Consortium Listing 31 - Update request example sps:Update service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:taskingParameters sps:ParameterData sps:encoding swe:TextEncoding tokenSeparator = , blockSeparator = sps:encoding sps:values Y,relativePositioning,Y,-10,N,N sps:values sps:ParameterData sps:taskingParameters sps:latestResponseTime 2010-08-20T12:41:00+02:00 sps:latestResponseTime sps:targetTask http:www.ogc.orgprocedurecamera1tasks6 sps:targetTask sps:Update Note: the tasking parameters available for update are a subset of the parameters described in the DescribeTaskingResponse - all parameters that have attribute updatable=false are not used in an update request. The description of the tasking parameter relevant for an Update request is shown in the following listing. Listing 32 - DataRecord example with tasking parameter description relevant for Update request swe:DataRecord xmlns:gml=http:www.opengis.netgml3.2 xmlns:swe=http:www.opengis.netswe2.0 xmlns:xlink=http:www.w3.org1999xlink xmlns:xsi=http:www.w3.org2001XMLSchema-instance swe:field name=positioningChoice swe:DataChoice optional=true swe:item name=pointToLookAt swe:Vector definition=http:www.opengis.netdefpropertyOGC-SPS-X- CAM0PointToLookAt referenceFrame=http:www.opengis.netdefcrsEPSG04979 swe:labelLook Pointerswe:label swe:description3D location where the camera should look atswe:description swe:coordinate name=lat swe:Quantity definition=http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLatitude axisID=Lat swe:labelGeodetic latitudeswe:label swe:uom xlink:href=deg swe:Quantity swe:coordinate swe:coordinate name=long swe:Quantity definition=http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLongitude axisID=Long swe:labelGeodetic longitudeswe:label swe:uom code=deg swe:Quantity swe:coordinate swe:coordinate name=h swe:Quantity definition=http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlVertical axisID=h swe:labelEllipsoidal heightswe:label swe:uom code=m swe:value0swe:value swe:Quantity swe:coordinate swe:Vector swe:item swe:item name=relativePositioning swe:DataRecord definition=http:www.opengis.netdefpropertyOGC-SPS-X- CAM0RelativePan swe:labelRelative Positioningswe:label swe:descriptionCamera movement relative to the current positionswe:description swe:field name=relativeHorizontalPan swe:Quantity definition=http:www.opengis.netdefpropertyOGC-SPS-X- CAM0RelativeHorizontalPan optional=true swe:uom code=deg swe:constraint Copyright © 2011 Open Geospatial Consortium 161 swe:AllowedValues swe:interval-180 180swe:interval swe:AllowedValues swe:constraint swe:Quantity swe:field swe:field name=relativeVerticalPan swe:Quantity definition=http:www.opengis.netdefpropertyOGC-SPS-X- CAM0RelativeVerticalPan optional=true swe:uom code=deg swe:constraint swe:AllowedValues swe:interval-90 90swe:interval swe:AllowedValues swe:constraint swe:Quantity swe:field swe:DataRecord swe:item swe:DataChoice swe:field swe:field name=focalLength swe:Quantity definition=http:www.opengis.netdefpropertyOGC-SPS-X- CAM0FocalLength optional=true swe:labelFocal lengthswe:label swe:descriptionFocal length of the camera. Controls the cameras zoom level.swe:description swe:uom code=mm swe:constraint swe:AllowedValues swe:interval3.5 10swe:interval swe:AllowedValues swe:constraint swe:Quantity swe:field swe:DataRecord 2010-08-20T12:40:01+02:00 – The service sends a response indicating that the final decision on the update is pending. The service confirms that the latest response time is 2010-08-20T12:41:00+02:00. Note that the response has a different task identifier than the one used in the request as the response informs about the status of the update request itself, not of the task that was the target of the request. This is necessary to get information about pending update requests via the GetStatus operation as we will see in the following. Listing 33 - Update response example indicating request is pending sps:UpdateResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance xmlns:swe = http:www.opengis.netswe2.0 sps:latestResponseTime 2010-08-20T12:41:00+02:00 sps:latestResponseTime sps:result sps:StatusReport sps:task http:www.ogc.orgprocedurecamera1tasks6updates1 sps:task sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Pending sps:requestStatus sps:updateTime 2010-08-20T12:40:01+02:00 sps:updateTime sps:StatusReport sps:result sps:targetTask http:www.ogc.orgprocedurecamera1tasks6 sps:targetTask sps:UpdateResponse 2010-08-20T12:41:01+02:00 – The client sends a GetStatus request to learn what the final decision for the update request was this request can of course also be sent before the latest response time. 162 Copyright © 2011 Open Geospatial Consortium Listing 34 - GetStatus response example targetting update request sps:GetStatus service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:task http:www.ogc.orgprocedurecamera1tasks6updates1 sps:task sps:GetStatus

9.6.5.8 Usage of LatestResponseTime

Now there are two options: either the service did or did not provide the final response on the update request before the latest response time.

9.6.5.8.1 Final Response Not Provided Before Latest Response Time

2010-08-20T12:41:02+02:00 – The service sends a response indicating that the update request automatically expired and therefore was automatically rejected. Listing 35 - GetStatus response indicating pending update request expired and was rejected sps:GetStatusResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:swes = http:www.opengis.netswes2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance sps:status sps:StatusReport sps:task http:www.ogc.orgprocedurecamera1tasks6updates1 sps:task sps:event TaskingRequestExpired sps:event sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Rejected sps:requestStatus sps:updateTime 2010-08-20T12:41:00+02:00 sps:updateTime sps:taskingParameters sps:ParameterData sps:encoding swe:TextEncoding tokenSeparator = , blockSeparator = sps:encoding sps:values Y,relativePositioning,Y,-10,N,N sps:values sps:ParameterData sps:taskingParameters sps:StatusReport sps:status sps:GetStatusResponse

9.6.5.8.2 Final Response is Provided Before Latest Response Time

2010-08-20T12:41:02+02:00 – The service sends a response indicating that the update was accepted and performed as planned. Copyright © 2011 Open Geospatial Consortium 163 Listing 36 - GetStatus response indicating pending update request was accepted sps:GetStatusResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:swes = http:www.opengis.netswes2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance sps:status sps:StatusReport sps:task http:www.ogc.orgprocedurecamera1tasks6updates1 sps:task sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Accepted sps:requestStatus sps:updateTime 2010-08-20T12:40:50+02:00 sps:updateTime sps:taskingParameters sps:ParameterData sps:encoding swe:TextEncoding tokenSeparator = , blockSeparator = sps:encoding sps:values Y,relativePositioning,Y,-10,N,N sps:values sps:ParameterData sps:taskingParameters sps:StatusReport sps:status sps:GetStatusResponse

9.6.5.9 Task Completion

2010-08-20T14:35:00+02:00 – The client sends a GetTask request to get a complete description of the task the service performed for him. The request is essentially the same as the one shown in Listing 26. 2010-08-20T14:35:01+02:00 – The service sends a response that includes the full state history of the task as the service supports state logging. Note: this example assumes that the task was submitted, not reserved first; intermediate data publication is shown as well a task update. Listing 37 - GetTask response for completed task sps:GetTaskResponse xmlns:sps=http:www.opengis.netsps2.0 xmlns:swe=http:www.opengis.netswe2.0 xmlns:swes=http:www.opengis.netswes2.0 xmlns:xsi=http:www.w3.org2001XMLSchema-instance sps:task sps:Task swes:identifierhttp:www.ogc.orgprocedurecamera1tasks6swes:identifier sps:status sps:StatusReport sps:taskhttp:www.ogc.orgprocedurecamera1tasks6sps:task sps:eventTaskSubmittedsps:event sps:percentCompletion0sps:percentCompletion sps:procedurehttp:www.ogc.orgprocedurecamera1sps:procedure sps:requestStatusAcceptedsps:requestStatus sps:taskStatusInExecutionsps:taskStatus sps:updateTime2010-08-20T11:12:04+02:00sps:updateTime sps:taskingParameters sps:ParameterData sps:encoding swe:TextEncoding tokenSeparator=, blockSeparator= sps:encoding sps:values2010-08-20T12:37:00+02:00,2010-08- 20T14:30:00+02:00,Y,pointToLookAt,51.902112,8.192728,0,Y,3.5sps:values sps:ParameterData sps:taskingParameters sps:StatusReport sps:status sps:status sps:StatusReport