Weather Callout Java and Rule Projects
- Last Updated: March 24, 2022
- 2 minute read
- Corticon
- Version 6.3
- Documentation
Corticon Studio includes a sample project that shows how service callouts can be reused when they can be parameterized so that each instance can have a different configuration.
The Weather Callout Java Project is a Java
project that includes the source code for a service callout to call the REST API on
OpenWeatherMap.org to retrieve weather data for
individual cities. The Weather Callout Rule Project uses the
callout in the Java project to retrieve data for cities specified in Location entities. The service callout is specific to
the vocabulary in that it looks for Location
entities with specific attributes. To retrieve live weather data for a city you need
to create an account on http://openweathermap.org/, and then generate an API key that you
provide as a property on the callout. By default, the keyword 'demo' is used, and
sample weather data is generated.
src folder with the
source code for the weather callout and has on its build path the standard Java
system library, org.json-20120521.jar, and CcExtensionApi.jar. src folder contains the source
code for two Java classes. weather_service.jar. The Weather Callout sample is accessed from the Studio's Help > Samples in the Advanced section.