Business Logic

At the moment, any DMS is inserting the master vehicle data though a file import process (ie. ModelTreeData excel file). What is requested from the implementing DMS is to fill in an excel sheet with all information about business static vehicle information (eg. Fuel types, Bodystyle) and other dynamic business values like the Model Codes and Vehicle options. 

This rigid model of updating new incoming model tree data only though a file, the (data integrity) validation of which happened by the OneDealer IT Dept., is to change with the Vehicle Master Data API, the feature of which is defined in Jira.



Rationale

Any DMS Party should be free to implement an endpoint, as part of our Product API via ODIL with which, the Model Tree Data could be enhanced ad-hoc. At the same time, other parties could choose to follow the standard File Import process and send the ModelTreeData.xls (eg. for parties not involving ODIL at all).

In order to minimize double maintenance efforts and utilize SSIS File Import Process as is while facilitating the requirement through an API, the core logic of the Vehicle Master Data API is the following.


  1. (OneDealer) The DMS triggers the UpdateModelTreeData endpoint. If data validation is passed then DSW automatically creates an ModelTreeData (XLS) in the standard format required by the SSIS Package (.dtsx). Other wise a BC Error is returned.
  2. (OD.Cockpit) DSW subsequently calls the OD.Cockpit Windows Service running on the server of the application.
  3. (SSIS) OD.Cockpit triggers the respective SSIS Package (HANA or SQL Server) and the result is written back to the SSIS Logs


1. Master Data API (DSW) 

Ref. FDD here

OD Service Definition: Here


  • DSW receives a call to Update Model Tree Data.
  • ModelTreeManager.CreateModelTreeDataFile is called
  • Technical Validations are firstly done:
    • Is SSIS job setup complete?
      • SSIS Package must be set
      • SSIS Package Parameters must be set
  • Business Validations follow 
    • Duplicate Check
    • All mandatory Model Tree properties exist
    • Model Levels are set correctly
    • Codes always come with a name or description to support UI.
  • The XLS Template is created with all the necessary Tabs/Properties
  • The XLS File is filled with the data parsed from the payload
  • The XLS File is stored as ModelTreeData_<CompanyName>_<File Timestamp>.xls
  • SSIS Job is created in DSW  (shown in /ssis/SSISJobsGridList) with status "Initialized"
  • OD.Cockpit is called with the mandatory parameters (see. setup section below)
    • SSIS File Import Package file name (SSISPackageName)
    • Model Tree File Directory (FileImportDirectory)
    • SSIS Process Configuration ID  (ODParamActiveProjectConfigurationID)
  • OD Service returns OK back to DMS
  • Asynchronously, the SSIS Package will update the DSW (SSIS Jobs Gridlist) with the outcome of the overall process logs. (Status can be either "Failed" or "Succeded") 


2. OD Cockpit (Windows Service) (OneDealer Cockpit)

The OD.Cockpit Service is a windows service that can run SSIS Packages processes by name. It is a windows service. 

OD.Cockpit Service

  1. Always check that the targetted (.dtsx) exist in the OD-Cockpit's File Directory.
    1. in the OD-Cockpit's Content directory C:\Websites\OD-Services\OneDealer.ImportCockpit.Service\Content\SSIS_Packages.
  2. Always check that the service is running in the host server.

          Otherwise, run the windows service installation script in C:\Websites\OD-Services\OneDealer.ImportCockpit.Service\Content\bat

After the SSIS package runs, OD.Cockpit will update back the Site Root URL (ie. the calling app) with the outcome from the SSIS process run.

3. SSIS Process

The SSIS Process will run and eventually update back the DSW with the outcome.  SSISLogs will be updated as well, providing context for any exceptions or validation errors.


Prerequisites / Setup

As shown before, to conclude the import process, a SSIS Package for importing the master data is eventually required.  The configuration that is needed for this flow is minimal and is stored in the IDMS_SSIS_JOB_SETUP table

For every new job setup, the user will mandatorily need to set:

Master Data API - SSIS Job Setup

(Step 1) Setting the "Import File Directory" - (Only IT to change it) 

  • A parameter called "FileImportDirectory" is required, referencing the SSIS Package that it relates to.


(Step 2) Setting the "SSIS Project Configuration ID"

  • Another parameter called "ODParamActiveProjectConfigurationID" is required, that has as a value a unique code which adheres to an SSIS Package Configuration ID. Every client application, should have its own Configuration ID, which is an identifier used by the File Import process, to retrieve subsequent information required for the successful completion of the file Import. 

    (Dimitris Emanoulopoulos & Panos Roussos should give the Configuration ID for every new Master DB installation)


(Configuration example from RCGENDEV)

RCGENDEV

*Notice that the entry with the PackageFile should stay as is and is not to be changed. Only the parameters that refer to it (the link is the U_IDMS_ParentCode property, which in our example refers to the Code of the "ModelTreeImport" entry)


Technical Information

Service Definitions

One Dealer Service Specs: Here

Internal Service Definition

<Method>
    <ActionControllerMethod>
        <InterfaceType>OneCore.Core.Interfaces.Inventory.IModelTreeManager, OneCore.Core.Interfaces</InterfaceType>
        <Method>CreateModelTreeDataFile</Method>
    </ActionControllerMethod>
<MethodName>UpdateModelTreeData</MethodName>
</Method>


 Classes

  • ModelTreeManager.cs

Import Models

  • ILModelImportModel.cs                Vehicle Models
  • ILFamilyImportModel.cs                Vehicle Families
  • ILMakeImportModel                      Vehicle Makes
  • ILModelPriceImportModel             Vehicle Model Prices
  • ILOptionImportModel                    Vehicle Option Prices
  • ILOptionCategoryImportModel     Vehicle Option Categories
  • ILVatProductGroupImportModel   VAT Product Groups
  • CodeNameModel                           Emissions, Bodystyles, Vehicle Types, Drive Types, Tax Groups etc...

New Libraries Used

  • Aspose.Cells, Version=7.5.2.0
Write a comment…