Example: Itron On-Demand Read Process
This section provides an example of an asynchronous command, the On-Demand Read command supported by the Itron OpenWay adapter.
The Itron www.itron.com.ami.2008.10.data.wsdl definition contains a series of commands for an On-Demand Read process. The Smart Grid Gateway adapter for Itron OpenWay initiates the process by invoking the ContingencyReadByEndpoints method. The reply contains a “request token ID” that identifies the entire flow and will be shared by subsequent communications. On the Itron side, a job for collecting usage and events is configured. To inform the caller (SGG) that the job is starting, Itron sends a StatusChanged request (defined in www.itron.com.ami.2008.10.common.wsdl) containing “State = Initialized”. Itron sends another StatusChanged request to notify SGG that the process of gathering the usage is underway. As the usage is collected, Itron submits one or more DataArrived requests to SGG. When Itron has finished making internal requests for usage, it sends a final StatusChanged request to SGG. That completion notification informs SGG that it should submit GetContingencyReadByEndpointsResult, the reply to which contains information about errors encountered during the process.
The image below illustrates the process flow used by this command.
![](../images/Itron-ContingencyReadByEndpoints.jpg)
Below is a summary of the important features of the Smart Grid Gateway implementation of this command. Many of the concepts can be applied when creating a custom synchronous command.
Command Activity — On-Demand Read (Interval)
Business Object: D1-OnDemandReadInterval
Lifecycle and Algorithms
The table below outlines some of the important algorithms used by the On-Demand Read (Interval) command activity.
Lifecycle State | Algorithms |
---|---|
Validate |
The important features here are not the specific algorithms, but rather the ability to perform validation logic at a process level.
|
Connection Ready |
Once the Outbound Communication record is created, the Activity business object moves from the Connection Ready state to the Communication In Progress state. When the outbound communication is complete, it moves the Activity to next default state, which is Connection Ready (the activity moves from Communication In Progress back to Connection Ready). The outbound communication will also set the “isOnDemandReadComplete” flag value in the activity business object, in this case, indicating the outbound communication for a particular processing role was created. If the condition is true, the processing moves on to next algorithm.
|
Waiting for Measurement |
|
Outbound Communication — Itron - Contingency Read (Interval)
Business Object: D8-ReadIntervalDR
Schema
The portions of the schema that contain the payload of the web service request and response communications are the sendDetail element (constructed using the D8-ContingencyReadRequestDR data area) and the responseDetail element (constructed using the D8-ContingencyReadResponDtlDA data area). The XSLs used to create or decipher XML conforming to the Itron structure use these elements as a basis.
Lifecycle and Algorithms
The table below outlines some of the important algorithms used by the Contingency Read outbound communication.
Lifecycle State | Algorithms |
---|---|
Validate |
|
Awaiting Response |
|
Response Error |
|
Completed |
|
Inbound Communication — Itron - StatusChanged
Business Object: D8-StatusChanged
This business object handles the inbound StatusUpdate requests. It contains the request token ID created by the initial request. When it receives schema values of “State = Completed” and Result of either Canceled or Success, it triggers the next command in the Activity. For On-DemandRead, the next command is GetContingencyReadByEndpointsResult.
Schema
Unlike other communications containing sendDetail or responseDetail elements, this business object contains an input element with child elements that map to the those within the StatusChanged XSD definition.
Lifecycle and Algorithms
The table below outlines some of the important algorithms used by the Status Changed Read inbound communication.
Lifecycle State | Algorithms |
---|---|
Validate |
|
Evaluate Response |
|
Outbound Communication — Itron - On Demand Read Result
Business Object: D8-ReadOnDemandReadResultDR
This is the second of two outbound requests within the Itron Contingency Read API. The outbound request submits the request token ID. The response contains error information collected by the Itron server during the execution of the Contingency Read process.
Schema
The portions of the schema that contain the payload of the web service request and response communications are the sendDetail element (constructed using the D8-ReadODRResultRequestDR data area) and the responseDetail element (constructed using the D8-ReadODRResultResponseDR data area). The XSLs used to create or decipher XML conforming to the Itron structure use these elements as a basis.
Lifecycle and Algorithms
The table below outlines some of the important algorithms used by the On-Demand Read Result outbound communication.
Lifecycle State | Algorithms |
---|---|
Awaiting Response |
|
Evaluate Response |
|
Service Script: Itron - DataArrived Request
This Groovy—based service script handles the incoming DataArrived requests. It saves the payload to file storage locations (including Cloud Object Storage buckets in the case of cloud implementations) based on configuration.
Schema
The schema maps closely to the Itron DataArrived message. It includes the D8-DataArrived data area.
Steps
Step 10 Edit Data – Invoke Main Groovy Method
This step shows how to trigger a Groovy script from other OUAF objects. It is similar to a main method in other programming languages. In this case, it is called by an Inbound Web Service method.
Step 20 – Groovy Imports
This step imports other classes needed by the script.
Step 30 – Groovy Members
-
Look up the Master Configuration object
-
Use the Master Configuration to find the File Storage details
-
Find the File Adapter type
-
Compute a filename using a configured generation script
-
Compute a fill URL using the bucket, filename, and other details
-
-
Use the FileStorageAdapter business service to save the file to the targeted location.
Message Sender XSLs
Outbound messages created by on-demand read outbound communications use the following XSL files:
ContingencyReadByEndpoints
- Request XSL: D8-ContinegencyReadByEndpointsRequest.xsl
- Response XSL: D8-ContingencyReadByEndpointsResponse.xsl
GetContingencyReadByEndpointsResult
- Request XSL: D8-GetContingencyReadByEndpointsResultRequest.xsl
- Response XSL: D8-GetContingencyReadByEndpointsResultResponse.xsl
Refer to Creating Message Senders for more information about creating message senders.
Inbound Web Services
The Itron on-demand read process uses the following inbound web services.
D8-RequestStatusChangedService
- Operation Name: StatusChanged
- Schema Name: Itron — Status Changed BO
- Request XSL: D8-RequestStatusChangedServiceRequest.xsl
- Response XSL: D8-RequestStatusChangedServiceResponse.xsl
D8-DataSubscriberService
- Operation Name: DataArrived
- Schema Name: Itron — DataArrived Request Script
- Request XSL: D8-DataSubscriberServiceRequest.xsl
- Response XSL: D8-DataSubscriberServiceResponse.xsl