IPASIService2017BeginIsDataAvailable Method Provincial Approach to Student Information API
The IsDataAvailable operation allows the caller to check for new data that is available to them.

Namespace: PASI.ServiceContract
Assembly: PASI.ServiceContract (in PASI.ServiceContract.dll) Version: 9.25.26.0 (9.25.26.0)
Syntax

IAsyncResult BeginIsDataAvailable(
	DataNotificationRequest request,
	AsyncCallback callback,
	Object asyncState
)

Parameters

request
Type: PASI.DataContract.V2009DataNotificationRequest
The DataNotificationRequest instance passed from the client to send which data types will be monitored, the current vesrion known on the client.
callback
Type: SystemAsyncCallback
This parameter is not passed or visible by the client. This parametered is passed in by WCF
asyncState
Type: SystemObject
This parameter is not passed or visible by the client. This parametered is passed in by WCF

Return Value

Type: IAsyncResult
A DataNotificationResponse indicating what, if any, data is different in the core than on the client.

This service will return a maximum of 150000 DataNotificationIdVersion objects per DataNotificationResultTypeInfo and an overall maximum of approximately 600000 objects. If there are more than 150000 objects for a given type the next call to IsDataAvailable will return the next set (to a maximum of 150000) based on the PASICoreVersion number passed to the service.

For example: if the IsDataAvailable returned 150000 student Ids and Versions where the highest version was 234987 then the next call to IsDataAvailable for the Student NotificationType should have the MaxPASICoreVersion set to 234987. This will ensure the PASI core will only look at records above this version. This process should repeat until all students have been synchronized.

IsDataAvailable will also limit the overall response to approximately 600000 total objects. For example: if the service was going to return 150000 Student, StudentStatus, StudentSchoolEnrolment and StudentSchoolEnrolmentStatus DataNotificationIdVersion objects but the client also was requesting CourseEnrolment, Section and Evaluated Mark (last within the request) the CourseEnrolment, Section and Evaluated Mark would not be returned. The client should continue to use a version of zero for these types until the expected data is received. This scenario is only likely the first time synchronizing with PASI with a large school authority.

These Id lists will be limited to the data that is visible to the PASI client. For example student Ids (Alberta Student Numbers) will be limited to the students the PASI client has access to through a valid association (i.e. the student is enrolled at the school for the connected client.)

**** Important Note for Hash Calculations ****
IsDataAvailable will return records that have been logically deleted (School Enrolments with a RegistrationStatus of "CreatedInError", CourseEnrolment IsDeleted=true, Section IsDeleted=true, EvaluatedMark IsDeleted=true etc). It is important for PASI to notify clients that records have been deleted. However (just so all clients are aware), these records should not be included in the version hash calculation. If PASI did not exclude logically deleted records the client would be forced to maintain the key and version indefinitely. This also applies to the corresponding status objects. Since there is no information on the status object if its related record has been logically deleted the status must be checked against the related record to decide if it should be included in the hash or not.

Service Validations

The following codes can be returned from the service operation. This list also shows core alerts that could be generated as a result calling this service. These codes are in addition to the standard set of codes that can be returned defined as in the Approach to Error Reporting. Click the link for the details.

3005, 3006, 3007, 3008
Remarks

An overview of the data synchronization approach can be found here.

The IsDataAvailable service operation provides a way for the user to check for updates to specific types of data (e.g. Student, StudentSchoolEnrolment, Section, CourseEnrolment, EvaluatedMark etc.) using the long-polling technique described in the General Approach section.

The Id that is returned from the IsDataAvailable service operation is a string value. While a number of Ids will be numeric there are some ids that require multiple values in order to uniquely identify a record. For Ids requiring multiple values the values will be comma separated.

For example: SchoolCalendarYear is uniquely identified by: School Code, School Year.
The Id will look like: 1234,2009
For this reason all Ids with this service will be treated as Strings.


Since this is a server side asynchronous service operation the service name exposed to the client is IsDataAvailable. There are two 'extra' arguments to support the asynchronous service the PASI client will not see. The name from the documentation will appearas "BeginIsDataAvailable" but the WSDL will only expose IsDataAvailable and that is the method that clients should call.

PASI supports full school year synchronization of several notification types for up to four school years. For more details see NotificationType
The calculation of which school years PASI is currently supporting full synchronization is based on the current date calendar year. Use the following to calculate the school years that are available.

Current Date Calendar Year + 1 = School Year That Can be Sync'd
Current Date Calendar Year - 0 = School Year That Can be Sync'd
Current Date Calendar Year - 1 = School Year That Can be Sync'd
Current Date Calendar Year - 2 = School Year That Can be Sync'd

Calling IsDataAvailable on an older school year will not produce an error but will not be able to calculate the correct hash value for the data type because not all data is available in for this service.

For more details on the types that can be synchronized see NotificationType

Request and Response Class Diagram



Request Fields

Full Property NameTypeRequiredOther Attributes
CallerInfoCallerInfoYes
CallerInfo.ClientMessageIDStringYesValue must be no more than 50 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.SentUtcTimeDateTimeYes
CallerInfo.SoftwareSoftwareYes
CallerInfo.Software.BuildNumberStringYesValue must be no more than 30 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.Software.ManufacturerStringYesValue must be no more than 100 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.Software.ProductStringYesValue must be no more than 100 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.Software.VersionStringYesValue must be no more than 30 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.UserUserYes
CallerInfo.User.IPAddressStringYesValue must be no more than 50 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.User.LocalIDStringYesValue must be no more than 50 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.User.NameStringYesValue must be no more than 100 characters Value must not have control characters, leading, trailing or multiple embedded spaces. Content must not match regular expression: ^\s|\s{2,}|\s$|[\x00-\x19]|[\x7F-\x9F]|[^\x00-\xFF]
CallerInfo.User.OrganizationCodeStringYesValue must be no more than 6 characters
RegisteredNotificationTypesList<DataNotificationRequestTypeInfo>Yes
RegisteredNotificationTypes.MaxPASICoreVersionInt64Yes
RegisteredNotificationTypes.NotificationTypeStringYes
RegisteredNotificationTypes.PASICoreVersionHashStringNo
WaitTimeInMinutesInt32Yes


Response Fields

Full Property NameTypeRequiredOther Attributes
DataNotificationResponse.NotificationResultTypeInfosList<DataNotificationResultTypeInfo>No
DataNotificationResponse.NotificationResultTypeInfos.IdListList<DataNotificationIdVersion>No
DataNotificationResponse.NotificationResultTypeInfos.IdList.IdStringNo
DataNotificationResponse.NotificationResultTypeInfos.IdList.PASICoreVersionInt64No
DataNotificationResponse.NotificationResultTypeInfos.NotificationTypeStringNo
DataNotificationResponse.NotificationResultTypeInfos.UpdateTypeStringNo
See Also

Reference