While the FEL 4 is intended primarily as a service implementation, a set of client facades are available as a separate package for offline development. The facade pack includes facades for the ConnectionString, DotCode, OrgCode, and Staff services with data extracts included in the package to serve as a local data store. To use the facade pack, first add it to your project from NuGet by opening the FDOT NuGet Repository, selecting Fdot.Enterprise.Facades, and clicking "Install". Note that adding the facades to your project also adds the client contracts for the ConnectionString, DotCode, OrgCode, and Staff services along with the core assembly.
Local data
Installing the facades package will also add a LocalData folder to your project, which contains the local data extracts for each of the services in JSON format. Those can be modified as necessary to mock data. For example, a new DoT code collection can be added by creating a new file containing a JSON array of objects conforming to the IDotCode interface, or appending the new values to an existing array.
Application configuration settings
Local data will only be used if valid path settings are specified in the application configuration file. Either a directory or specific file path can be provided for most services; however, care must be taken with the staff data since it requires three different types of data files (staff members, delegates, and delegate connectors). If a file path is provided, then data for a given service will only be loaded from that file. If the path is a directory, then all files in that path will be loaded. For that reason, the staff data either needs to be split across different directories, or each type of data contained in a single file - all data residing at the target path must be of the same type.
Examples
<add key="ConnectionStringFacade.LocalDataPath" value="..\..\localdata\connections\connections.json" />
<add key="DotCodeFacade.LocalDataPath" value="..\..\localdata\dotcodes" />
<add key="OrgCodeFacade.LocalDataPath" value="..\..\localdata\orgcodes" />
<add key="StaffFacade.LocalDataPath" value="..\..\localdata\staff\all-staff.json" />
<add key="StaffFacade.LocalDataPath.Delegates" value="..\..\localdata\staff\delegates.json" />
<add key="StaffFacade.LocalDataPath.DelegateConnectors" value="..\..\localdata\staff\delegate-connectors.json" />
The majority of the service methods are read only; however the staff service also supports delegate management. This can be emulated with local data by adding the following key and setting its value to true, allowing delegate updates to be persisted to local data. Note that because the data is stored as a file, multiple developer environments using shared local data should exercise care when enabling local data persistence to avoid file contention issues. To help mitigate this concern, the local data is read and loaded into memory at the application's start and persisted immediately at the time of the update. For reference, the delegate and delegate connector data sources are updated during delegate management.
<add key="StaffFacade.DoPersistLocalUpdates" value="false" />
When developing internally, or with via VPN, it may not be obvious whether local data was configured properly and is being used, or whether the services are being called. By default, the facades will look for local data on the configured paths and, on failing to either find or load it, will switch over to use available services. That process begins with a check against the discovery proxies, whose responsibility it is to return the endpoints for services honoring a given contract. Should the discovery calls fail, or if the discovery proxies fail to return any endpoints, the host address and an endpoint address pattern are used to try a service by convention. Adding the following values will prevent the facades from being able to successfully call a service. An exception will be thrown on the attempt to connect, which will provide clear indication that local data was not loaded correctly.
<add key="DiscoveryProxies" value="" />
<add key="HostAddress" value="" />
IConnectionString
Example
[
{"Key":"FEL_SAMPLE_U", "Value":"DATA SOURCE=D9UT24;USER ID=SOMEUSER;PASSWORD=p@$$w0rd"}
]
Property constraints
Property | Type | Max |
---|
ColumnName | string | 18 |
ColumnDescription | string | 18 |
Value | string | 8 |
Description | string | 30 |
IDotCode
Example
[
{"ColumnName":"MYNEWCODES","ColumnDescription":"MYNEWCODES","Value":"CODE1","Description":"Code Value 1"},
{"ColumnName":"MYNEWCODES","ColumnDescription":"MYNEWCODES","Value":"CODE2","Description":"Code Value 2"}
]
Property constraints
Property | Type | Max |
---|
ColumnName | string | 18 |
ColumnDescription | string | 18 |
Value | string | 8 |
Description | string | 30 |
IOrgCode
Example
[
{
"Description":"TURNPIKE INFORMATION TECH OFC",
"ShortTitle":"TPK IT",
"Status":"ACTIVE",
"StatusChangeDate":"\/Date(991713600000)\/",
"District":"08",
"CostCenter":"018",
"Level1":"55",
"Level2":"08",
"Level3":"30",
"Level4":"00",
"Level5":"018",
"FullOrgCode":"55083000018"
}
]
Property constraints
Property | Type | Max | Notes |
---|
Description | string | 60 |
ShortTitle | string | 10 |
Status | string | 12 |
StatusChangeDate | Date | 4 |
District | string | 2 | same as Level2 |
CostCenter | string | 3 | same as Level5 |
Level1 | string | 2 |
Level2 | string | 2 | same as District |
Level3 | string | 2 |
Level4 | string | 2 |
Level5 | string | 3 | same as CostCenter |
FullOrgCode | string | 11 | concatenation of Level1 + Level2 + Level3 + Level4 + Level5 |
IStaffMember
Example
[{
"PrimaryId":1,
"ExternalIds":[1],
"Active":true,
"ActualSupervisorPosition":null,
"StatusTimestamp":"\/Date(1228906826000)\/",
"FirstName":"TEST",
"LastName":"USER",
"MiddleName":"Q",
"BeginDate":{"Value":"\/Date(589176000000)\/"},
"EndDate":null,
"StaffType":
{
"ColumnName":null,
"ColumnDescription":null,
"Value":"CONSULTN",
"Description":"CONSULTANT STAFF"
},
"District":"99",
"RacfId":"MCLKCTU",
"PeopleFirstId":"00199999",
"ConsultantId":null,
"Position":"",
"EmailAddress":"",
"Signature":"",
"Phone":"3865551212",
"PhoneExtension":"",
"Fax":"3865551212",
"Building":"MC LAKE CITY FIELD OFFICE",
"Office":"",
"Room":"",
"MailStation":"99",
"LastUpdateUserId":"SRSLOAD",
"LastUpdateTimestamp":"\/Date(1329306916000)\/",
"PositionWorkTitle":"OFFICER - MOTOR CARRIER",
"OrganizationalCode":
{
"Description":"MOTOR CARRIER SIZE \u0026 WEIGHT",
"ShortTitle":"MOTOR CARR",
"Status":"ACTIVE",
"StatusChangeDate":"\/Date(1326085200000)\/",
"District":"65",
"CostCenter":"995",
"ManagerPosition":null,
"Level1":"55",
"Level2":"65",
"Level3":"40",
"Level4":"00",
"Level5":"995",
"FullOrgCode":"55654000995"
},
"ClsfFamily":"",
"ClsfGroup":"",
"ClsfOccupation":"",
"StaffTypeEnum":4,
"ExtensionData":{}
}]
Property constraints
Property | Type | Max |
---|
PrimaryId | int | n/a |
ExternalIds | int array | n/a |
Active | bool | n/a |
ActualSupervisorPosition | string | 6 |
StatusTimestamp | date | n/a |
FirstName | string | 25 |
LastName | string | 30 |
MiddleName | string | 25 |
BeginDate | date | n/a |
EndDate | date | n/a |
StaffType | IDotCode | n/a |
District | string | 2 |
RacfId | string | 8 |
PeopleFirstId | string | 10 |
ConsultantId | string | 9 |
Position | string | 2 |
EmailAddress | string | 230 |
Signature | string | 200 |
Phone | string | 10 |
PhoneExtension | string | 5 |
Fax | string | 10 |
Building | string | 30 |
Office | string | 80 |
Room | string | 10 |
MailStation | string | 10 |
LastUpdateUserId | string | 8 |
LastUpdateTimestamp | date | n/a |
PositionWorkTitle | string | 80 |
OrganizationalCode | IOrgCode | n/a |
ClsfFamily | string | 50 |
ClsfGroup | string | 50 |
ClsfOccupation | string | 68 |
StaffTypeEnum | n/a | n/a |
ExtensionData | n/a | n/a |
IDelegate
Example
[{
"Application":"EPS",
"LastUpdateTimestamp":"\/Date(1265052761768)\/",
"LastUpdateUserId":"SRS_EBO",
"StaffFromId":2,
"StaffToId":2365,
"StatusCode":"A"
}]
Property constraints
Property | Type | Max |
---|
Application | string | 8 |
LastUpdateTimestamp | date | n/a |
LastUpdateUserId | string | 8 |
StaffFromId | int | n/a |
StaffToId | int | n/a |
StatusCode | string | 1 |