Room

This integration is a web service.  It is called via a batch job.  Data will be retrieved from Aim, via a web service.  The data is in JSON format.  The batch job will execute using Spring Batch to retrieve the data, insert or update records in the database, and send an email with a report file attached.



Test URLhttps://aimdev.uconn.edu/api/index?key=[API KEY]&method=LOC_UPDATES&days=7&format=json
Stage URLhttps://aimtest.uconn.edu/api/index?key=[API KEY]&method=LOC_UPDATES&days=7&format=json
Prod URLhttps://aim.uconn.edu/api/index?key=[API KEY]&method=LOC_UPDATES&days=7&format=json

The Aim links are included in the Batch Properties file on the AEWEB server. The days= parameter can be adjusted to capture data for a longer period of time or for a lesser period of time. It is currently set at 7 days.


Aim Web Service Documentation

Test Aim from local machine

Access/permission to the Aim site is needed.  Contact Aim ITS Administrator for access.  Provide IP address and machine name.

Sample JSON Room input

[{"CAMPUS_ID":"01",

"CAMPUS_DESCRIPTION":"STORRS CAMPUS",

"BLDG":"0185",

"BLDG_DESCRIPTION":"MANSFIELD APTS BLDG 09 (4 UNITS)",

"FLOOR":"01",

"ROOM":"APT93",

"ROOM_DESCRIPTION":"Apartment",

"LOC_TYPE":"950",

"LOC_TYPE_DESCRIPTION":"Apartment",

"LOC_STATUS":"IN SERVICE",

"LOC_COMPANY":"UCONN",

"LOC_DEPT":"1000",

"LOC_DEPT_DESCRIPTION":"President",

"LOC_ORG":"1665",

"LOC_ORG_DESCRIPTION":"Residential Life",

"LOC_SPACE_TYPE":"ASSIGNABLE",

"LOC_CAPACITY":"0",

"LOC_PRI_USAGE":"AX",

"LOC_PRI_USAGE_DESCRIPTION":"Auxiliary",

"LOC_ASSIGNMENT_ID":null,

"LOC_GROSS_SQFT":"452.8800",

"LOC_USEABLE_SQFT":"452.8800",

"LOC_ASSIGNABLE_SQFT":"452.8800",

"LOC_NONASSIGNABLE_SQFT":"0",

"LOC_PLOYLINE_SQFT":"452.8800",

"LOC_SURVEY_ROLLUP_SQFT":"0"}}

Source Code Definition for Aim Room Data

JSON formatted
edu.uconn.webapi.model.aim.AimRoom.java

KFS Table Definition

SH_Room_T  

java field Aim fieldDescription
CAMPUS_CDcampusCodeCAMPUS_ID
BLDG_CDbuildingCode BLDG
BLDG_ROOM_NBRbuildingRoomNumberROOM
OBJ_ID    objectID        
if new room, create new OBJ_ID
VER_NBRversioNumber
if new room, set version number to 1
BLDG_ROOM_TYPEbuildingRoomTypeLOC_DEPT_DESCRIPTION
BLDG_ROOM_DEPTbuildingRoomDepartmentLOC_ORG_DESCRIPTION
BLDG_ROOM_DESCbuildingRoomDescription LOC_TYPE_DESCRIPTION
ROW_ACTV_IND  activeIndicator   LOC_STATUSwhen Aim is "DISPOSED", set KFS to "N", otherwise set to "Y"

Requirements

  1. When the room does not exist in KFS, create an object id in KFS using java.util.UUID.randomUUID().toString() and set the version number to 1.
  2. When the room status in Aim is “DISPOSED”, the set the active indicator in KFS to “N”, otherwise set it to “Y”.
  3. Truncate campus code, room type, and room dept so that it matches the length in KFS (to prevent a SQL error).
  4. When the room exists in KFS, just update the row with the supplied data, otherwise insert a new row using the supplied data.
  5. Create a formatted report file to list all transactions.  The first line of the file is contains the process date and report title, the second line contains the column headings, and the last line of the file is “***End of Report ***”.
  6. Send an email to inventorycontrol@uconn.edu with the input JSON in the body and the formatted report as an attachment.
  7. If there are SQL errors, capture and print the error.

Location and name of the report file

uconn_configs/webapi/config/batch
roomData_yyyymmdd_hhMMSS_SSS.txtwhere yyyy = year, mm=month, dd=day, hh=hour, MM = minute, SS=seconds, SSS=sequence number

Sample Report

(Use Notepad++ to view)

roomData_20200507_105737_319.txt

Execution Command


/webapi/updateRoomsFromAim.html

Control-M Schedule and Job




UATUAT_AEWEB_AIM_SCHEDULE_1UAT_AEWEB_FROM_AIM_ROOM
PRDPRD_AEWEB_AIM_SCHEDULE_1PRD_AEWEB_FROM_AIM_ROOM

The UAT job is manually loaded and run. The production job is scheduled to run every Friday evening. If this job is to be moved, the days= parameter in the batch properties files may need to be adjusted. 


Control-M Job Definition Forms